1
0
Fork 0

nvim: Migrate configuration to lua and built-in plugin manager

This commit is contained in:
Olli 2026-04-19 12:53:37 +02:00
commit 6440203958
26 changed files with 453 additions and 616 deletions

View file

@ -1,57 +1,75 @@
return {
"nvim-treesitter/nvim-treesitter",
event = {
"BufReadPre",
"BufNewFile",
},
build = ":TSUpdate",
config = function()
local treesitter = require("nvim-treesitter.configs")
vim.pack.add({
gh("neovim-treesitter/nvim-treesitter"),
})
treesitter.setup({
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true
},
autotag = {
enable = true,
},
ensure_installed = {
"json",
"javascript",
"yaml",
"html",
"css",
"markdown",
"markdown_inline",
"bash",
"lua",
"vim",
"gitignore",
"go",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
rainbow = {
enable = true,
disable = { "html" },
extended_mode = false,
max_file_lines = nil,
},
context_commentstring = {
enable = true,
enable_autocmd = false,
},
})
end,
--require("nvim-treesitter.configs").setup({
-- highlight = {
-- enable = true,
-- additional_vim_regex_highlighting = false,
-- },
-- indent = {
-- enable = true
-- },
-- autotag = {
-- enable = true,
-- },
-- ensure_installed = {
-- "json",
-- "javascript",
-- "yaml",
-- "html",
-- "http",
-- "css",
-- "markdown",
-- "markdown_inline",
-- "bash",
-- "lua",
-- "vim",
-- "gitignore",
-- "go",
-- },
-- incremental_selection = {
-- enable = true,
-- keymaps = {
-- init_selection = "<C-space>",
-- node_incremental = "<C-space>",
-- scope_incremental = false,
-- node_decremental = "<bs>",
-- },
-- },
-- rainbow = {
-- enable = true,
-- disable = { "html" },
-- extended_mode = false,
-- max_file_lines = nil,
-- },
-- context_commentstring = {
-- enable = true,
-- enable_autocmd = false,
-- },
--})
require("nvim-treesitter").install {
"fish",
"lua",
"gitcommit",
"gitignore",
"http",
"html",
"css",
"javascript",
"json",
"yaml",
"markdown",
"markdown_inline",
"go",
}
vim.api.nvim_create_autocmd("FileType", {
pattern = { "http", "html", "go" },
callback = function()
vim.treesitter.start()
--vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
--vim.wo.foldmethod = "expr"
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})