如何使用 vim 键绑定在 Sublime Text 2 中插入垂直文本列? [英] How do you insert a vertical column of text in Sublime Text 2 using the vim key bindings?
问题描述
如何使用 vim 键绑定在 Sublime Text 2 中插入垂直文本列并缩进?
(来源:yannesposito.com)
我看过 Sublime Text 2 Column Selection Docs,展示了您如何可以使用 Ctrl + Shift + Up,但是否可以使用 vim 快捷方式做同样的事情?
我正在使用 复古模式下的 Sublime.
这有点繁琐,而且需要额外的击键,但这是可能的:在执行标准 VIM 之前,您只需要将所选内容拆分为多个光标 Shift+I
所以整个例程(在 Mac 上)是:
使用 V/v + 运动键选择块
CommandShift + L
V/v 退出可视化模式
多个光标,您可以移动、插入等等!
<小时>
或者,你可以做我所做的,并通过将 Sublime 的 Shift + Control + 箭头键绑定更改为 Shift + Control + 运动键.
<预><代码>[{ "keys": ["ctrl+shift+j"], "command": "select_lines", "args": {"forward": true} },{ "keys": ["ctrl+shift+k"], "command": "select_lines", "args": {"forward": false} }]Shift + Control + K 与 OS X 的内置kill all lines"绑定冲突,但 ST 绑定会覆盖这些,并且无论如何你不应该使用那个......它来自Emacs ;)
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 ;)
这篇关于如何使用 vim 键绑定在 Sublime Text 2 中插入垂直文本列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!