Gentoo Archives: gentoo-user

From: daid kahl <daidxor@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Commenting out multiple lines in vim
Date: Sat, 14 Feb 2009 04:21:15
> >>> In vim, you can just select the rectangular region with Ctrl-v, > >>> then type "I#<ESC>". This will insert # in each line at the same > >>> column. > >> > >> If you want to comment a series of lines m-n , it's quicker to do : > >> > >> :m,ns/^/#/ > > > > I saw similar comments in my Google searches, but I am flummoxed how one > > could find it so. > > > > Is it only on my keyboard that forward-slash is a "lower-case" character > > that is accessed *without* the shift key deployed? > > > > How do you know m & n? > > Column and line numbers are shown on the lower right part of the screen. > > You can also enable line numbering, either in command mode using "set nu",
or in ~/.vimrc (which I prefer since I always like line numbers, except if I'm copy and pasting...then it's annoying). There is also a macro I made (stole from somewhere and modified) to enter the date on \d entered in both command mode and entry mode, which I find handy for journals or timestamp comments in code. You can, of course, rearrange and edit how the time appears if you dislike my style. "Timestamp script for command (normal) mode nmap \d :execute "normal i" . strftime("%d %b %Y %H:%M:%S ")<CR> "Timestamp script for insert mode imap \d <C-R>=strftime("%d %b %Y %H:%M:%S ")<CR> Is there any way to access the vim buffers from other than vi? Using Konsole, if I want to copy something from vim I have to highlight with the mouse and right click, which is annoying. I really just want a better way to copy from Konsole that doesn't involve right click. At least shift+insert works for pasting from elsewhere... ~daid


Subject Author
Re: [gentoo-user] Re: Commenting out multiple lines in vim Stroller <stroller@××××××××××××××××××.uk>