search

Home  >  Q&A  >  body text

vim plug-in - current path problem when vim ctrlp file search

When I use the ctrlp plug-in to open a file, after opening a certain file, the file directory automatically switches to the directory where the certain file is located, so I cannot search for files in other directories.

As shown in the picture, I created the directory ABC and two files de,
When I,

cd A
vim .
:pwd #这里显示的是A
#<leader>p ctrlp的快捷键搜索当前目录下的子文件,打开文件d
:pwd #这时候显示的是 /A/B  因此这时候我想通过ctrlp搜索目录下的其他文件的时候就搜索不到了,例如搜不到上述例子中的文件e

The vimrc configuration file does not have a setting item for set autochildir

phpcn_u1582phpcn_u15822778 days ago919

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 16:36:01

    I saw these two lines of code in my vimrc configuration

    "工作目录随文件变
    autocmd BufEnter * cd %:p:h

    Sure enough, you have to configure the configuration yourself, don’t copy and paste other people’s directly. . .

    reply
    0
  • Cancelreply