Tuesday, April 27, 2010

Re: A 'visible within the window' range?

Thanks for the explanations!


Duane

On Apr 27, 2010, at 7:34 PM, Tim Chase <vim@tim.thechases.com> wrote:

> On 04/27/2010 06:36 PM, AK wrote:
>> On 04/27/2010 07:22 PM, Duane Johnson wrote:
>>> So the % symbol is a special range that means 'the whole file'. Is
>>> there a similar special symbol that means 'what is visible in the
>>> window'?
>>
>> HVL
>
> For the uninitiated, that terse 3-character response means
>
> H go to the top line displayed on the screen
> V go into line-wise visual mode
> L go to the last line displayed on the screen
>
> at which point, if you press ":", it will prepopulate the command-
> line with
>
> :'<,'>
>
> for the highlighted range (which now covers the lines visible on the
> screen) at which you can then type your command:
>
> :'<,'>s/foo/bar/g
>
> As an interesting side-note, assuming "*" isn't in your 'cpoptions'
>
> set cpoptions?
>
> once you've highlighted a range the first time, you can use your
> original syntax
>
> :*s/foo/bar/g
>
> as a shorthand for ":'<,'>s/foo/bar/g", as detailed at
>
> :help cpo-star
> :help :star
>
> Hope this helps,
>
> -tim
>
>
>
>
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment