summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2025-03-06 00:13:44 +0000
committerJosh Rahm <rahm@google.com>2025-03-06 00:13:44 +0000
commitfd3094ae4ffe46c58c938f0e2543081762696a18 (patch)
tree8cc16fa2d7159293eb67af0289c0586c98a2486a
parent7e4039c103f9cdf0d2c32704c91e1d60499c95d9 (diff)
downloadconfig.vim-fd3094ae4ffe46c58c938f0e2543081762696a18.tar.gz
config.vim-fd3094ae4ffe46c58c938f0e2543081762696a18.tar.bz2
config.vim-fd3094ae4ffe46c58c938f0e2543081762696a18.zip
Set treesitter to always highlight if possible.
-rw-r--r--init.vim11
1 files changed, 8 insertions, 3 deletions
diff --git a/init.vim b/init.vim
index 2cf7c02..250ad9b 100644
--- a/init.vim
+++ b/init.vim
@@ -122,8 +122,6 @@ noremap <leader>t <cmd>TroubleToggle<cr>
augroup InitVim
au!
- autocmd BufRead *.java,*.c,*.cpp,*.cxx,*.hs,*.ts TSBufEnable highlight
-
" Automatically stop highligting things when leaving insert mode. If I want
" the highlight back, I can just hit 'n' and it will come back.
"
@@ -346,6 +344,8 @@ lua << EOF
['@parameter.outer'] = 'v', -- charwise
['@function.outer'] = 'V', -- linewise
['@function.inner'] = 'V', -- linewise
+ ['@block.inner'] = 'V', -- linewise
+ ['@block.outer'] = 'V', -- linewise
},
-- If you set this to `true` (default is `false`) then any textobject is
-- extended to include preceding or succeeding whitespace. Succeeding
@@ -376,7 +376,12 @@ lua << EOF
},
}
-
+ require('nvim-treesitter.configs').setup({
+ highlight = {
+ enable = true, -- Enables highlighting for all supported filetypes
+ additional_vim_regex_highlighting = false, -- Disable regex-based highlighting for speed
+ },
+ })
function remove_package(str)
for k, v in pairs(package.loaded) do