restructured nvim config

This commit is contained in:
pika 2024-08-18 13:51:43 +02:00
parent 22d4936a21
commit 6bb0e86ded
9 changed files with 148 additions and 147 deletions

View file

@ -1,65 +1,37 @@
return {
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate",
dependencies = {
"windwp/nvim-ts-autotag",
},
config = function()
-- import nvim-treesitter plugin
local treesitter = require("nvim-treesitter.configs")
-- configure treesitter
treesitter.setup({ -- enable syntax highlighting
highlight = {
enable = true,
comments = { color = { "#333" }, italic = false }, -- adjust comment color and style
},
-- enable indentation
indent = { enable = true },
-- enable autotagging (w/ nvim-ts-autotag plugin)
autotag = {
enable = true,
},
-- ensure these language parsers are installed
ensure_installed = {
"bash",
"fish",
"http",
"html",
"php",
"css",
"scss",
"gitignore",
"git_config",
"markdown",
"markdown_inline",
"dockerfile",
"yaml",
"json",
"javascript",
"typescript",
"graphql",
"lua",
"query",
"c",
"prisma",
"hyprlang",
"ini",
"passwd",
"vim",
"vimdoc",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
})
end,
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPre", "BufNewFile" },
build = ":TSUpdate",
dependencies = {
"windwp/nvim-ts-autotag",
},
config = function()
require("nvim-treesitter.configs").setup({
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
autotag = { enable = true },
ensure_installed = {
"bash", "fish", "http", "html", "php", "css", "scss",
"gitignore", "git_config", "markdown", "markdown_inline",
"dockerfile", "yaml", "json", "javascript", "typescript",
"graphql", "lua", "query", "c", "prisma", "hyprlang",
"ini", "passwd", "vim", "vimdoc",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
-- Add these fields to address the error
sync_install = true,
auto_install = true,
})
end,
}