Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vim奇怪的ocaml插件绑定甚至可以使用--noplugin运行_Vim_Ocaml - Fatal编程技术网

Vim奇怪的ocaml插件绑定甚至可以使用--noplugin运行

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

在编辑ocaml文件(*.ml)文件时,每次我使用
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可能位于的唯一位置

  • 如果在vimrc中有
    set loadplugins
    行,那么
    --noplugin
    是完全无用的,不会影响任何东西
  • 它对
    .vimrc
    中存储的内容也没有任何作用

  • :详细映射\t
    将告诉您这些映射的设置位置。如果您不向我们显示您的配置,我们只能为您做这些。@romainl您可以检查随Vim分发的文件类型插件。这些映射就在那里。谢谢你的解释。我发现这行
    if!存在(“无插件映射”)&&!在ocaml.vim中存在(“无ocaml映射”)
    ,因此我在我的vimrc中添加了
    让无ocaml映射=1
    ,ocaml映射现在消失了。