From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1LYC1j-0000Ge-7x for garchives@archives.gentoo.org; Sat, 14 Feb 2009 04:21:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 23C6AE04C2; Sat, 14 Feb 2009 04:21:14 +0000 (UTC) Received: from mail-bw0-f205.google.com (mail-bw0-f205.google.com [209.85.218.205]) by pigeon.gentoo.org (Postfix) with ESMTP id B9CBCE04C2 for ; Sat, 14 Feb 2009 04:21:13 +0000 (UTC) Received: by bwz1 with SMTP id 1so2240008bwz.10 for ; Fri, 13 Feb 2009 20:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=mkWWC1XcQUEVBJB2Pdr/FPCQCQ+YJ5jv3zVeOO4mxQU=; b=qvh+Qfu938SWub8F5vJFp/mPTXeBzvvTszEzDYd8YmHQiqXpBECW2yhVhjzgrFDgLP RLfi/3hw49At+eUnIU1acasUbOWyj8dB8iJShB355fEqFN0PQmRjFJt2VAYFh21vmBg/ gu5WyMv5xP3AtYozK/MtPdV7cZs5KTOzd+RhU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bflkC3yCHkbBxqbQX8Bs4hkA4aoK/QcbBdsFKZTJz3ZQtrRVozGDGfSx6s1W2ncfiv XmXS5xaVKPl21A4uTvlszhGXqCYgSh+xJAb+AmN3b9Jx/JqI9YlPrsZdKegVosE0/Nj7 jfNtNujvBI0ecYbxeDwKx2seVfq3EGsoZlkCM= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.103.182.3 with SMTP id j3mr182302mup.113.1234585272981; Fri, 13 Feb 2009 20:21:12 -0800 (PST) Date: Sat, 14 Feb 2009 13:21:12 +0900 Message-ID: <3ac129340902132021u704eba0bx76311db6a8f43535@mail.gmail.com> Subject: [gentoo-user] Re: Commenting out multiple lines in vim From: daid kahl To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=0016363ba65ca418c40462d94815 X-Archives-Salt: da907e8e-4e96-4fea-9636-d32dc3d43004 X-Archives-Hash: 6fa1dfde91d7feaac00cbfa735e1990c --0016363ba65ca418c40462d94815 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit > >>> In vim, you can just select the rectangular region with Ctrl-v, > >>> then type "I#". 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 ") "Timestamp script for insert mode imap \d =strftime("%d %b %Y %H:%M:%S ") 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 --0016363ba65ca418c40462d94815 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
>>> 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 quic= ker to do :
>>
>>  :m,ns/^/#/
>
> I saw similar comments in my Google searches, but I am flummoxed how o= ne
> could find it so.
>
> Is it only on my keyboard that forward-slash is a "lower-case&quo= t; 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 mo= de 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 annoy= ing).  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, whic= h I find handy for journals or timestamp comments in code.  You can, o= f course, rearrange and edit how the time appears if you dislike my style.<= br>
"Timestamp script for command (normal) mode
nmap \d :execute &q= uot;normal i" . strftime("%d %b %Y %H:%M:%S ")<CR>
= "Timestamp script for insert mode
imap \d <C-R>=3Dstrftime(&q= uot;%d %b %Y %H:%M:%S ")<CR>

Is there any way to access the vim buffers from other than vi?  Us= ing 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 be= tter way to copy from Konsole that doesn't involve right click.  A= t least shift+insert works for pasting from elsewhere...

~daid
--0016363ba65ca418c40462d94815--