vim - 可否在粘帖时保持垂直方向对齐?
巴扎黑
巴扎黑 2017-05-16 16:33:57
0
5
561

系统粘帖板里有如下内容。

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

我想复制到文件成下面的格式。

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

请问,有无偷懒的办法?

第一次光标在行首,使用 "+p 粘帖的结果

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

第二次光标在第五列,使用 "+p 粘帖的结果

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

可否一次粘帖成这样?
第一次粘帖的结果,运行 %s/^/ /g
第二次粘帖的结果,运行 1,$s/^/ /g
都可以得到下面的结果,我想偷懒一次就做到这样的结果,请问,可以做到吗?

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

全部回复(5)
小葫芦

:set ai

然后i tab Ctrl-v

淡淡烟草味

"+pVG>

左手右手慢动作

设置成自动缩进试试

:set autoindent
漂亮男人

:设置粘贴

曾经蜡笔没有小新

首先shift+v选中一行然后按j向下选中多行,最后shift + >, 不知道是不是你要的。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!