File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,3 +5,8 @@ Rainbow delimiters for Neovim with Tree-sitter
55** Repository:** < https://github.com/HiPhish/rainbow-delimiters.nvim >
66
77This is a hard fork of the nvim-ts-rainbow2 plugin & is recommended over it.
8+
9+ This plugin adds the following mappings:
10+
11+ - ` <Leader>u( ` toggles rainbow delimiters for the current buffer
12+ - ` <Leader>u) ` toggles rainbow delimiters globally
Original file line number Diff line number Diff line change 1+ local enabled = true
2+
13return {
24 {
35 " HiPhish/rainbow-delimiters.nvim" ,
@@ -22,6 +24,21 @@ return {
2224 end ,
2325 desc = " Toggle rainbow delimeters (buffer)" ,
2426 },
27+ [" <Leader>u)" ] = {
28+ function ()
29+ local rainbow_delimiters = require " rainbow-delimiters"
30+ enabled = not enabled
31+ for _ , bufnr in ipairs (vim .api .nvim_list_bufs ()) do
32+ if enabled then
33+ rainbow_delimiters .enable (bufnr )
34+ else
35+ rainbow_delimiters .disable (bufnr )
36+ end
37+ end
38+ require (" astrocore" ).notify (string.format (" Global rainbow delimeters %s" , enabled and " on" or " off" ))
39+ end ,
40+ desc = " Toggle rainbow delimeters (global)" ,
41+ },
2542 },
2643 },
2744 },
@@ -40,7 +57,7 @@ return {
4057 opts = {
4158 condition = function (bufnr )
4259 local buf_utils = require " astrocore.buffer"
43- return buf_utils .is_valid (bufnr ) and not buf_utils .is_large (bufnr )
60+ return enabled and buf_utils .is_valid (bufnr ) and not buf_utils .is_large (bufnr )
4461 end ,
4562 },
4663 },
You can’t perform that action at this time.
0 commit comments