wieker schrieb:
> Hi,
>
> i want to indent pasted with 'p' command text automatically, as
> described here:
> http://vim.wikia.com/wiki/Format_pasted_text_automatically
>
> but command p=`] work strange (for my mind): last line don't indent.
> for example
>
> original text:
> int func1()
> {
> }
>
> yanked text:
> for(;;)
> {
> printf("vim");
> }
>
> after p=`n command i see
> int func1()
> {
> for(;;)
> {
> printf("vim");
> }
> }
>
> but after pv`]= command:
> int func1()
> {
> for(;;)
> {
> printf("vim");
> }
> }
>
> last pasted line after =`] command stay without indenting, but after
> v`]= indent correct (as i want)
> is it bug? or i should read manuals more?
Mark motions are exclusive
:h mark-motions
Under
:h exclusive
you can read
| 1. If the motion is exclusive and the end of the motion is in
| column 1, the end of the motion is moved to the end of the
| previous line and the motion becomes inclusive.
This is why the line with "}" is excluded.
You can use the linewise mark motions:
=']
--
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---