RubyMine 7.0.0 Web Help

The basic way to select a piece of text is to extend the selection with the mouse cursor. RubyMine, as a keyboard-centric IDE, suggests to use navigation keys to make selections. You can opt to select pieces of text by lines, or select rectangular fragments in the column mode, extend and shrink the selection, use multiselection, and sticky selection.

In this section:

To select the entire text in the current editor tab, do one of the following
  • On the main menu, choose Edit | Select All.
  • Press Ctrl+ACtrl+ACtrl+ACtrl+ACtrl+X, HCtrl+ACtrl+ACtrl+AMeta+ACommand ACommand ACommand ACommand A.
To select text with navigation keys, use one of the following shortcuts
  • Ctrl+Shift+LeftCtrl+Shift+LeftCtrl+Shift+LeftCtrl+Shift+LeftCtrl+Shift+LeftCtrl+Shift+LeftCtrl+Shift+LeftShift+Alt+Left or Ctrl+Shift+LeftShift+Alt+LeftShift Alt LeftShift Alt LeftShift Alt LeftShift Alt Left, Ctrl+Shift+RightCtrl+Shift+RightCtrl+Shift+RightCtrl+Shift+RightCtrl+Shift+RightCtrl+Shift+RightCtrl+Shift+RightShift+Alt+Right or Ctrl+Shift+RightShift+Alt+RightShift Alt RightShift Alt RightShift Alt RightShift Alt Right to select text from the caret position to the beginning/end of the current word.
  • Ctrl+Shift+Page UpCtrl+Shift+Page UpCtrl+Shift+Page UpCtrl+Shift+Page UpCtrl+Shift+Page UpCtrl+Shift+Page UpCtrl+Shift+Page UpCtrl+Shift+Page UpShift+Meta+Page UpShift Command Page UpShift Command Page UpShift Command Page UpShift Command Page Up, Ctrl+Shift+Page DownCtrl+Shift+Page DownCtrl+Shift+Page DownCtrl+Shift+Page DownCtrl+Shift+Page DownCtrl+Shift+Page DownCtrl+Shift+Page DownCtrl+Shift+Page DownShift+Meta+Page DownShift Command Page DownShift Command Page DownShift Command Page DownShift Command Page Down to select text from the caret position to the top/bottom of the screen.
To extend selection from the word at caret to the piece of code the caret is contained in, do one of the following
  • On the main menu, choose Edit | Extend Selection
  • Press Ctrl+WCtrl+WCtrl+WCtrl+WCtrl+Alt+WCtrl+WShift+Alt+PeriodShift+Alt+UpCtrl+W or Shift+Meta+BAlt UpCommand WControl Shift UpControl W to select the word where the caret is currently located.
  • Press Ctrl+WCtrl+WCtrl+WCtrl+WCtrl+Alt+WCtrl+WShift+Alt+PeriodShift+Alt+UpCtrl+W or Shift+Meta+BAlt UpCommand WControl Shift UpControl W successively to extend selection to the next containing node (for example, an expression, a paired tag, an entire conditional block, a method body, a class, a group of vararg arguments, etc.)

    While extending selection, keep in mind that:

    • Pressing Ctrl+WCtrl+WCtrl+WCtrl+WCtrl+Alt+WCtrl+WShift+Alt+PeriodShift+Alt+UpCtrl+W or Shift+Meta+BAlt UpCommand WControl Shift UpControl W successively in plain text or comments extends the selection first to the current sentence, then to the current paragraph.
To shrink selection in the reverse order (from the outermost container to the word where the caret currently resides), do one of the following
  • On the main menu, choose Edit | Shrink Selection
  • Press Ctrl+Shift+WCtrl+Shift+WCtrl+Shift+WCtrl+Shift+WCtrl+Shift+WCtrl+Shift+WShift+Alt+CommaShift+Alt+DownCtrl+Shift+WAlt DownShift Command WControl Shift DownControl Shift W.

    Tip

    The selection extends or shrinks according to capitalization, if the Use "CamelHumps" words check box is selected on the Smart Keys page of the editor settings.

    If you want to make selection according to capitalization, using double-click, make sure that the check box Honor CamelHumps words... is selected on the General page of the editor settings.

To select multiple words
  • Press Alt and double-click the left mouse button.

    multiselection1

To toggle between the line and the column selection modes, do one of the following
  • On the main menu, choose Edit | Column Selection Mode.
  • On the context menu of the editor, choose Column Selection Mode.
  • Press Shift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Meta+8 or Shift+Meta+NumPad *Shift Command 8Shift Command NumPad *Shift Command 8Shift Command 8 or Shift Command NumPad *.
1.1+
To make selection in the column selection mode, do one of the following:
  • Keeping the Alt key pressed, drag your mouse pointer to select the desired area.
  • Keeping the middle mouse button pressed, drag your mouse pointer to select the desired area.
  • Press Alt and the middle mouse button. This is specially helpful, if you want to avoid dragging.
To use smart expression selection

When you perform various code refactorings that involve selecting an expression , RubyMine can help you select the expression of interest. This feature is known as smart expression selection.

The procedure for the Introduce Variable refactoring is just an example. The smart expression selection feature, in fact, is available in all the refactorings that start with selecting an expression.

  1. Place the cursor before or within the expression.

    introduceVariableRubySmartSelectExpressionStart.png

  2. Choose Refactor | Extract Variable from the main or the context menu, or pressCtrl+Alt+VCtrl+Alt+VShift+Alt+VCtrl+Alt+VCtrl+Alt+VCtrl+Alt+VShift+Alt+VShift+Alt+L or Ctrl+Alt+VAlt+Meta+VAlt Command VAlt Command VAlt Command LAlt Command V.
  3. In the Expressions pop-up menu, select the expression. To do that, click the required expression. Alternatively, use the Up and Down arrow keys to navigate to the expression of interest, and then press EnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnterEnter to select it.

    introduceVariableRubySmartSelectExpression.png

4.0+
To toggle sticky selection, do one of the following
  • Press Ctrl+Shift+ACtrl+Shift+ACtrl+Shift+ACtrl+Shift+ACtrl+Shift+ACtrl+Shift+ACtrl+ICtrl+Shift+AShift+Meta+AShift Command AShift Command ACommand 3Shift Command A, in the pop-up frame type sticky, and choose Toggle Sticky Selection from the suggestion list:

    sticky_selection

  • In the Emacs keymap, use keyboard shortcut Ctrl+SpaceCtrl+SpaceCtrl+SpaceCtrl+SpaceAlt+SlashCtrl+SpaceCtrl+Space or Ctrl+Back SlashCtrl+SpaceCtrl+SpaceControl SpaceControl SpaceControl SpaceControl Space, Alt Escape or Shift Space.

Tip

When sticky selection is on, you can turn it off by invoking copy or cut, or by toggling it again.

Tip

To create a large rectangular selection, create a normal selection first, with the given starting and ending points, and then press Shift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Alt+InsertShift+Meta+8 or Shift+Meta+NumPad *Shift Command 8Shift Command NumPad *Shift Command 8Shift Command 8 or Shift Command NumPad * to toggle to the column selection mode.

See Also

Procedures:

Reference:

Web Resources: