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
317 stars 31 forks source link

The filetype is not set #114

Closed z-kk closed 1 year ago

z-kk commented 1 year ago

I wrote the following in my .vimrc

packadd vim-jetpack
call jetpack#begin()
Jetpack 'zah/nim.vim'
Jetpack 'dag/vim-fish'
call jetpack#end()

and run :JetpackSync.

After that, when I open a fish file or nim file, the filetype is not set.

The filetype is set in the ftdetect directory of each plugin. When I create symbolic link to ftdetect in start dir like following, the filetype is set.

$ .../pack/jetpack/start/_ $ ln -s ../../opt/_/ftdetect
tani commented 1 year ago

Thank you for using this software! It might work your configuration by adding the follows

Jetpack 'tani/vm-jetpack', { 'opt':1 }

Cheers.

z-kk commented 1 year ago

You mean

packadd vim-jetpack
call jetpack#begin()
Jetpack 'tani/vim-jetpack', {'opt': 1}
Jetpack 'zah/nim.vim'
Jetpack 'dag/vim-fish'
call jetpack#end()

in .vimrc?

That didn't solve the problem...

tani commented 1 year ago

I see. Hmm... Okay I will inspect it with my laptop. However, now I am trippring.Please give me a few days to reply you again.

z-kk commented 1 year ago

It doesn't work with vim ver.8.2 on WSL(Debian11). But I just tried it with vim.exe ver.9.0 on PowerShell, and it works!

CoelacanthusHex commented 1 year ago

I had a similar problem, but not quite the same. Here he is that the ftdetect of the plugin that is always loaded is not loaded, and mine is that the ftdetect of the plugin that is loaded on demand through the on_ft setting is not loaded. I don't know if this is expected behavior (it seems to be a loop, the plugin has to be loaded to recognize the filetype, and only loaded if the filetype is recognized), but it clearly affects normal use. If this is expected, then I would like to modify the behavior so that ftdetect is always loaded for plugins with the on_ft option; if this is a bug, please fix it. I don't know if it makes sense to reply to this question here, if not, I'll open a new issue.

Edited: Vim version: 9.0.1306 MWE:

packadd vim-jetpack
call jetpack#begin()
call jetpack#add('vim-crystal/vim-crystal', { 'on_ft': ['crystal'] })
call jetpack#end()
z-kk commented 1 year ago

It doesn't work with vim ver.8.2 on WSL(Debian11). But I just tried it with vim.exe ver.9.0 on PowerShell, and it works!

I found that filetype Nim was added Vim core in patch-9.0.0566.

@tani I'm not in a hurry, so feel free to reply whenever it's convenient for you.

z-kk commented 1 year ago

My understanding of the vim specs was not good enough and I had set filetype plugin indent on before loading this plugin in my .vimrc. When I removed it, it worked fine.

tani commented 1 year ago

Thank you for reporting this issue. I am pleased to inform you that the issue has been resolved in the current revision. I have tested your configuration on my laptop and can confirm that it is working well. Please feel free to verify it on your end.