dotfiles/roles/neovim/files/after/plugin/treesitter.lua

40 lines
770 B
Lua
Raw Normal View History

local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup {
context_commenting = {
2022-01-09 00:07:35 +00:00
enable = true,
},
ensure_installed = "maintained",
highlight = {
enable = true,
},
indent = {
disable = { "yaml" },
enable = true,
2022-01-09 00:07:35 +00:00
},
2022-03-31 00:13:30 +00:00
matchup = {
enable = true,
},
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
},
},
}
2022-04-03 19:45:24 +00:00
local nmap = require "opdavies.keymap".nmap
nmap({ "<leader>th", "<cmd>TSHighlightCapturesUnderCursor<CR>" })
nmap({ "<leader>tp", "<cmd>TSPlaygroundToggle<CR>" })