vim - 可否在粘帖时保持垂直方向对齐?
巴扎黑
巴扎黑 2017-05-16 16:33:57
[PhpStudy讨论组]

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

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

then i tab Ctrl-v

淡淡烟草味

"+pVG>

ringa_lee

设置成自动缩进试试

:set autoindent
漂亮男人

:set paste

曾经蜡笔没有小新

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

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号