tani / vim-jetpack

The lightning-fast plugin manager, alternative to vim-plug
https://gist.asciidoctor.org/?github-tani/vim-jetpack/main//README.adoc&source-highlighter=highlightjs
MIT License
323 stars 32 forks source link

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

Closed younger-1 closed 2 years ago

younger-1 commented 2 years ago

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. 图片

younger-1 commented 2 years ago

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

tani commented 2 years ago

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

younger-1 commented 2 years ago

Thx, this works for my case:

autocmd VimEnter * let &path .= ',.'
younger-1 commented 2 years ago

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

tani commented 2 years ago

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?

younger-1 commented 2 years ago

Thanks for your information! It was caused by vim-scriptease :

https://github.com/tpope/vim-scriptease/blob/710fe7c2f3c636fae0b5cac041ff8da028a0777f/plugin/scriptease.vim#L118

which calls this:

https://github.com/tpope/vim-scriptease/blob/710fe7c2f3c636fae0b5cac041ff8da028a0777f/autoload/scriptease.vim#L788

tani commented 2 years ago

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!