tani/vim-jetpack

[Question] how to resume vim option of `path`

Closed this issue · 7 comments

When I want to use gf to goto filename under cursor, it can't take me to the file which is in then same directory of current file.
And I found path option don't inclue . which is necessary to find files in the same directory.

" set path?
  path=~/.config/nvim,~/.vim,~/.vim/pack/jetpack/opt/nerdtree,/usr/share/vim/vimfiles,~/.vim/pack/jetpack/opt/_,/usr/share/vim/vim82,~/.vim/pack/jetpack/opt/_/after,/usr/share/vim/vimfiles/after,~/.vim/after

In the image below, neither startify nor startify.vim work properly.
图片

The problem is I even can't resume path by using set path& in ~/.vim/plugin/a.vim!

tani commented

Try autocmd VimEnter * let &path .= ','.getcwd(). Cheers!

Thx, this works for my case:

autocmd VimEnter * let &path .= ',.'

May i ask how jetpack change the path? Because I didn't see anywhere path was changed in the source code

tani commented

I surely say vim-jetpack does not change path. For the proof, we can see that path contains . using the following example.

call jetpack#begin()
call jetpack#add('michaelb/do-nothing.vim')
call jetpack#end()
echomsg &path

Would you mind to show the minimal settings to reproduce your problem?

tani commented

Ah! It's nice to inspect the reason. Tim's plugins are mostly fantastic, and however they oftenly breaks the Vim's default behaviour like this. Anyway, cheers!