Nvim: many small changes around whole project

This commit is contained in:
Robert Kmieć
2024-03-29 09:33:27 +01:00
parent a2832ed454
commit 687646da32
16 changed files with 291 additions and 99 deletions

View File

@@ -10,13 +10,17 @@ return {
config = function()
-- Tree-sitter configuration
ts = require'nvim-treesitter.configs'
local ts = require'nvim-treesitter.configs'
ts.setup {
highlight = {
enable = true,
disable = function(lang, buf)
return vim.api.nvim_buf_line_count(buf) > 5000
local max_filesize = 100 * 1024
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
additional_vim_regex_highlighting = false,
},
@@ -60,10 +64,9 @@ return {
"vim",
"yaml",
},
-- disabled, since it mostly shifts to four characters
--indent = {
-- enable = true,
--},
indent = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
@@ -79,7 +82,7 @@ return {
include_match_words
},
}
-- vim.opt.foldmethod = "expr"
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
end
}