added custom htmldjango treesitter parser to repo
This commit is contained in:
+36
-3
@@ -286,8 +286,41 @@ function M.nvim_treesitter()
|
|||||||
return vim.api.nvim_buf_line_count(bufnr) > 5000
|
return vim.api.nvim_buf_line_count(bufnr) > 5000
|
||||||
end
|
end
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup({
|
local ts_config = require("nvim-treesitter.configs")
|
||||||
ensure_installed = {
|
|
||||||
|
local function install_htmldjango()
|
||||||
|
local parser_dir = ts_config.get_parser_install_dir()
|
||||||
|
|
||||||
|
if parser_dir == nil then
|
||||||
|
print("parser_dir is nil")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim.fn.isdirectory(parser_dir) == 0 then
|
||||||
|
print("parser_dir is not a directory")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local src = vim.fs.joinpath(vim.fn.stdpath("config"), "parsers", "htmldjango.so")
|
||||||
|
local dst = vim.fs.joinpath(parser_dir, "htmldjango.so")
|
||||||
|
|
||||||
|
if vim.fn.filereadable(src) == 0 then
|
||||||
|
print("htmldjango.so source does not exist")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim.fn.filereadable(dst) == 1 then
|
||||||
|
print("htmldjango.so is already installed")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.fn.filecopy(src, dst)
|
||||||
|
end
|
||||||
|
|
||||||
|
install_htmldjango()
|
||||||
|
|
||||||
|
ts_config.setup({
|
||||||
|
auto_install = {
|
||||||
"python",
|
"python",
|
||||||
|
|
||||||
"html",
|
"html",
|
||||||
@@ -309,6 +342,7 @@ function M.nvim_treesitter()
|
|||||||
"templ",
|
"templ",
|
||||||
"go",
|
"go",
|
||||||
"rust",
|
"rust",
|
||||||
|
"markdown",
|
||||||
},
|
},
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@@ -548,7 +582,6 @@ function M.lsp_zero()
|
|||||||
|
|
||||||
lsp.setup()
|
lsp.setup()
|
||||||
|
|
||||||
vim.lsp.log.error("SETTING UP LSP")
|
|
||||||
vim.lsp.enable("angular-language-server")
|
vim.lsp.enable("angular-language-server")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user