public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Re: Commenting out multiple lines in vim
@ 2009-02-14  4:21 daid kahl
  2009-02-14  4:38 ` Stroller
  0 siblings, 1 reply; 8+ messages in thread
From: daid kahl @ 2009-02-14  4:21 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

> >>> 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

[-- Attachment #2: Type: text/html, Size: 2121 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [gentoo-user] Commenting out multiple lines in vim
@ 2009-02-12 19:53 Stroller
  2009-02-13  0:53 ` Philip Webb
  0 siblings, 1 reply; 8+ messages in thread
From: Stroller @ 2009-02-12 19:53 UTC (permalink / raw
  To: gentoo-user

Hi there,

I can find numerous references on the net to this behaviour:

    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.  Very convenient.

EG:
http://mail.python.org/pipermail/python-list/2001-May/084540.html
http://hurley.wordpress.com/2007/06/13/vim-tip-comment-out-multiple-lines/

Yet it doesn't seem to work on any of my Gentoo systems.

Is this something that is caused by a Gentoo-specific /etc/vimrc or  
has vim evolved?

Any comments gratefully received.

Stroller.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-02-14  6:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-14  4:21 [gentoo-user] Re: Commenting out multiple lines in vim daid kahl
2009-02-14  4:38 ` Stroller
2009-02-14  5:03   ` daid kahl
2009-02-14  6:02     ` Stroller
  -- strict thread matches above, loose matches on Subject: below --
2009-02-12 19:53 [gentoo-user] " Stroller
2009-02-13  0:53 ` Philip Webb
2009-02-13  5:48   ` Stroller
2009-02-13  6:49     ` Eray Aslan
2009-02-13  9:24       ` Joost Roeleveld
2009-02-13 12:37         ` [gentoo-user] " Nicolas Sebrecht
2009-02-13 12:54           ` Joost Roeleveld
2009-02-13 19:58       ` [gentoo-user] " Stroller
2009-02-13 21:45         ` [gentoo-user] " Nicolas Sebrecht
2009-02-14  4:11           ` Stroller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox