zk-org / zk-nvim

Neovim extension for zk
https://github.com/zk-org/zk
GNU General Public License v3.0
502 stars 40 forks source link

fix(doc): add vim modeline to properly show the help #166

Closed tonyxwz closed 3 months ago

tonyxwz commented 3 months ago

Without this modeline, when I run :help zk-zk-nvim, the filetype is txt (text), not help.

tonyxwz commented 3 months ago

Before

Screenshot 2024-05-24 at 22 15 59

After

Screenshot 2024-05-24 at 22 16 52
tjex commented 3 months ago

Hmm, can't reproduce on my end. Is it just the spell checker which is leading you to the conclusion? i.e. does lua print(vim.bo.filetype) return text or help?

I take it the spell checker doesn't activate on other help files? And you're fully up to date with neovim / plugin versions?

That all being said, it's good practice to include the modeline anyway, and can't do any harm @kabouzeid ?

tonyxwz commented 3 months ago

This is how Neovim detects help files

https://github.com/neovim/neovim/blob/93c55c238f4c1088da4dc6ec80103eb3ef4085d2/runtime/lua/vim/filetype/detect.lua#L1561-L1563

does lua print(vim.bo.filetype) return text

It prints text