Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and delete multiscreen blocks of text or write e.g. three large methods out to another file and then delete them for testing purposes in Vim when using it via putty/ssh where you cannot use the mouse?
I can easily yank-to-the-end-of-line or yank-to-the-end-of-code-block but if the text extends over many screens, or has lots of blank lines in it, I feel like my hands are tied in Vim. Any solutions?
And a related question: is there a way to somehow select 40 lines, and then comment them all out (with ‘#’ or ‘//’), as is common in most IDEs?
Well, first of all, you can set
vimto work with the mouse, which would allow you to select text just like you would inEclipse.You can also use the Visual selection – v, by default. Once selected, you can
yank,cut, etc.As far as commenting out the block, I usually select it with
VISUAL, then doReplacing the beginning of each line with a
#. (The'<and'>markers are the beginning and and of the visual selection.