habamax / vim-godot

Use vim and godot engine to make games
MIT License
498 stars 24 forks source link

Usage with built-in gdscript filetype #71

Closed promisedlandt closed 7 months ago

promisedlandt commented 7 months ago

Hello,

I'm using vim-godot with vim 9.1.
None of the options in vim-godot take effect - comments is not set, the Godot* commands do not exist, and the [[ mappings are not set up.

It looks to me like your gdscript ftplugin shipped with vim sets b:did_ftplugin, then the ftplugin from vim-godot gets loaded and exits at the first guard because it checks the same variable.
This is also according to the script order in scriptnames.

It seems to me like this should affect everyone, but I couldn't find an issue for this.
Any ideas?

habamax commented 7 months ago

Should work fine:

image

image

image

vim 9.1.205

promisedlandt commented 7 months ago

May I ask in which order the two vim91/ftplugin/gdscript.vim / vim-godot/ftplugin/gdscript.vim appear in your scriptnames?
If the vim-godot one gets sourced first, it would explain why it works for you.

habamax commented 7 months ago

May I ask in which order the two vim91/ftplugin/gdscript.vim / vim-godot/ftplugin/gdscript.vim appear in your scriptnames?

It is standard runtimepath, where .vim/pack/* comes before everything from installed vim.

promisedlandt commented 7 months ago

It is standard runtimepath, where .vim/pack/* comes before everything from installed vim.

Thank you!
I use Guix to manage my vim plugins, and it's the other way around there. I've fixed it by prepending to packpath instead of appending.