Closed Chewt closed 5 months ago
This is related to #16.
You can try this for now: https://stackoverflow.com/a/24931292
This should be fixed on normal Vim with f6497ee, I still get SQL loaded with neovim
I'm running neovim, and it seems like f6497ee fixed the issue! I'm not sure why you are still getting SQL loaded, but I can confirm that it works on my end.
Okay, great! Then let's hope it's just my setup
I'm not really sure why, but the issue has come back. I have tried to go back and use just the commit from when it worked, but it still isn't working. Did you ever get your setup to work with neovim?
Yea, I mainly use neovim. Check if it loads the plugin at all (e.g. see if it comes up after calling :scriptnames
)
after running :scriptnames
I can confirm that the plugin is showing up. For example this line appears:
~/.config/nvim/plugged/typst.vim/ftdetect/typst.vim
And you are certain that typst.vim
is updated? Could you include all of :scriptnames
? Did you add another plugin since last time?
I haven't added any plugins since last time
Here is the output from :scriptnames
1: /usr/share/nvim/runtime/ftplugin.vim
2: /usr/share/nvim/runtime/indent.vim
3: /etc/xdg/nvim/sysinit.vim
4: /usr/share/nvim/archlinux.vim
5: ~/.dotfiles/neovim/.config/nvim/init.lua
6: ~/.local/share/nvim/site/autoload/plug.vim
7: /usr/share/nvim/runtime/filetype.lua
8: ~/.dotfiles/neovim/.config/nvim/plugged/vimtex/ftdetect/cls.vim
9: ~/.dotfiles/neovim/.config/nvim/plugged/vimtex/ftdetect/tex.vim
10: ~/.dotfiles/neovim/.config/nvim/plugged/vimtex/ftdetect/tikz.vim
11: ~/.dotfiles/neovim/.config/nvim/plugged/ultisnips/ftdetect/snippets.vim
12: ~/.dotfiles/neovim/.config/nvim/plugged/typst.vim/ftdetect/typst.vim
13: /usr/share/vim/vimfiles/ftdetect/PKGBUILD.vim
14: /usr/share/vim/vimfiles/ftdetect/SRCINFO.vim
15: /usr/share/vim/vimfiles/ftdetect/meson.vim
16: /usr/share/nvim/runtime/syntax/syntax.vim
17: /usr/share/nvim/runtime/syntax/synload.vim
18: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/plugin/airline.vim
19: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/init.vim
20: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/parts.vim
21: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/formatter/short_path.vim
22: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/util.vim
23: ~/.dotfiles/neovim/.config/nvim/plugged/vimtex/plugin/vimtex.vim
24: ~/.dotfiles/neovim/.config/nvim/plugged/ultisnips/plugin/UltiSnips.vim
25: ~/.dotfiles/neovim/.config/nvim/plugged/ultisnips/autoload/UltiSnips/map_keys.vim
26: ~/.dotfiles/neovim/.config/nvim/plugged/vim-snippets/plugin/vimsnippets.vim
27: /usr/share/nvim/runtime/plugin/gzip.vim
28: /usr/share/nvim/runtime/plugin/health.vim
29: /usr/share/nvim/runtime/plugin/matchit.vim
30: /usr/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
31: /usr/share/nvim/runtime/plugin/matchparen.vim
32: /usr/share/nvim/runtime/plugin/netrwPlugin.vim
33: /usr/share/nvim/runtime/plugin/rplugin.vim
34: /usr/share/nvim/runtime/plugin/shada.vim
35: /usr/share/nvim/runtime/plugin/spellfile.vim
36: /usr/share/nvim/runtime/plugin/tarPlugin.vim
37: /usr/share/nvim/runtime/plugin/tohtml.vim
38: /usr/share/nvim/runtime/plugin/tutor.vim
39: /usr/share/nvim/runtime/plugin/zipPlugin.vim
40: /usr/share/vim/vimfiles/plugin/fzf.vim
41: ~/.dotfiles/neovim/.config/nvim/plugged/nvim-lspconfig/plugin/lspconfig.lua
42: ~/.dotfiles/neovim/.config/nvim/plugged/nvim-treesitter/plugin/nvim-treesitter.lua
43: /usr/share/nvim/runtime/plugin/editorconfig.lua
44: /usr/share/nvim/runtime/plugin/man.lua
45: /usr/share/nvim/runtime/plugin/nvim.lua
46: ~/.dotfiles/neovim/.config/nvim/plugged/ultisnips/after/plugin/UltiSnips_after.vim
47: ~/.dotfiles/neovim/.config/nvim/after/plugin/c.lua
48: ~/.dotfiles/neovim/.config/nvim/after/plugin/color.lua
49: ~/.dotfiles/neovim/.config/nvim/plugged/gruvbox/colors/gruvbox.vim
50: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions.vim
51: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/quickfix.vim
52: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline.vim
53: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/netrw.vim
54: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/fzf.vim
55: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/term.vim
56: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/section.vim
57: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/highlighter.vim
58: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/nvimlsp.vim
59: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/whitespace.vim
60: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/po.vim
61: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/wordcount.vim
62: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/keymap.vim
63: ~/.dotfiles/neovim/.config/nvim/plugged/vimtex/autoload/vimtex.vim
64: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/vimtex.vim
65: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/searchcount.vim
66: ~/.dotfiles/neovim/.config/nvim/plugged/gruvbox/autoload/airline/themes/gruvbox.vim
67: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/themes.vim
68: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/builder.vim
69: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/default.vim
70: ~/.dotfiles/neovim/.config/nvim/after/plugin/lsp.lua
71: ~/.dotfiles/neovim/.config/nvim/after/plugin/python.lua
72: ~/.dotfiles/neovim/.config/nvim/after/plugin/tex.lua
73: ~/.dotfiles/neovim/.config/nvim/after/plugin/treesitter.lua
74: ~/.dotfiles/neovim/.config/nvim/after/plugin/ultisnips.lua
75: /usr/share/nvim/runtime/ftplugin/sql.vim
76: /usr/share/nvim/runtime/autoload/sqlcomplete.vim
77: /usr/share/nvim/runtime/autoload/syntaxcomplete.vim
78: /usr/share/nvim/runtime/indent/sql.vim
79: /usr/share/nvim/runtime/indent/sqlanywhere.vim
80: /usr/share/nvim/runtime/syntax/sql.vim
81: /usr/share/nvim/runtime/syntax/sqloracle.vim
82: ~/.dotfiles/neovim/.config/nvim/plugged/typst.vim/ftplugin/typst.vim
83: ~/.dotfiles/neovim/.config/nvim/plugged/typst.vim/compiler/typst.vim
84: ~/.dotfiles/neovim/.config/nvim/plugged/typst.vim/syntax/typst.vim
85: /usr/share/nvim/runtime/autoload/provider/python3.vim
86: /usr/share/nvim/runtime/autoload/provider/pythonx.vim
87: /usr/share/nvim/runtime/autoload/remote/host.vim
88: /usr/share/nvim/runtime/autoload/provider/ruby.vim
89: /usr/share/nvim/runtime/ftoff.vim
90: ~/.dotfiles/neovim/.config/nvim/plugged/ultisnips/autoload/UltiSnips.vim
91: /usr/share/nvim/runtime/autoload/provider.vim
92: /usr/share/nvim/runtime/ftplugin/vim.vim
93: /usr/share/nvim/runtime/indent/vim.vim
94: /usr/share/nvim/runtime/syntax/vim.vim
95: /usr/share/nvim/runtime/syntax/lua.vim
96: /usr/share/nvim/runtime/syntax/vim/generated.vim
97: /usr/share/nvim/runtime/ftplugin/text.vim
98: ~/.dotfiles/neovim/.config/nvim/plugged/vim-airline/autoload/airline/extensions/wordcount/formatters/default.vim
Hmm, okay. this is very strange and difficult to debug. I would guess that this is the behavior I've seen from the beginning. Something causes neovim, but not vim, to load SQL. Another way to see this is through nvim -Vdebug.txt main.typ
and opening debug.txt
.
I will try to look at it more in the next few days.
I just wanted to let you know that I've tried finding the cause for this a few times now. Still haven't found either the cause of the problem or a solution to it. Will continue looking...
I'm going to look into this further, I've forked the repo and will probably submit a pull request when I've figured it out. So far it looks like the default sql.vim ftplugin uses some non-standard ways of detecting whether or not a ftplugin has been run instead of just respecting b:did_ftplugin like most other ftplugins.
Yes exactly. I just saw this on discord though, so maybe it's easiest to wait for upstream changes.
Oh! Well that that pretty much fixes the issue. I eagerly await the release haha.
I don't know why it's taken so long for neovim to include this patch in a release, but since my distro's vim package has the patch I will close this issue. It is long overdue :smiley:
A bunch of mappings are added from sql.vim since it seem like that is loaded first before changing the filetype to typst. Here are a few of the mappings that are added:
Personally I have a binding on. This means that if I want to go into normal mode and then move up a line, using
<c-c>
to<esc>
, but with all of these other bindings, it doesn't immediately stop waiting for key commands after I type<c-c>k
, instead of doing what I want it tries to run the commandi <C-C>k *@<C-\><C-O>:call sqlcomplete#Map("sqlKeyword\\w*")<CR><C-X><C-O>
from sql.vim