问题
Is there a shortcut key for editing multiple lines in RubyMine (Windows) as you can do with TextMate? I've seen it in TextMate where you can highlight multiple lines, and press a key code, then start typing. All text you type will appear at the end of all of the highlighted lines. I would love to do this with RubyMine as well.
Thanks!
回答1:
Yes, this feature is called Column Mode and can be enabled via Edit menu or keyboard shortcut.
回答2:
RubyMine version 6.3 and later has real multiple line editing. Simultaneously edited areas of text need not be vertically adjacent and vertically aligned (as they must be to use Column Selection Mode).
Briefly,
- option-click (on Mac; alt-click on Windows or Linux) to create additional carets, edit as usual, then hit escape to revert to a single caret
- select some text and control-G (on Mac; alt-J on Linux and Windows) to search for the next occurrence of that text and add a caret to it
- There are also editor commands to add carets (Clone Caret Below, Clone Caret Above) that are not bound by default, but that you can bind to keys of your choice.
More here: What’s Mining: Multiple Cursors and Selection
(Column Selection Mode still works fine for areas of text that are vertically adjacent and aligned.)
来源:https://stackoverflow.com/questions/6047085/does-rubymine-have-textmate-style-multiple-line-editing