| 1 |
vim.filetype.add({ extension = { goon = "goon" } })
|
| 2 |
|
| 3 |
-- Register custom goon parser with treesitter (old API)
|
| 4 |
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
| 5 |
parser_config.goon = {
|
| 6 |
install_info = {
|
| 7 |
url = "/home/tony/repos/tree-sitter-goon",
|
| 8 |
files = { "src/parser.c" },
|
| 9 |
},
|
| 10 |
filetype = "goon",
|
| 11 |
}
|
| 12 |
|
| 13 |
-- Configure nvim-treesitter with ensure_installed
|
| 14 |
require("nvim-treesitter.configs").setup({
|
| 15 |
ensure_installed = {
|
| 16 |
"json", "python", "ron", "javascript", "haskell", "d", "query",
|
| 17 |
"typescript", "tsx", "rust", "zig", "php", "yaml", "html", "css",
|
| 18 |
"markdown", "markdown_inline", "bash", "lua", "vim", "vimdoc", "c",
|
| 19 |
"dockerfile", "gitignore", "astro", "go", "templ"
|
| 20 |
},
|
| 21 |
highlight = {
|
| 22 |
enable = true,
|
| 23 |
},
|
| 24 |
indent = {
|
| 25 |
enable = true,
|
| 26 |
},
|
| 27 |
})
|
| 28 |
|
| 29 |
require("nvim-treesitter-textobjects").setup({
|
| 30 |
select = {
|
| 31 |
lookahead = true,
|
| 32 |
},
|
| 33 |
})
|
| 34 |
|
| 35 |
vim.keymap.set({ "x", "o" }, "af", function()
|
| 36 |
require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects")
|
| 37 |
end)
|
| 38 |
vim.keymap.set({ "x", "o" }, "if", function()
|
| 39 |
require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects")
|
| 40 |
end)
|
| 41 |
|
| 42 |
require("treesitter-context").setup({})
|