Vim奇怪的ocaml插件绑定甚至可以使用--noplugin运行
在编辑ocaml文件(*.ml)文件时,每次我使用Vim奇怪的ocaml插件绑定甚至可以使用--noplugin运行,vim,ocaml,Vim,Ocaml,在编辑ocaml文件(*.ml)文件时,每次我使用t打开command时,vim都会说“找不到类型注释(.annot)文件”。当我使用s切换Syntastic时,vim转到当前文件的接口文件(x.ml到x.mli) 当我运行:map时,我看到了这些绑定: x \t @<Plug>OCamlPrintType n \t @<Plug>OCamlPrintType
t
打开command时,vim都会说“找不到类型注释(.annot)文件”。当我使用s
切换Syntastic时,vim转到当前文件的接口文件(x.ml到x.mli)
当我运行:map时,我看到了这些绑定:
x \t @<Plug>OCamlPrintType
n \t @<Plug>OCamlPrintType
n \S @<Plug>OCamlSwitchNewWin
n \s @<Plug>OCamlSwitchEdit
x \C @<Plug>BUncomOff
n \C @<Plug>LUncomOff
x \c @<Plug>BUncomOn
n \c @<Plug>LUncomOn
x <Plug>OCamlPrintType * :<C-U>call Ocaml_print_type("visual")<CR>`<
n <Plug>OCamlPrintType * :<C-U>call Ocaml_print_type("normal")<CR>
n <Plug>OCamlSwitchNewWin * :<C-U>call OCaml_switch(1)<CR>
n <Plug>OCamlSwitchEdit * :<C-U>call OCaml_switch(0)<CR>
x\t@OCamlPrintType
n\t@OCamlPrintType
n\S@OCamlSwitchNewWin
n\s@OCamlSwitchEdit
x\C@BUncomOff
n\C@LUncomOff
x\c@BUncomOn
n\c@LUncomOn
x OCamlPrintType*:调用Ocaml\u print\u type(“可视”)`<
n OCamlPrintType*:调用Ocaml\u print\u type(“正常”)
n OCamlSwitchNewWin*:调用OCaml\u开关(1)
n OCamlSwitchEdit*:调用OCaml\u开关(0)
然后我运行vim--noplugin
,这些映射仍然存在。在
~/.vim/after/ftplugin/ocaml.vim
中,我只有一行设置了ocaml缩进,因此问题一定在其他地方。什么是创建这些绑定?如何关闭它们?
--noplugin
只需设置无加载插件
选项。这个选项所做的唯一一件事就是禁止从插件/
目录从运行时路径
加载文件
因此
ftplugin/
目录中的某个地方定义的,并且vimrc中有filetype…on
,则--noplugin
不会阻止加载它们。具体地说,OCamlPrintType
是在随vim分发的ftplugin/ocaml.vim
中定义的。你可以用
echo globpath(&runtimepath, 'ftplugin/ocaml*')
获取所有存在ocaml
ftplugin的地方<代码>~/.vim/after不是ftplugin可能位于的唯一位置set loadplugins
行,那么--noplugin
是完全无用的,不会影响任何东西.vimrc
中存储的内容也没有任何作用:详细映射\t
将告诉您这些映射的设置位置。如果您不向我们显示您的配置,我们只能为您做这些。@romainl您可以检查随Vim分发的文件类型插件。这些映射就在那里。谢谢你的解释。我发现这行if!存在(“无插件映射”)&&!在ocaml.vim中存在(“无ocaml映射”)
,因此我在我的vimrc中添加了让无ocaml映射=1
,ocaml映射现在消失了。