我的 中有以下几行.vimrc
:
" UNIX fileformat
au BufRead,BufNewFile * set fileformats=unix,dos
au BufRead,BufNewFile * set fileformat=unix
这些是使用 unix 文件格式制作任何打开的文件。
除了帮助消息外,它几乎适用于所有情况。如果我输入,让我们说:
:h help
Vim 首先抱怨:
"helphelp.txt" [readonly] 350L, 13662C Error detected while processing
BufRead Auto commands for "*": E21: Cannot make changes, 'modifiable'
is off: fileformat=unix
显然,我试图在不可修改的缓冲区上设置 fileformat 选项,所以这个错误是可以预料的。但是,在不删除其他文件功能的情况下摆脱它的最干净的方法是什么?
有没有办法有条件地应用/不应用帮助缓冲区的自动命令?
谢谢你。