Oliver Davies
19f1820a2a
Change from the old `maintained` value to `all` for now, and later specify a list of which languages I want to use.
41 lines
810 B
Lua
41 lines
810 B
Lua
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
|
|
if not status_ok then
|
|
return
|
|
end
|
|
|
|
configs.setup {
|
|
context_commenting = {
|
|
enable = true,
|
|
},
|
|
-- TODO: specify which languages to install.
|
|
ensure_installed = "all",
|
|
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",
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
local nmap = require "opdavies.keymap".nmap
|
|
|
|
nmap({ "<leader>th", "<cmd>TSHighlightCapturesUnderCursor<CR>" })
|
|
nmap({ "<leader>tp", "<cmd>TSPlaygroundToggle<CR>" })
|