`

禁止vim换行后自动添加的注释符号

阅读更多

参考http://stackoverflow.com/a/23326474
在vimrc文件中加入如下命令即可,网络很多直接设置的方法在我这里都没有用,我的vim版本是7.4,而且我两台电脑上都不起作用。有时候找个靠谱的方法太难了。


augroup Format-Options
    autocmd!
    autocmd BufEnter * setlocal formatoptions-=c formatoptions-=r formatoptions-=o

    " This can be done as well instead of the previous line, for setting formatoptions as you choose:
    autocmd BufEnter * setlocal formatoptions=crqn2l1j
augroup END




分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics