Closed qmacro closed 9 months ago
Hi @qmacro ,
Oh, I didn't know it doesn't always exist! Yes, I think it makes sense to create it on the fly. @bugwelle , what's your take?
I'd say it makes sense to create it on the fly. But IIRC, NeoVim respects the XDG standard, so we may need to check $XDG_CONFIG_HOME
or use something like nvim --get-some-config
if that exists.
My initial version was something that "works on my machine". After all, that's how this project started :smile:
See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
See https://neovim.io/doc/user/starting.html#standard-path
:echo stdpath("config")
You can get the NeoVim config directory via nvim -c ':echo stdpath("config")' -c ':q' --headless
CONFIG_PATH="$(nvim -c ':echo stdpath("config")' -c ':q' --headless 2>&1)"
@qmacro I assumed the directory would be created once https://github.com/nvim-treesitter/nvim-treesitter was installed. I need to update my non-work PC where I'm still using NeoVim 0.6 (quite outdated).
Could you tell me whether the directory exists after you've installed nvim-treesitter?
Regards, Andre
It does not exist. After a fresh build of my ephemeral Neovim container image which includes not only the actual installation of nvim-treesitter but also some TSInstall action, this is the state of my .config/nvim/
:
root@87625fde56e4:~# tree .config/nvim/
.config/nvim/
|-- after
| `-- plugin
| |-- dracula.lua
| |-- harpoon.lua
| |-- lint.lua
| |-- lsp-zero.lua
| |-- lualine.lua
| |-- mason.lua
| |-- nvim-cmp.lua
| |-- telescope.lua
| `-- treesitter.lua
|-- init.lua
|-- lazy-lock.json
`-- lua
`-- qmacro
|-- auto.lua
|-- init.lua
|-- lazy.lua
|-- remap.lua
`-- set.lua
5 directories, 16 files
Thanks. I'll have to test around a bit. I'm not familiar with NeoVim package managers, etc. @David-Kunz If you know more and are interested in this topic? If so, I'd leave it to you :smile: Otherwise, I'll create a few Docker images for different package managers and try to create some semi-automatic test setup.
// Of course, contributions from you, @qmacro, and other people, are very much welcome as well! :smiley:
I've prepared #15 : It unconditionally creates the queries
directory.
Rather than send another PR, I thought I'd raise this here.
To complete the setup of this treesitter mechanism for CDS, the
*.scm
files need to be copied to aqueries/
dir, as done in the second part ofsetup-nvim-treesitter.sh
.@David-Kunz 's recent change makes sense and moves from a package manager specific
queries/
directory to one in the neovim configuration path.However,
$HOME/.config/nvim/queries/
does not necessarily exist, at least not in my exploratory setup.So perhaps we want to remove this part of the script:
as I guess it is perhaps only really relevant in the (old) context of a package manager specific location?
Then, after such a removal, the fact that
$HOME/.config/nvim/queries/
doesn't always exist would be mitigated by this part anyway:Thoughts?