每当我尝试使用Vim打开任何文件时,我都会收到以下错误消息:
Error detected while processing /home/emma/.vimrc:
line 138:
E484: Can't open file '/home/emma/.opam/system/share/ocp-indent/vim/indent/ocaml.vim'
Press ENTER or type command to continue
但是奇怪的是,当我这样做时,文件实际上打开了:
vim ~/.opam/system/share/ocp-indent/vim/indent/ocaml.vim
因此,我已经确认该文件确实存在,并且Vim能够显示代码。
答案 0 :(得分:3)
当vim说
E484: Can't open file '/home/emma/.opam/system/share/ocp-indent/vim/indent/ocaml.vim'
它的字面意思是一个名为'/home/emma/.opam/system/share/ocp-indent/vim/indent/ocaml.vim'
(不是/home/emma/.opam/system/share/ocp-indent/vim/indent/ocaml.vim
)的文件。
换句话说,问题在于您在文件名周围添加了引号。
修复:
source /home/emma/.opam/system/share/ocp-indent/vim/indent/ocaml.vim
此外,您可以在此处使用~
:
source ~/.opam/system/share/ocp-indent/vim/indent/ocaml.vim