This extension consists of the following sections:
- rainbow.comments
- rainbow.bracket
- rainbow.indent
- code align
rainbow.comments
extension will help you create more human-friendly comments in your code.
With this extension, you will be able to categorise your annotations into:
- Alerts
!
- Queries
?
- TODOs
todo
- Highlights
- Commented out code can also be styled to make it clear the code shouldn't be there
- Any other comment styles you'd like can be specified in the settings
This extension can be configured in User Settings or Workspace settings.
"mftools.rainbow.comments.multilineComments": true
This setting will control whether multiline comments are styled using the annotation tags.
When false, multiline comments will be presented without decoration.
"mftools.rainbow.comments.highlightPlainText": false
This setting will control whether comments in a plain text file are styled using the annotation tags.
When true, the tags (defaults: ! * ? //
) will be detected if they're the first character on a line.
mftools.rainbow.comments.tags
The tags are the characters or sequences used to mark a comment for decoration.
The default 5 can be modifed to change the colors, and more can be added.
"mftools.rainbow.comments.tags": [
{
"tag": "!",
"color": "#FF2D00",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "?",
"color": "#3498DB",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "//",
"color": "#474747",
"strikethrough": true,
"backgroundColor": "transparent"
},
{
"tag": "todo",
"color": "#FF8C00",
"strikethrough": false,
"backgroundColor": "transparent"
},
{
"tag": "*",
"color": "#98C379",
"strikethrough": false,
"backgroundColor": "transparent"
}
]
Supported Languages
- Ada,AL,Apex,AsciiDoc
- C,C#,C++,ColdFusion,Clojure
- COBOL,CoffeeScript,CSS
- Dart,Dockerfile,Elixir,Elm,Erlang
- F#,Fortran
- gdscript,GenStat,Go,GraphQL,Groovy
- Haskell,Haxe,HiveQL,HTML
- Java,JavaScript,JavaScript React
- JSON with comments,Julia
- Kotlin
- LaTex (inlc. Bibtex/Biblatex)
- Less,Lisp,Lua
- Makefile,Markdown,MATLAB
- Nim
- Objective-C
- Objective-C++
- Pascal,Perl,Perl 6
- PHP,Pig,PlantUML,PL/SQL
- PowerShell,Puppet,Python
- R,Racket,Ruby,Rust
- SAS,Sass,Scala,SCSS
- ShaderLab,ShellScript
- SQL,STATA,Stylus,Swift
- Tcl,Terraform,Twig
- TypeScript,TypeScript React
- Verilog,Visual Basic,Vue.js
- YAML
Rainbow.bracket
Provide rainbow colors for the round bracket, the square bracket and the squiggly bracket. This is particularly useful for Lisp or Clojure programmers, and of course, JavaScript
, and other programmers.
The isolated right bracket will be highlighted in red.
rainbow.indent
A simple extension to make indentation more readable
rainbow.indent
colorizes the indentation in front of your text alternating four different colors on each step. Some may find it helpful in writing code for Nim or Python.
It uses the current editor window tab size and can handle mixed tab + spaces but that is not recommended. In addition it visibly marks lines where the indentation is not a multiple of the tab size. This should help to find problems with indentation in some situations.
Rainbow.indent Configuration
Although you can just use it as it is there is the possibility to configure some aspects of the extension:
// For which languages indent-rainbow should be activated (if empty it means all).
"mftools.rainbow.indent.includedLanguages": [] // for example ["nim", "nims", "python"]
// For which languages indent-rainbow should be deactivated (if empty it means none).
"mftools.rainbow.indent.excludedLanguages": ["plaintext"]
// The delay in ms until the editor gets updated.
"mftools.rainbow.indent.updateDelay": 100 // 10 makes it super fast but may cost more resources
Notice: Defining both includedLanguages
and excludedLanguages
does not make much sense. Use one of both!
You can configure your own colors by adding and tampering with the following code:
// Defining custom colors instead of default "Rainbow" for dark backgrounds.
// (Sorry: Changing them needs an editor restart for now!)
"mftools.rainbow.indent.colors": [
"rgba(255,255,64,0.07)",
"rgba(127,255,127,0.07)",
"rgba(255,127,255,0.07)",
"rgba(79,236,236,0.07)"
]
// The indent color if the number of spaces is not a multiple of "tabSize".
"mftools.rainbow.indent.errorColor": "rgba(128,32,32,0.6)"
// The indent color when there is a mix between spaces and tabs.
// To be disabled this coloring set this to an empty string.
"mftools.rainbow.indent.tabmixColor": "rgba(128,32,96,0.6)"
Notice: errorColor
was renamed from error_color
in earlier versions.
Skip error highlighting for RegEx patterns. For example, you may want to turn off the indent errors for JSDoc's valid additional space (disabled by default), or comment lines beginning with //
// Example of regular expression in JSON (note double backslash to escape characters)
"mftools.rainbow.indent.ignoreLinePatterns" : [
"/[ \t]* [*]/g", // lines begining with <whitespace><space>*
"/[ \t]+[/]{2}/g" // lines begininning with <whitespace>//
]
Skip error highlighting for some or all languages. For example, you may want to turn off the indent errors for markdown
and haskell
(which is the default)
"mftools.rainbow.ignoreErrorLanguages" : [
"markdown",
"haskell"
]
code align
Align chars in selection. It helps creating clean, formatted code.
Select text,run with ontext menu commend.
shortcuts
u can add shortcuts by edit keybindings
at workspce config
like this:
"keybindings": [
{
"command": "mftools.align.all",
"key": "alt+=",
"when": "editorHasSelection"
},
{
"command": "mftools.align.first",
"key": "alt+shift+=",
"when": "editorHasSelection"
},
{
"command": "mftools.align.whitespace",
"key": "alt+-",
"when": "editorHasSelection"
}
]
the command list:
[
{
"command": "mftools.align.all",
"title": "Align all chars"
}
,
{
"command": "mftools.align.first",
"title": "Align to first char"
}
,
{
"command": "mftools.align.whitespace",
"title": "Align whitespace"
}
]
code align setting
This extension contributes the following settings:
alignment.chars
: pairs chars (strings) and their space settings
Space settings:
spaceBefore
: spaces count before char(s),
spaceAfter
: spaces count after char(s),
tabsBefore
: tabs count before char(s),
tabsAfter
: tabs count after char(s).
// Chars to align
"mftools.align.chars": {
":": {
"spaceBefore": 0,
"spaceAfter": 1
},
"::": {
"spaceBefore": 0,
"spaceAfter": 0
},
"=": {
"spaceBefore": 1,
"spaceAfter": 1
},
"===": {
"spaceBefore": 1,
"spaceAfter": 1
},
"==": {
"spaceBefore": 1,
"spaceAfter": 1
},
"=>": {
"spaceBefore": 1,
"spaceAfter": 1
},
"+=": {
"spaceBefore": 1,
"spaceAfter": 1
},
"-=": {
"spaceBefore": 1,
"spaceAfter": 1
},
"*=": {
"spaceBefore": 1,
"spaceAfter": 1
},
"/=": {
"spaceBefore": 1,
"spaceAfter": 1
}
}
change log
change_logo
License : "MIT"
Powerdeby:
Enjoy !