Smart selection with double clicks for VS Code.
Smart selection with double clicks for VS Code.
Smart Clicks VS Code
Smart selection with double clicks for VS Code.
GIF Demo
Double clicks on the code.
bracket-pairPair to inner content of brackets.
▽
(foo, bar)
└──────┘dash- to identifier.
▽
foo-bar
└─────┘html-attr= to HTML attribute.
▽
└─────────┘html-element` └────────────────────┘
#### [`html-tag-pair`](https://github.com/antfu/vscode-smart-clicks/blob/main/src/rules/html-tag-pair.ts)
Open and close tags of a HTML element.
```html
▽
└─┘ └─┘js-arrow-fn=> to arrow function.
▽
(a, b) => a + b
└─────────────┘js-assign= to assignment.
▽
const a = []
└──────────┘
class B {
▽
b = 1;
└────┘
▽
ba = () => {};
└────────────┘
}js-blockBlocks like if, for, while, etc. in JavaScript.
▽
function () { }
└─────────────────┘▽
import { ref } from 'vue'
└───────────────────────┘This rule is disabled by default.
js-colon: to the value.
▽
{ foo: { bar } }
└─────┘jsx-tag-pairMatches JSX elements' start and end tags.
▽
(Hi)
└───────┘ └───────┘All the rules are enabled by default. To disable a specific rule, set the rule to false in smartClicks.rules of your VS Code settings:
// settings.json
{
"smartClicks.rules": {
"dash": false,
"html-element": false,
"js-block": true
}
}| ID | Description |
|---|---|
smartClicks.trigger |
Trigger Smart Clicks in current cursor position without mouse click |
Usage examples:
Command palette
Invoke the command palette by typing Ctrl+Shift+P and then typing Smart Clicks: Trigger.
Keyboard shortcuts
// keybindings.json
{
"key": "ctrl+alt+c",
"command": "smartClicks.trigger",
"when": "editorTextFocus"
}Vim keybindings (VSCodeVim is needed)
// settings.json
{
"vim.normalModeKeyBindings": [
{
"before": ["leader", "c"],
"commands": ["smartClicks.trigger"],
}
]
}Inspired by HBuilderX, initiated by 恐粉龙.
MIT License © 2022 Anthony Fu
No open issues yet, or sync has not completed.