On Thu, May 9, 2013 at 12:44 AM, yoni kessler <[email protected]>wrote:

> thanks allot!
>
> I'm a bit familiar with regex,
> but can you please explain what exactly does   :'<,'>  means?
>

Hi Yoni,

The '<,'> range stands for the current (or last) visual selection.

When you have a visual selection and type :, the command line automatically
gets this '<,'> range avec the colon.

If you wanted to apply the search and replace command on the whole file,
you would use % to specify the range of the s/.$ command :

:%s/.$

To do that only on the last/current visual selection :

:'<,'>s/.$

To do that on lines 2 to 4 :

:2,4s/.$

If you type :helpgrep '<,'> (and then :cn to navigate to the next
occurrences found in the documentation) you can read more about it.
For example this in usr_10.txt :

```
The '< and '> are actually marks, placed at the start and end of the Visual
selection.  The marks remain at their position until another Visual
selection
is made.  Thus you can use the "'<" command to jump to position where the
Visual area started.  And you can mix the marks with other items: >

:'>,$

This addresses the lines from the end of the Visual area to the end of the
file.
```

nico






> thanks again
>
> --
> --
> 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 because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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 because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to