For example, I want to move the cursor to before x but after the space before x(like the default behavior of JetBrains IDEs). When I use Ctrl+a in macOS, it move to the left of first space.
fn main() {
// TODO: Add the missing keyword.
x = 5;
println!("x has the value {x}");
}
2
Answers
As I guess, VS Code does not support that functionality directly. But we can config that feature in
keybindings.json
.Then, you may opend the
keybindings.json
file locates on/Code/User/keybindings.json
onmacOS
, and add custom scriptto the end of the file.
According to this you can press
CMD + L
to move the cursor to the first non-whitespace character of a line. And, also you can customize the script withcursorMove
command usingargs
. You can browseargs
here VS Code keybindings docs.