Two years ago I started my employment with rPath.
Lots of things happened so far; I’ve learned a lot and I still feel like I have a lot more to learn. That’s a good thing, I believe if you think there is nothing more to learn it’s probably time to look for another challenge. Pico della Mirandolla allegedly said something along the lines of “I know everything there can be known, and even more than that”. I’ll try not to say the same thing any time soon
Archive for October, 2008
Terrible twos
Friday, October 17th, 2008VIM tip of the day
Thursday, October 9th, 2008An operation I happen to do a lot:
Given a list of words spread on separate lines, sort the words.
One can try to do :sort or !sort on a range, but that will sort the lines, not the words inside the lines.
Easiest I found so far (but requires visual formatting which is only available in vim):
- visual select of the lines you want to sort
- !!fmt -1
- visual select of the lines you want to sort
- :sort
- gw}
Clear as mud
Explanation:
! will run the selection through an external program, in this case fmt (which is a Unix command to format a list of lines). -1 says to format with a text width of 1 character (which effectively breaks the words at the space)
:sort will sort the selected lines
gw} will format from where the cursor is to the end of the paragraph (re-joining the lines).