diff --git a/nvimrc b/nvimrc index 1bc2b5d..dec8bc1 100644 --- a/nvimrc +++ b/nvimrc @@ -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 diff --git a/vim/lua/treesitter_config.lua b/vim/lua/treesitter_config.lua index 8d4ed4d..af4ad84 100644 --- a/vim/lua/treesitter_config.lua +++ b/vim/lua/treesitter_config.lua @@ -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: diff --git a/vim/after/queries/go/textobjects.scm b/vim/queries/go/textobjects.scm similarity index 50% rename from vim/after/queries/go/textobjects.scm rename to vim/queries/go/textobjects.scm index bfcede0..b2d2e03 100644 --- a/vim/after/queries/go/textobjects.scm +++ b/vim/queries/go/textobjects.scm @@ -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))