kristijanhusak / vim-packager

Vim plugin manager that utilizes "jobs" and "pack" features.
MIT License
245 stars 9 forks source link

runtimepath is not added automatically for all plugins #17

Closed zachliu closed 4 years ago

zachliu commented 4 years ago

through reasons i have yet known, certain plugins like lambdalisue/gina.vim still requires the following to be done manually :thinking:

set runtimepath+=~/.config/nvim/pack/packager/start/gina.vim

otherwise it's not recognized

kristijanhusak commented 4 years ago

I'll check. Did you try packadd gina.vim?

zachliu commented 4 years ago

yeah, no luck

kristijanhusak commented 4 years ago

@zachliu I see in the related issue that you are trying to call gina function from your vimrc. Problem is that at that moment when you call the function gina is not loaded, because native vim packages load them asynchronously (vimrc first, and then plugins).

This should work for you:

autocmd VimEnter * call s:setup_gina()

function! s:setup_gina() abort
  for gina_cmd in ['branch', 'changes', 'log', 'commit', 'status']
    call gina#custom#command#option(gina_cmd, '--opener', 'tabedit')
  endfor

  for gina_cmd in ['diff']
    call gina#custom#command#option(gina_cmd, '--opener', 'vsplit')
  endfor

  call gina#custom#command#option('commit', '--verbose')
  call gina#custom#command#option('branch', '--verbose|--all')
endfunction
zachliu commented 4 years ago

oooohhh, right, how did i forget the async :man_facepalming: thank you so much!

zachliu commented 4 years ago

this may or may not be related, but i found that i also had to put

  autocmd FileType python syntax keyword pythonBuiltinObj self

in that function otherwise the autocmd does nothing, which makes little sense here :thinking:

kristijanhusak commented 4 years ago

where did you find this information?

zachliu commented 4 years ago

it's part of my customized syntax highlighting

kristijanhusak commented 4 years ago

I don't know what syntax highligthing has to do with gina plugin. What is self in this? Never saw something like that. Are you using vim or neovim? Do you have filetype plugin indent on in your vimrc?

All of this is not related to packager because it doesn't do anything besides installing / updating packages to folder that is auto loaded by vim.

zachliu commented 4 years ago

i'm using neovim and i have filetype plugin indent on my guess is a rogue plugin is overwriting my autocmd FileType ....

zachliu commented 4 years ago

btw,

autocmd FileType python syntax keyword pythonBuiltinObj self

means when the set ft=python event happens, the python key word self shall be colored (highlighted) as one of the pythonBuiltinObj which is a category of keyword :grin:

kristijanhusak commented 4 years ago

ah, self is a keyword :D I thought it is a reference to the vim function or something :D I'm not sure why that happens, but it's not related to vim packager.