fix(nvim): treesitter config
This commit is contained in:
parent
896039d13f
commit
884eb5e454
2
nvimrc
2
nvimrc
|
@ -1,6 +1,6 @@
|
||||||
" Prefer $HOME/.vim to $HOME/.config/nvim (for now):
|
" Prefer $HOME/.vim to $HOME/.config/nvim (for now):
|
||||||
" TODO: refactor file structure for nvim
|
" 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
|
let &packpath = &runtimepath
|
||||||
|
|
||||||
set background=dark
|
set background=dark
|
||||||
|
|
|
@ -1,13 +1,30 @@
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
-- TODO: only install needed
|
ensure_installed = {
|
||||||
ensure_installed = "all",
|
"bash",
|
||||||
|
"dockerfile",
|
||||||
|
"go",
|
||||||
|
"gomod",
|
||||||
|
"gosum",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"make",
|
||||||
|
"python",
|
||||||
|
"ruby",
|
||||||
|
"rust",
|
||||||
|
"sql",
|
||||||
|
},
|
||||||
|
sync_install = true,
|
||||||
|
auto_install = false,
|
||||||
|
ignore_install = {},
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
disable = { "vim", "swift" },
|
disable = { "vim", "swift" },
|
||||||
additional_vim_regex_highlighting = true,
|
additional_vim_regex_highlighting = true,
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = false,
|
||||||
},
|
},
|
||||||
indent = {
|
indent = {
|
||||||
-- enabling breaks autoindent:
|
-- enabling breaks autoindent:
|
||||||
|
|
|
@ -6,23 +6,3 @@
|
||||||
(keyed_element (_) . (_) @keyed_element.inner) @keyed_element.outer
|
(keyed_element (_) . (_) @keyed_element.inner) @keyed_element.outer
|
||||||
(field_declaration type: (_) @keyed_element.inner) @keyed_element.outer
|
(field_declaration type: (_) @keyed_element.inner) @keyed_element.outer
|
||||||
(parameter_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))
|
|
Loading…
Reference in New Issue