Inspired by the vim plugin, toggle-bool
- Easily toggle between booleans (i.e. true and false).
- Toggles selected boolean(s), or just the boolean that's beneath the cursor.
- Default keybinding:
alt+b
(or set a custom one).
- true <-> false
- yes <-> no
- on <-> off
- 0 <-> 1
- Extension adds the following keybinding.
// Copy to your `keybindings.json` and customize to override.
{
"key": "alt+b",
"command": "extension.toggleBool",
"when": "editorTextFocus"
}
- You can override the default boolean mapping.
// Boolean mappings can be set in settings.json
...
"toggleboolean.mapping": {
"true": false,
"false": true,
"yes": "no",
"no": "yes",
"on": "off",
"off": "on"
},
...
"toggleboolean.mapping": {
"0": 1,
"1": 2,
"2": 3,
"3": 0
},
npm install
npm run test