refactor(nvim): manage Neovim with Home Manager
This commit is contained in:
parent
83c43d07df
commit
5630466780
42 changed files with 5 additions and 0 deletions
72
config/neovim/after/plugin/treesitter.lua
Normal file
72
config/neovim/after/plugin/treesitter.lua
Normal file
|
@ -0,0 +1,72 @@
|
|||
local has_configs, configs = pcall(require, "nvim-treesitter.configs")
|
||||
if not has_configs then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local parser_install_dir = vim.fn.stdpath('data') .. "/site";
|
||||
|
||||
configs.setup {
|
||||
context_commenting = {
|
||||
enable = true,
|
||||
},
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"comment",
|
||||
"css",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"php",
|
||||
"regex",
|
||||
"rst",
|
||||
"scss",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vue",
|
||||
"yaml",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
disable = { "yaml" },
|
||||
enable = true,
|
||||
},
|
||||
matchup = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
parser_install_dir = parser_install_dir,
|
||||
}
|
||||
|
||||
vim.opt.runtimepath:append(parser_install_dir)
|
||||
|
||||
local nmap = require("opdavies.keymap").nmap
|
||||
|
||||
nmap { "<leader>th", "<cmd>TSHighlightCapturesUnderCursor<CR>" }
|
||||
nmap { "<leader>tp", "<cmd>TSPlaygroundToggle<CR>" }
|
||||
|
||||
local has_context, context = pcall(require, "treesitter-context")
|
||||
if not has_context then
|
||||
return
|
||||
end
|
||||
|
||||
context.setup { enable = true }
|
Loading…
Add table
Add a link
Reference in a new issue