Some more counting examples:

        :%s/./&/gn              characters
        :%s/\i\+/&/gn           words
        :%s/^//n                lines
        :%s/the/&/gn            "the" anywhere
        :%s/\<the\>/&/gn        "the" as a word

Yosi

On Thu, Nov 20, 2008 at 5:34 AM, Tim Chase <[EMAIL PROTECTED]> wrote:
>
>> You can %s/>/>/g
>> This way, undo is not necessary
>
> For more complex ones, this can be written
>
>   :%s/regexp/&/g
>
> However, even though you know this doesn't change anything, Vim
> still things that the content has been modified, and sets the
> 'modified' flag on the file.
>
> Using the "n" flag
>
>   %s/foo//gn
>
> doesn't make the file modified.
>
> -tim
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to