feature: nvim plugins updates and some more fixes

This commit is contained in:
2026-07-18 16:18:15 +03:00
parent d719d62c6c
commit 24378f0aae
12 changed files with 114 additions and 78 deletions
+1
View File
@@ -20,6 +20,7 @@ vim.opt.listchars = {
trail = "·",
tab = " ",
}
vim.opt.undofile = true
-- Additional commands for typos
vim.api.nvim_create_user_command("Qa", "qa", {})
+2 -2
View File
@@ -26,8 +26,8 @@ return {
javascript = { "prettierd", "prettier", stop_after_first = true },
typescript = { "prettierd", "prettier", stop_after_first = true },
json = { "prettierd", "prettier_f", stop_after_first = true },
jsonc = { "prettierd_f", "prettier_f", stop_after_first = true },
json = { "prettierd", "prettier", stop_after_first = true },
jsonc = { "prettierd", "prettier", stop_after_first = true },
-- markdown = { "prettierd", "prettier", stop_after_first = true },
},
+4
View File
@@ -6,6 +6,10 @@ return {
ru = "ru",
},
use_libukb = false,
aliases = {
max_length = 3,
extra = { "sort", "term" },
},
},
},
{
+45 -44
View File
@@ -1,51 +1,52 @@
return {
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },
config = function()
ts = require("nvim-treesitter")
ts.setup()
ts.install({
"python",
"go",
"kotlin",
"dart",
"lua",
"bash",
"json",
"yaml",
"markdown",
"vim",
"vimdoc",
"html",
"css",
"javascript",
})
vim.treesitter.language.register("html", "gotmpl")
vim.api.nvim_create_autocmd("FileType", {
callback = function(args)
local lang = vim.treesitter.language.get_lang(args.match)
if vim.list_contains(ts.get_available(), lang) then
if not vim.list_contains(ts.get_installed(), lang) then
ts.install(lang):wait()
end
local ts = require("nvim-treesitter")
vim.treesitter.start(args.buf)
end
end,
desc = "enable nvim-treesitter and install parser if not installed",
})
ts.setup({
ensure_installed = {
"python",
"go",
"kotlin",
"dart",
"lua",
"bash",
"json",
"yaml",
"markdown",
"vim",
"vimdoc",
},
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
})
-- require("nvim-treesitter").setup()
-- {
-- ensure_installed = {
-- },
--
-- sync_install = false,
-- auto_install = true,
--
-- highlight = {
-- enable = true,
-- additional_vim_regex_highlighting = false,
-- },
-- })
pcall(vim.treesitter.language.register, "html", "gotmpl")
vim.api.nvim_create_autocmd("FileType", {
group = vim.api.nvim_create_augroup("TreesitterOnDemand", { clear = true }),
callback = function(args)
local ft = args.match
local lang = vim.treesitter.language.get_lang(ft) or ft
local installed = ts.get_installed and ts.get_installed() or {}
if not vim.list_contains(installed, lang) then
pcall(function()
local ok = ts.install(lang)
if ok and ok.wait then
ok:wait()
end
end)
end
pcall(vim.treesitter.start, args.buf, lang)
end,
desc = "enable nvim-treesitter and install parser if not installed",
})
end,
}