vim-plug icon indicating copy to clipboard operation
vim-plug copied to clipboard

Lazily loaded plugin loads before filetype is set by another plugin

Open ararslan opened this issue 6 years ago • 3 comments

By default, Vim thinks that .jl files are librep Lisp. The Julia language uses .jl as its file extension, and you can get .jl files to be recognized as Julia with the julia-vim plugin. However, it seems that lazily loaded plugins with { 'for': 'lisp' } load for .jl files, even with julia-vim installed with its Plug line before that of the other. That suggests to me a load order issue, like #85, but that particular issue was closed years ago.

For reference, here is the specific setup where this is occurring for me:

call plug#begin('~/.local/share/nvim/plugged')
" ...
Plug 'JuliaEditorSupport/julia-vim'
" ...
Plug 'eraserhd/parinfer-rust', { 'for': ['scheme', 'lisp', 'clojure', 'racket'], 'do': 'cargo build --release' }
call plug#end()

In the meantime I've been able to get around this by setting

autocmd FileType julia let g:parinfer_enabled=0

but that sort of defeats the purpose of lazily loading parinfer-rust in the first place.


:version
NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic
 -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnos
tics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20191107-13403-1or2rj3/neovim-
0.4.3/build/config -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/src -I/usr/local/include -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/deps-build/inclu
de -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/tmp/neo
vim-20191107-13403-1or2rj3/neovim-0.4.3/build/src/nvim/auto -I/tmp/neovim-20191107-13403-1or2rj3/neovim-0.4.3/build/include
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.4.3/share/nvim"
  • Type:
    • [x] Bug
    • [ ] Enhancement
    • [ ] Feature Request
    • [x] Question
  • OS:
    • [ ] All/Other
    • [ ] Linux
    • [x] OS X
    • [ ] Windows
  • Vim:
    • [ ] Terminal Vim
    • [ ] GVim
    • [x] Neovim

ararslan avatar Nov 10 '19 07:11 ararslan

It also works to do autocmd BufRead,BufNewFile *.jl set filetype=julia before call plug#begin(), but it's weird that it's necessary.

ararslan avatar Nov 10 '19 19:11 ararslan

@ararslan It's fine to override Vim's ftdetect.vim like that. You can put that code in ftdetect/ftdetect.vim so that it still works after :filetype off command.

janlazo avatar Nov 11 '19 01:11 janlazo

I don't understand, I thought the resolution of #85 was that this should work?

ararslan avatar Nov 11 '19 19:11 ararslan