fix(nvim): install Treesitter grammars with Nix

Fixes #48
This commit is contained in:
Oliver Davies 2023-04-17 17:56:53 +01:00
parent 76c327b9b9
commit 2a8f42c267
2 changed files with 1 additions and 30 deletions

View file

@ -4,8 +4,6 @@ if not has_configs then
end
local parser_install_dir = vim.fn.stdpath('cache') .. "treesitters";
configs.setup {
autotag = {
enable = true,
@ -13,29 +11,6 @@ configs.setup {
context_commenting = {
enable = true,
},
ensure_installed = {
"astro",
"bash",
"comment",
"css",
"dockerfile",
"go",
"html",
"javascript",
"json",
"lua",
"make",
"markdown",
"php",
"phpdoc",
"regex",
"rst",
"scss",
"typescript",
"vim",
"vue",
"yaml",
},
highlight = {
enable = true,
},
@ -59,12 +34,8 @@ configs.setup {
},
},
},
parser_install_dir = parser_install_dir,
}
vim.fn.mkdir(parser_install_dir, "p")
vim.opt.runtimepath:append(parser_install_dir)
local nmap = require("opdavies.keymap").nmap
nmap { "<leader>th", "<cmd>TSHighlightCapturesUnderCursor<CR>" }

View file

@ -67,7 +67,7 @@ in {
vimPlugins.nvim-dap-virtual-text
# Treesitter
vimPlugins.nvim-treesitter
vimPlugins.nvim-treesitter.withAllGrammars
vimPlugins.nvim-treesitter-context
vimPlugins.nvim-treesitter-textobjects