Gentoo Archives: gentoo-user

From: Joost Roeleveld <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Commenting out multiple lines in vim
Date: Fri, 13 Feb 2009 09:24:31
Message-Id: e9cf1bd99b0eb0f9a82f9058f9d0f2a8.squirrel@www.antarean.org
In Reply to: Re: [gentoo-user] Commenting out multiple lines in vim by Eray Aslan
1 On Fri, February 13, 2009 7:49 am, Eray Aslan wrote:
2 > On 13.02.2009 07:48, Stroller wrote:
3 >> On 13 Feb 2009, at 00:53, Philip Webb wrote:
4 >>> 090212 Stroller quoted:
5 >>>> In vim, you can just select the rectangular region with Ctrl-v,
6 >>>> then type "I#<ESC>". This will insert # in each line at the same
7 >>>> column.
8 >>>
9 >>> If you want to comment a series of lines m-n , it's quicker to do :
10 >>>
11 >>> :m,ns/^/#/
12 >>
13 >> I saw similar comments in my Google searches, but I am flummoxed how one
14 >> could find it so.
15 >>
16 >> Is it only on my keyboard that forward-slash is a "lower-case" character
17 >> that is accessed *without* the shift key deployed?
18 >>
19 >> How do you know m & n?
20 >
21 > Column and line numbers are shown on the lower right part of the screen.
22 >
23 >> Surely it's easier just to highlight the lines?
24 >
25 > Not when you are working with the keyboard most of the time. Taking
26 > your hands off the keyboard to use the mouse is time consuming and
27 > becomes rather annoying.
28
29 True, but with this method, you don't use the mouse, just the keyboard:
30 1) Go to first line
31 2) Press <CTRL>+V
32 3) go to last line
33 4) Press <ESC>
34 5) Press <SHIFT>+I
35 6) Press '#'
36 7) Press <ESC>
37
38 On my system I then need to move the cursor to actually see the change, is
39 this normal?
40
41 --
42 Joost

Replies

Subject Author
[gentoo-user] Re: Commenting out multiple lines in vim Nicolas Sebrecht <nicolas.s-dev@×××××××.net>
Re: [gentoo-user] Commenting out multiple lines in vim Stroller <stroller@××××××××××××××××××.uk>