Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-21 Thread Andy Smith
Hi Lee, On Mon, Aug 18, 2008 at 06:19:38PM +0100, LeeGroups wrote: > > >> But, what I'd love, is a way I can type say 11 and get it to > >> turn 11 lines into a comment. > >> > >> Does anyone know of a nice way to do that in vim? > >> > > > > CTRL-v (number), DOWN ARROW, SHIFT-i, #, ESC, DO

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-20 Thread DarkOtter
> >> :set nu > >> :s50,200/^/#/g > > > > Should that not be:- > > :50,200s/^/#/g That's what I meant anyway, but I forgot about the set number because I have that always-on in my vimrc anyway. -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-20 Thread Sean Miller
On Wed, Aug 20, 2008 at 2:38 PM, Philip Stubbs <[EMAIL PROTECTED]> wrote: > 2008/8/20 Sean Miller <[EMAIL PROTECTED]>: >> :set nu >> :s50,200/^/#/g > > Should that not be:- > :50,200s/^/#/g Yeah, that'd work better :-) Mea culpa... Sean -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/ma

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-20 Thread Philip Stubbs
2008/8/20 Sean Miller <[EMAIL PROTECTED]>: > :set nu > :s50,200/^/#/g Should that not be:- :50,200s/^/#/g -- Philip Stubbs -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-20 Thread Sean Miller
> DarkOtter wrote: >>> It's a little bit hacky, but the way I do that is to do a substitute with >>> the >>> 'start of line' token in the regexp. That way you can use a standard vim >>> range >>> e.g. 1,10 to do lines 1 to 11 That's the way that I've always tended to do it, but using lines as of

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-20 Thread Johnathon Tinsley
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 DarkOtter wrote: >> It's a little bit hacky, but the way I do that is to do a substitute with the >> 'start of line' token in the regexp. That way you can use a standard vim >> range >> e.g. 1,10 to do lines 1 to 11 > > EDIT: I forgot, if you want to

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-18 Thread DarkOtter
> It's a little bit hacky, but the way I do that is to do a substitute with the > 'start of line' token in the regexp. That way you can use a standard vim range > e.g. 1,10 to do lines 1 to 11 EDIT: I forgot, if you want to do a range from the current cursor position you can do it as '.,+x' where

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-18 Thread LeeGroups
>> But, what I'd love, is a way I can type say 11 and get it to >> turn 11 lines into a comment. >> >> Does anyone know of a nice way to do that in vim? >> > > CTRL-v (number), DOWN ARROW, SHIFT-i, #, ESC, DOWN ARROW > > works for me... And people wonder why VIM has a bad reputation LOL.

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-18 Thread DarkOtter
> > But, what I'd love, is a way I can type say 11 and get it to > > turn 11 lines into a comment. > > > > Does anyone know of a nice way to do that in vim? It's a little bit hacky, but the way I do that is to do a substitute with the 'start of line' token in the regexp. That way you can use a st

Re: [ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-18 Thread Matthew Macdonald-Wallace
Quoting Johnathon Tinsley <[EMAIL PROTECTED]>: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hello, > > We sometimes need to quickly comment out a, for example, vhost config in > vi. Now, I've worked out that you can add the first comment #, ESC and > then hit DOWN, FULL-STOP, DOWN, FULL-S

[ubuntu-uk] Advanced vi/vim command - commenting out a large section

2008-08-18 Thread Johnathon Tinsley
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, We sometimes need to quickly comment out a, for example, vhost config in vi. Now, I've worked out that you can add the first comment #, ESC and then hit DOWN, FULL-STOP, DOWN, FULL-STOP etc to quickly comment out multiple lines. But, what I'd