您的位置:首页 > 编程语言

vim 使用 smartindent 时,粘贴代码缩进问题

2010-07-01 17:08 423 查看
有时候从 web 上复制一段代码要粘贴到 vim 中,因为启用了
set smartindent

选项,粘贴后的缩进完全乱套。查 vim.cn 的 FAQ(14.14节)
知,可用
paste

选项禁用或启用
smartindent

选项。虽然前后麻烦些,至少问题解决了,
smartindent

还是不能缺的。

在粘贴文本到 vim 前,先:

:
set paste


完了再恢复:

:
set paste!


其实先禁用
smartindent

也一样的,不过至少
paste

smartindent

短 6 个字符,呵呵。

转自:http://chunzi.me/post/601
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: