From fd3094ae4ffe46c58c938f0e2543081762696a18 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 6 Mar 2025 00:13:44 +0000 Subject: Set treesitter to always highlight if possible. --- init.vim | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'init.vim') diff --git a/init.vim b/init.vim index 2cf7c02..250ad9b 100644 --- a/init.vim +++ b/init.vim @@ -122,8 +122,6 @@ noremap t TroubleToggle 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 -- cgit