Smart selection with double clicks for VS Code.
GIF Demo
Double clicks on the code.
Pair to inner content of brackets.
▽
(foo, bar)
└──────┘- to identifier.
▽
foo-bar
└─────┘= to HTML attribute.
▽
<div class="btn"></div>
└─────────┘< to the entire element.
▽
<div><div></div></div>
└────────────────────┘Open and close tags of a HTML element.
▽
<div><div></div></div>
└─┘ └─┘=> to arrow function.
▽
(a, b) => a + b
└─────────────┘= to assignment.
▽
const a = []
└──────────┘
class B {
▽
b = 1;
└────┘
▽
ba = () => {};
└────────────┘
}Blocks like if, for, while, etc. in JavaScript.
▽
function () { }
└─────────────────┘▽
import { ref } from 'vue'
└───────────────────────┘This rule is disabled by default.
: to the value.
▽
{ foo: { bar } }
└─────┘Matches JSX elements' start and end tags.
▽
(<Flex.Item>Hi</Flex.Item>)
└───────┘ └───────┘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:
| 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+Pand then typingSmart 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