-
-
Notifications
You must be signed in to change notification settings - Fork 347
plugins/rainbow: init #3574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
plugins/rainbow: init #3574
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ lib, ... }: | ||
lib.nixvim.plugins.mkVimPlugin { | ||
name = "rainbow"; | ||
package = "rainbow"; | ||
description = "Rainbow parentheses improved — shorter code, no level limit, smooth and fast with powerful configuration."; | ||
maintainers = [ lib.maintainers.saygo-png ]; | ||
globalPrefix = "rainbow_"; | ||
|
||
settingsExample = { | ||
active = 1; | ||
conf = { | ||
guifgs = [ | ||
"#7d8618" | ||
"darkorange3" | ||
"seagreen3" | ||
"firebrick" | ||
]; | ||
operators = "_,_"; | ||
parentheses = [ | ||
"start=/(/ end=/)/ fold" | ||
"start=/\\[/ end=/\\]/ fold" | ||
]; | ||
separately = { | ||
"*" = { }; | ||
markdown = { | ||
parentheses_options = "containedin=markdownCode contained"; | ||
}; | ||
haskell = { | ||
parentheses = [ | ||
"start=/\\[/ end=/\\]/ fold" | ||
"start=/\v\{\ze[^-]/ end=/}/ fold" | ||
]; | ||
}; | ||
css = 0; | ||
}; | ||
}; | ||
}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
empty = { | ||
plugins.rainbow.enable = true; | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added what i could, but sadly i just don't have the regex skills to properly escape these complex expressions in nix, in such a way that they also get escaped in lua while preserving their original meaning. |
||
defaults = { | ||
plugins.rainbow = { | ||
enable = true; | ||
settings = { | ||
conf = { | ||
guifgs = [ | ||
"royalblue3" | ||
"darkorange3" | ||
"seagreen3" | ||
"firebrick" | ||
]; | ||
ctermfgs = [ | ||
"lightblue" | ||
"lightyellow" | ||
"lightcyan" | ||
"lightmagenta" | ||
]; | ||
guis = [ "" ]; | ||
cterms = [ "" ]; | ||
operators = "_,_"; | ||
contains_prefix = "TOP"; | ||
parentheses_options = ""; | ||
parentheses = [ | ||
"start=/(/ end=/)/ fold" | ||
"start=/\\[/ end=/\\]/ fold" | ||
"start=/{/ end=/}/ fold" | ||
]; | ||
separately = { | ||
markdown = { | ||
parentheses_options = "containedin=markdownCode contained"; | ||
}; | ||
lisp = { | ||
guifgs = [ | ||
"royalblue3" | ||
"darkorange3" | ||
"seagreen3" | ||
"firebrick" | ||
"darkorchid3" | ||
]; | ||
}; | ||
haskell = { | ||
parentheses = [ | ||
"start=/(/ end=/)/ fold" | ||
"start=/\\[/ end=/\\]/ fold" | ||
"start=/\v\{\ze[^-]/ end=/}/ fold" | ||
]; | ||
}; | ||
tex = { | ||
parentheses_options = "containedin=texDocZone"; | ||
parentheses = [ | ||
"start=/(/ end=/)/" | ||
"start=/\\[/ end=/\\]/" | ||
]; | ||
}; | ||
vim = { | ||
parentheses_options = "containedin=vimFuncBody,vimExecute"; | ||
parentheses = [ | ||
"start=/(/ end=/)/" | ||
"start=/\\[/ end=/\\]/" | ||
"start=/{/ end=/}/ fold" | ||
]; | ||
}; | ||
perl = { | ||
syn_name_prefix = "perlBlockFoldRainbow"; | ||
}; | ||
stylus = { | ||
parentheses = [ "start=/{/ end=/}/ fold contains=@colorableGroup" ]; | ||
}; | ||
css = 0; | ||
sh = 0; | ||
vimwiki = 0; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
example = { | ||
saygo-png marked this conversation as resolved.
Show resolved
Hide resolved
|
||
plugins.rainbow = { | ||
enable = true; | ||
settings = { | ||
active = 1; | ||
conf = { | ||
guifgs = [ | ||
"#7d8618" | ||
"darkorange3" | ||
"seagreen3" | ||
"firebrick" | ||
]; | ||
parentheses = [ | ||
"start=/(/ end=/)/ fold" | ||
"start=/\\[/ end=/\\]/ fold" | ||
]; | ||
separately = { | ||
"*" = { }; | ||
haskell = { | ||
parentheses = [ | ||
"start=/\\[/ end=/\\]/ fold" | ||
"start=/\v\{\ze[^-]/ end=/}/ fold" | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can leave the
example
test case as is, butsettingsExample
here is used to generate the documentation. Hence, it would be better to shorten it to 5-10 options, otherwise it becomes quite unreadable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The defaults set by the plugin are almost identical to the example i took from the readme. So the default and example test cases almost test the same thing. Should i remove the example test case because of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferred to have
settingsExample
andexample
be more real world configuration examples.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really come up with anything more practical here. The issue is that the configuration for this plugin is mostly just colors, the rest is defined by default and works well. Majority of the fancy options are for fixing compatibility with other plugins but I've never had to use them.
Current example does show how you can disable filetypes, basic regex escaping from nix, and configure the colors which id wager is what most people will ever do with this plugin's configuration.