Re: vi golf: command on a motion?

2022-01-12 Thread Tilo Stritzky
On 03/09/21 11:48 Marc Chantreux wrote: > hello people, > > Does anyone know how to get this done even faster: > > ma > } > :'a,ms/foo/bar .,/^$/s/foo/bar > even if it's short, I really would like to have > something which work the way I abuse the ! command in vim: > > !} > > act

Re: vi golf: command on a motion?

2021-09-03 Thread ropers
> i['d] forgotten & (not that useful in vim) but yes! now you reminds me, it makes perfect sense to use it in nvi. Speaking of things that make no sense in one vi clone but work in another, I recently ended up looking for a way to count occurrences of 'abc' in FILE, from within vi. In vim you just

Re: vi golf: command on a motion?

2021-09-03 Thread Marc Chantreux
hello, > The bang command has an equivalent in vi. this is the same command indeed but the ergonomy is quite different: vi don't "generate" the begining of a command including the range so we can't just delete a char and edit. > The closest you > can get to executing the same replacement via a v

Re: vi golf: command on a motion?

2021-09-03 Thread ben
>even if it's short, I really would like to have >something which work the way I abuse the ! command in vim: The bang command has an equivalent in vi. >so I just have to replace the ! by s/foo/bar and i get the job done. So far there is no vi command to perform such operation; bang is both a v

vi golf: command on a motion?

2021-09-03 Thread Marc Chantreux
hello people, Does anyone know how to get this done even faster: ma } :'a,ms/foo/bar even if it's short, I really would like to have something which work the way I abuse the ! command in vim: !} actually write a range on command line like :.,.6! so I just have to replace