IntelliJ IDEA 13.1 Web Help

IntelliJ IDEA provides a number of handy Clipboard operations. You can copy, cut, and paste selected text, a path to a file, or a reference to a symbol or a line of code.

Because IntelliJ IDEA uses the system Clipboard, you can copy and paste between applications. So doing, when pasting Clipboard entries, IntelliJ IDEA removes any formatting from the text and any special symbols from the String values.

The Paste command smartly understands what is being inserted. If you paste a reference to a symbol, it is analyzed for possible imports, references, etc. So doing, IntelliJ IDEA provides the necessary brackets and places the caret at the appropriate insertion point. The Paste Simple command helps paste any Clipboard entry as a plain text, without any analysis.

IntelliJ IDEA enables Clipboard stacking, which means that you can store multiple Clipboard entries and access them with a single shortcut. The number of entries that can be kept in the Clipboard stack is customizable on the Editor page of the IDE Settings.

To copy selected text, do one of the following
  • On the main menu, choose Edit | Copy.
  • Press Ctrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+Insert, Alt+C or Escape, WCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCtrl+C or Ctrl+InsertCommand C or Command InsertCommand C or Command InsertCommand C or Command Insert.
  • Click the Copy button copy on the toolbar.

Tip

The Ctrl+DCtrl+DCtrl+DCtrl+DMeta+DCtrl+DCtrl+DCtrl+D, Ctrl+Shift+Down or Ctrl+Shift+UpCtrl+DCommand DCommand DCommand D keyboard shortcut clones a line at the caret or a selected arbitrary fragment of text.

To copy path to a file, do one of the following
  • Open the desired file in the editor, then choose Edit | Copy Path on the main menu or press Ctrl+Shift+CCtrl+Shift+CCtrl+Shift+CCtrl+Shift+CCtrl+Shift+CCtrl+Shift+CCtrl+Shift+CCtrl+Shift+CCtrl+Shift+CShift Command CShift Command CShift Command C.
  • Select the desired file in the Project tool window and choose Copy Path on the context menu of the selection.
10.5+
To copy reference to a line or symbol
  1. Open the desired file in the editor.
  2. Place the caret at a certain line of code.
  3. Do one of the following:
    • On the main menu, choose Edit | Copy Reference
    • On the context menu of the line at caret, choose Copy Reference
    • Press Ctrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CCtrl+Shift+Alt+CShift Alt Command CShift Alt Command CShift Alt Command C.

    IntelliJ IDEA creates a string in the format <fully qualified path>:line

    /MetersToInchesConverter.java:14
To cut the selected text
  1. Select the desired fragment in the editor.
  2. Do one of the following:
    • On the main menu, choose Edit | Cut.
    • Press Ctrl+X or Shift+DeleteCtrl+X or Shift+DeleteCtrl+X or Shift+DeleteCtrl+X or Shift+DeleteShift+Delete or Alt+XCtrl+X or Shift+DeleteCtrl+X or Shift+DeleteCtrl+X or Shift+DeleteCtrl+X or Shift+DeleteCommand X or Shift DeleteCommand X or Shift DeleteCommand X or Shift Delete.
    • Click the Cut button cut on the toolbar.
To paste the last entry from the clipboard
  1. Place the caret in the location where you want to paste content.
  2. Do one of the following:
    • On the main menu, choose Edit | Paste.
    • Press Ctrl+V or Shift+InsertCtrl+V or Shift+InsertCtrl+V or Shift+InsertCtrl+V or Shift+InsertAlt+P, Shift+Insert or Ctrl+YCtrl+V or Shift+InsertCtrl+V or Shift+InsertCtrl+V or Shift+InsertCtrl+V or Shift+InsertCommand V or Shift InsertCommand V or Shift InsertCommand V or Shift Insert.
    • Click the Paste button paste on the toolbar.

    Note

    If you perform paste in a Java file, the further behavior depends on the settings in the Auto Import page of the Editor options. If the Ask option has been selected, select the necessary imports from the list of missing imports. In all other cases, the last clipboard entry is pasted silently.

To paste the last entry from the clipboard as plain text, do one of the following
  • On the main menu, choose Edit | Paste Simple.
  • Press Ctrl+Shift+Alt+VCtrl+Shift+Alt+VCtrl+Shift+Alt+VCtrl+Shift+Alt+VCtrl+Shift+Alt+VCtrl+Shift+Alt+VCtrl+Shift+Alt+VCtrl+Shift+Alt+VCtrl+Shift+Alt+VShift Alt Command VShift Alt Command VShift Alt Command V.
To paste a specific entry from the clipboard
  1. On the main menu, choose Edit | Paste from History or press Ctrl+Shift+V or Ctrl+Shift+InsertCtrl+Shift+V or Ctrl+Shift+InsertCtrl+Shift+V or Ctrl+Shift+InsertCtrl+Shift+V or Ctrl+Shift+InsertAlt+YCtrl+Shift+InsertCtrl+Shift+V or Ctrl+Shift+InsertCtrl+Shift+V or Ctrl+Shift+InsertCtrl+Shift+V or Ctrl+Shift+InsertShift Command V or Shift Command InsertShift Command V or Shift Command InsertShift Command V or Shift Command Insert.
  2. In the Choose Content to Paste dialog box select the desired entry from the list of recent Clipboard entries, and click OK.

Note

The depth of the Clipboard stack is configured in the Limits section on the Editor page of the Settings dialog box. When the specified number is exceeded, the oldest entry is removed from the list.

See Also

Procedures:

Reference:

Web Resources: