Sublime Text 2 Windows中的多个游标

Stu*_*rtM 82 sublimetext sublimetext2

我在Windows中安装了Sublime Text 2,我正在尝试使用多个游标功能.

首先,我强调我正在寻找的选择(三行).

然后我可以按CTRL+ D选择每次重复,或ALT+ F3选择全部.我的情况有四次重复.

我现在想要在三行中间移动游标并添加一些信息,以便添加到所有实例中.

一旦我点击选择,多项选择就消失了?有什么我做错了,我确定这是错的,但由于文档太弱我无法弄清楚如何?

Zen*_*xer 151

完全跳过鼠标通常会更容易 - 或者如果Sublime在自动换行时没有弄乱多选,那就更好了.这是关于使用键盘鼠标进行多项选择的官方文档.由于它有点分散,我将总结一下:

Sublime Text 3中的快捷方式不同,我做了一个注释.对于v3,我总是使用最新的dev版本进行测试; 如果您使用的是beta版本,那么您的体验可能会有所不同.

如果在切换选项卡或窗口时丢失了选择(特别是在Linux上),请尝试使用Ctrl+ U来恢复它.

老鼠

在Windows/Linux的

建筑模块:

  • 正负:
    • 加入选择: Ctrl
    • 从选择中减去:Alt 在v3的早期版本中,这不适用于线性选择.
  • 选择类型:
    • 线性选择: Left Click
    • 块选择:Middle ClickShift+ Right Click 在Linux上,默认情况下,中间点击粘贴.

结合您认为合适.例如:

  • 添加到选择:Ctrl+ Left Click(并可选择拖动)
  • 从选择中减去:Alt+ Left Click 这在v3的早期版本中不起作用.
  • 添加块选择:Ctrl+ Shift+ Right Click(并拖动)
  • Subtract block selection: Alt + Shift + Right Click (and drag)

Mac OS X

Building blocks:

  • Positive/negative:
    • Add to selection:
    • Subtract from selection: ⇧⌘ (only works with block selection in v3; presumably bug)
  • Selection type:
    • Linear selection: Left Click
    • Block selection: Middle Click or + Left Click

Combine as you see fit. For example:

  • Add to selection: + Left Click (and optionally drag)
  • Subtract from selection: ⇧⌘ + Left Click (and drag--this combination doesn't work in Sublime Text 3, but supposedly it works in 2)
  • Add block selection: ⌥⌘ + Left Click (and drag)
  • Subtract block selection: ⌥⇧⌘ + Left Click (and drag)

Keyboard

Windows

  • Return to single selection mode: Esc
  • 在所有插入符号上向上/向下扩展选择:Ctrl+ Alt+ Up/Down
  • 在所有插入符号处向左/向右扩展选择:Shift+ Left/Right
  • 向上/向下/向左/向右移动所有插入符号,并清除选择:Up/ Down/ Left/Right
  • 撤消上一个选择动作:Ctrl+U
  • 将下一个选定文本添加到选择中:Ctrl+D
  • 将所有出现的所选文本添加到选择中:Alt+F3
  • 在所选文本的出现之间旋转(单选):Ctrl+ F3(反向:Ctrl+ Shift+ F3)
  • 将单个线性选择转换为块选择,每行中所选文本末尾有一个插入符号:Ctrl+ Shift+L

Linux的

  • 返回单选模式: Esc
  • Extend selection upward/downward at all carets: Alt + Up/Down Note that you may be able to hold Ctrl as well to get the same shortcuts as Windows, but Linux tends to use Ctrl + Alt combinations for global shortcuts.
  • Extend selection leftward/rightward at all carets: Shift + Left/Right
  • Move all carets up/down/left/right, and clear selection: Up/Down/Left/Right
  • Undo the last selection motion: Ctrl + U
  • Add next occurrence of selected text to selection: Ctrl + D
  • Add all occurrences of the selected text to the selection: Alt + F3
  • Rotate between occurrences of selected text (single selection): Ctrl + F3 (reverse: Ctrl + Shift + F3)
  • 将单个线性选择转换为块选择,每行中所选文本末尾有一个插入符号:Ctrl+ Shift+L

Mac OS X.

  • 返回单选模式:( 这是Escape的Mac符号)
  • 在所有插入符号上向上/向下扩展选择:⌃⇧⇡,⌃⇧⇣(见注释)
  • 在所有插入符号处向左/向右扩展选择:⇧⇠/⇧⇢
  • 将所有插入符上/下/左/右和明确的选择:,,,
  • 撤消上次选择动作: ⌘U
  • 将下一个选定文本添加到选择中: ⌘D
  • 将所有选定文本添加到选择中: ⌃⌘G
  • 选择的文本(单选择)的出现之间转动:⌥⌘G(反向:⌥⇧⌘G)
  • Turn a single linear selection into a block selection, with a caret at the end of the selected text in each line: ⇧⌘L

Notes for Mac users

On Yosemite and El Capitan, ⌃⇧⇡ and ⌃⇧⇣ are system keyboard shortcuts by default. If you want them to work in Sublime Text, you will need to change them:

  1. Open System Preferences.
  2. Select the Shortcuts tab.
  3. Select Mission Control in the left listbox.
  4. Change the keyboard shortcuts for Mission Control and Application windows (or disable them). I use ⌃⌥⇡ and ⌃⌥⇣. They defaults are ⌃⇡ and ⌃⇣; adding to those shortcuts triggers the same actions, but slows the animations.

In case you're not familiar with Mac's keyboard symbols:

  • is the escape key
  • is the control key
  • is the option key
  • is the shift key
  • is the command key
  • et al are the arrow keys, as depicted

  • 我来到这里寻找问题,就像@Zenexer所说的那样,Sublime在自动换行时会混淆多选.我总是这样:选择一个用于手动缩进的块("Alt"单击 - 拖动) - 如果自动换行,则在缩进时会损坏行.这是一个已知的错误吗?`⇧⌘L`似乎表现更好. (3认同)

Jam*_*Jag 38

在Sublime Text中,选择多个文本区域后,单击被视为退出多选模式的一种方法.用键盘键(箭头,Ctrl +箭头等)移动光标,你会没事的

  • ctrl + shift + l - 也.谢谢 (10认同)

msw*_*erg 13

尝试使用Ctrl键单击您想要游标的多个位置.Ctrl-D用于多个增量查找.