阻止CtrlP切换到子模块目录中的搜索

Daw*_*awg 1 vim macvim vim-plugin

我还在学习像专业人士一样使用vim.在这个过程中我注意到当我在项目目录中的子模块中打开一个文件时,CtrlP插件会将搜索的根目录切换到子模块目录的根目录.有没有办法防止这种情况,并将根搜索目录保留为orignal项目或最初打开的项目之一?

Ran*_*ris 8

您可能想要调整g:ctrlp_working_path_mode设置.听起来像你很可能想要一起禁用这个功能并手动设置你的工作目录:cd.

GitHub上的当前ctrlp文档:

When starting up, CtrlP sets its local working directory according to this
variable: 

  let g:ctrlp_working_path_mode = 'ra'

  c - the directory of the current file.
  a - like "c", but only applies when the current working directory outside of
      CtrlP isn't a direct ancestor of the directory of the current file.
  r - the nearest ancestor that contains one of these directories or files:
      .git .hg .svn .bzr _darcs
  w - begin finding a root from the current working directory outside of CtrlP
      instead of from the directory of the current file (default). Only applies
      when "r" is also present.
  0 or <empty> - disable this feature.

Note #1: if "a" or "c" is included with "r", use the behavior of "a" or "c" (as
a fallback) when a root can't be found.

Note #2: you can use a |b:var| to set this option on a per buffer basis.
Run Code Online (Sandbox Code Playgroud)