How do you insert a vertical column of text and indent it in Sublime Text 2 using the vim key bindings?
(source: yannesposito.com)
I have seen the Sublime Text 2 Column Selection Docs, showing how you can use Ctrl + Shift + Up, but is it possible to do the same thing using the vim shortcut?
I am using Sublime in Vintage Mode.
It's a bit fiddly and an extra keystroke, but it is possible: you just have to split the selection into multiple cursors before you do the standard VIM Shift+I
So the whole routine (on a Mac) is:
Select block with V/v + motion keys
CommandShift + L
V/v to exit visual mode
Multiple cursors that you can move, insert, whatever!
Alternatively, you can do what I did and adopt a hybrid approach by changing Sublime's Shift + Control + arrow keybindings to be Shift + Control + motion keys instead.
[
{ "keys": ["ctrl+shift+j"], "command": "select_lines", "args": {"forward": true} },
{ "keys": ["ctrl+shift+k"], "command": "select_lines", "args": {"forward": false} }
]
Shift + Control + K conflicts with OS X's built-in "kill all lines" binding, but ST bindings override those, and you shouldn't be using that one anyway... it's from Emacs ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With