From: Gennady Bystritksy Date: 2005-02-15T04:35:35+09:00 Subject: Re: (OT) Programmer's editors for the Mac Trans wrote: > Thomas Kirchner wrote: > >>It has to be said. Gvim :) If you already know vi, it's the >>only way to fly. > > > I use vi/vim for quick/light editing. But I don't understand how others > use it as their main editor. And I don't say this lightly: I even > bought a book on using vi/vim. Yet I still often hear how "wonderous" > it is if one does. > > So tell me this, how does one copy and paste without counting lines? > Using n+yy & p (where n is some number) for a few lines is okay, but > beyond that... > > Thanks > T. > > In pure vi, I usually set a mark on the first line I like to copy, with mm (it remembers the position in register 'm'), go to the last line and do y'm. Then you can paste it wherever you want with p. In vim, there's a visual mode, where you can visually select text (selected characters are displayed in reverse video) and then choose any command to work on selected text, for example Vjjjy yanks 3 lines down the current cursor position, displaying those lines in reverse video along the way. Of course you can use more complex movement commands with visual mode. You can also choose between character selection (v), line selection (Shift-v) or column selection (Ctrl-v) to start visual mode. Gennady. P.S. I do use vi/vim as my main (and only) editor for everyday C++, Ruby, etc. development for the last 10 years. And I am totally happy with it ;-).