vim - Is it possible to maintain vertical alignment when pasting?
巴扎黑
巴扎黑 2017-05-16 16:33:57
0
5
594

The system pasteboard contains the following content.

home
help
variables
vi compatibility
modelines
word&line completion
searching
text selection
markets
indenting
reformatting

I want to copy the file into the following format.

    home
    help
    variables
    vi compatibility
    modelines
    word&line completion
    searching
    text selection
    markets
    indenting
    reformatting

Excuse me, is there any way to be lazy?

The first time the cursor is at the beginning of the line, the result of using "+p to paste

home
help
variables
vi compatibility
modelines
word&line completion
searching
text selection
markets
indenting
reformatting

The second time the cursor is in the fifth column, use "+p to paste the result

    home
help
variables
vi compatibility
modelines
word&line completion
searching
text selection
markets
indenting
reformatting

Can I paste it like this at once?
The result of the first paste, run %s/^/ /g
The result of the second paste, run 1, $s/^/ /g
can get the following results, I think I achieved this result just once by being lazy. Can I do it?

    home
    help
    variables
    vi compatibility
    modelines
    word&line completion
    searching
    text selection
    markets
    indenting
    reformatting
巴扎黑
巴扎黑

reply all(5)
小葫芦

:set ai

then i tab Ctrl-v

淡淡烟草味

"+pVG>

左手右手慢动作

Try setting it to automatic indentation

:set autoindent
漂亮男人

:set paste

曾经蜡笔没有小新

First use shift+v to select one line, then press j to select multiple lines downwards, and finally shift + >, I don’t know if this is what you want.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template