Or little computing tricks and hacks
Peculiarities in vi
November 23, 2013Posted by on
I have been using the vi editor for some time now, and is still my favourite editor. emacs is very powerful, and it has a lot of tools but if you don’t need nor use those tools, well is like having a complicated gedit.
I really had a laugh when I started the tutorial “Learn Python the Hard Way”, and was told not to use vi because it is too complicated. If you are not good at the keyboard, as in you are far from touch-typing, it will take you a while to get around to it. But when you do, you can really fly. There is also gvim, a combination of GUI and vi.
Nevertheless, vi has some quirks that make me wonder…
Starting one of my tutorials (Ruby on Rails?), it suggested to the reader to adjust the settings of the editor to have some automatic indentation for nested blocks. In vi this was:
And this works wonderfully when coding. But when doing cut-and-paste, the results leave much to be desired. So each time I want to cut and paste I had to unset the last line. Initially I did it by commenting the line, that is adding a double-quote at the beginning of the line. But then I decided to do it within the editor.
My first guess was:
Makes sense right? Except that is not… The correct command is:
How unconventional is that!