fix(nvim): treesitter config

This commit is contained in:
Rob Watson 2023-10-04 22:38:50 +02:00
parent 896039d13f
commit 884eb5e454
3 changed files with 21 additions and 24 deletions

2
nvimrc
View File

@ -1,6 +1,6 @@
" Prefer $HOME/.vim to $HOME/.config/nvim (for now):
" TODO: refactor file structure for nvim
set runtimepath^=~/.vim runtimepath+=~/.vim/after runtimepath+=~/.vim/lua
set runtimepath^=~/.vim runtimepath+=~/.vim/after runtimepath+=~/.vim/lua runtimepath+=~/.vim/queries
let &packpath = &runtimepath
set background=dark

View File

@ -1,13 +1,30 @@
require("nvim-treesitter.configs").setup({
-- TODO: only install needed
ensure_installed = "all",
ensure_installed = {
"bash",
"dockerfile",
"go",
"gomod",
"gosum",
"html",
"javascript",
"json",
"lua",
"make",
"python",
"ruby",
"rust",
"sql",
},
sync_install = true,
auto_install = false,
ignore_install = {},
highlight = {
enable = true,
disable = { "vim", "swift" },
additional_vim_regex_highlighting = true,
},
incremental_selection = {
enable = true,
enable = false,
},
indent = {
-- enabling breaks autoindent:

View File

@ -6,23 +6,3 @@
(keyed_element (_) . (_) @keyed_element.inner) @keyed_element.outer
(field_declaration type: (_) @keyed_element.inner) @keyed_element.outer
(parameter_declaration type: (_) @keyed_element.inner) @keyed_element.outer
;; return statement
(return_statement (_) @return)
;; functions and methods with an optional preceeding comment:
;;
;; TODO: comment only matches a single line.
((
(comment)? @_start
.
(method_declaration) @_end
) (make-range! "function_with_comment" @_start @_end))
((
(comment)? @_start
.
(function_declaration) @_end
) (make-range! "function_with_comment" @_start @_end))