diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 2cadd98..045bc33 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -46,7 +46,7 @@ "nvim-treesitter-context": { "branch": "master", "commit": "895ec44f5c89bc67ba5440aef3d1f2efa3d59a41" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "b913508f503527ff540f7fe2dcf1bf1d1f259887" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "a0f89563ba36b3bacd62cf967b46beb4c2c29e52" }, - "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, + "nvim-ts-rainbow2": { "branch": "master", "commit": "b2d1f4f51b1bd20de419ffb6f5d0876c4f20d9db" }, "otter.nvim": { "branch": "main", "commit": "8b46caf113918c26a9247031d6482709078ec907" }, "playground": { "branch": "master", "commit": "4044b53c4d4fcd7a78eae20b8627f78ce7dc6f56" }, "plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" }, diff --git a/nvim/.config/nvim/lua/plug/_treesitter.lua b/nvim/.config/nvim/lua/plug/_treesitter.lua index 22072a3..bb152fb 100644 --- a/nvim/.config/nvim/lua/plug/_treesitter.lua +++ b/nvim/.config/nvim/lua/plug/_treesitter.lua @@ -1,13 +1,17 @@ -require'nvim-treesitter.configs'.setup { +local rainbow = require('ts-rainbow') +require 'nvim-treesitter.configs'.setup { -- one of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = "all", - highlight = {enable = true}, - incremental_selection = {enable = true}, - textobjects = {enable = true}, - indent = {enable = true}, + highlight = { enable = true }, + incremental_selection = { enable = true }, + textobjects = { enable = true }, + indent = { enable = true }, -- enable rainbow brackets, needs p00f/nvim-ts-rainbow - rainbow = {enable = true}, + rainbow = { + enable = true, + strategy = { rainbow.strategy.global } + }, -- for improved commentstrings, needs corresponding plugin context_commentstring = {enable = true} diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 77624be..ecbef93 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -149,10 +149,18 @@ return { { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', - config = function() require('plug._treesitter') end + config = function() require('plug._treesitter') end, + event = "BufReadPre", + -- rainbow brackets using treesitter + -- show current cursor context at top of buffer + -- improves commenting plugin above by using ts + dependencies = { + 'https://gitlab.com/HiPhish/nvim-ts-rainbow2.git', + { 'romgrk/nvim-treesitter-context', config = true }, + 'JoosepAlviste/nvim-ts-context-commentstring' + } }, { 'nvim-treesitter/playground', cmd = "TSPlaygroundToggle" }, -- interactively view and query the treesitter tree - { 'romgrk/nvim-treesitter-context', event = "BufReadPre", config = true }, -- show current cursor context at top of buffer { 'RRethy/nvim-treesitter-textsubjects', -- allows using . and ; to target treesitter branches config = function() @@ -167,13 +175,11 @@ return { } end, event = "BufReadPre" - }, { 'p00f/nvim-ts-rainbow', event = "BufReadPre" }, -- rainbow brackets using treesitter - { 'JoosepAlviste/nvim-ts-context-commentstring', event = "BufReadPre" }, -- improves commenting plugin above by using ts - { - 'lewis6991/spellsitter.nvim', -- uses treesitter to highlight spelling errors - config = function() require('spellsitter').setup() end, - event = "BufReadPre" - }, -- lsp + }, { + 'lewis6991/spellsitter.nvim', -- uses treesitter to highlight spelling errors + config = function() require('spellsitter').setup() end, + event = "BufReadPre" +}, -- lsp { "VonHeikemen/lsp-zero.nvim", dependencies = {