vim 关闭自动缩进

如果在.vimrc中设置了自动缩进set autoindent(简写 set ai),那么在插入模式下粘贴代码时,vim会自动为代码缩进,导致格式混乱。

关闭办法:

vi /etc/vimrc

把set ai 改 set paste

再编辑就不会自动缩进了