A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.jetbrains.com/help/idea/working-with-source-code.html below:

Write and edit source code

Write and edit source code

When you work with code, IntelliJ IDEA ensures that your work is stress-free. It offers various shortcuts and features to help you add, select, copy, move, edit, fold, find occurrences, and save code.

For navigation inside the editor, refer to Editor basics.

If you do not remember a shortcut for the action you want to use, press Ctrl+Shift+A to find any action by name.

You can use the same dialog to find classes, files, or symbols. For more information, refer to Search everywhere.

Transpose characters
  1. In the editor, place the caret at the characters you want to swap.

  2. Go to .

    There is no default shortcut for this action. You can assign a custom shortcut.

The floating toolbar contains various actions for code editing. It appears when you select a code fragment in Java, Kotlin, JSON, XML, YAML, and SQL files in the editor.

Enable the toolbar
  1. Press Ctrl+Alt+S to open settings and then select .

  2. In the Editor section, disable the Hide floating toolbar for code selection option.

  3. Apply the changes and close the dialog.

Customize the toolbar
  1. Press Ctrl+Alt+S to open settings and then select .

    Alternatively, click on the toolbar and select Customize Toolbar.

  2. Add or remove actions under Floating Code Toolbar.

    For more information, refer to Menus and toolbars.

  3. Apply the changes and close the dialog.

Lines of code

IntelliJ IDEA offers several useful shortcuts for manipulating code lines.

If you need to undo or redo your changes, press Ctrl+Z/Ctrl+Shift+Z respectively.

Copy and paste code

You can use the standard shortcuts to copy Ctrl+C and paste Ctrl+V any selected code fragment. If nothing is selected, IntelliJ IDEA automatically copies as is the whole line where the caret is located.

By default, when you paste anything in the editor, IntelliJ IDEA performs "smart" paste, for example, pasting multiple lines in comments will automatically add the appropriate markers to the lines you are pasting. If you need to paste just plain text, press Ctrl+Alt+Shift+V.

Code selection Select code constructs Select code according to capitalization
  1. In the Settings dialog (Ctrl+Alt+S) , go to .

  2. Select the Use "CamelHumps" words checkbox.

If you want to select words with a double click according to capitalization, make sure that the Honor "CamelHumps" words settings when selecting on double click checkbox right below is also selected.

Code statements Move statements

If moving of the statement is not allowed in the current context, the actions will be disabled.

Complete current statement Unwrap or remove statement
  1. Place the caret at the expression you want to remove or unwrap.

  2. Press Ctrl+Shift+Delete or select Code | Unwrap/Remove from the main menu.

    IntelliJ IDEA shows a popup with all actions available in the current context. To make it easier to distinguish between statements to be extracted and statements to be removed, IntelliJ IDEA uses different background colors.

  3. Select an action and press Enter.

Code fragments Code folding

IntelliJ IDEA automatically recognizes certain code structures and makes them foldable. You can also define custom folding regions.

Folded code fragments are shown as shaded ellipses (). If a folded code fragment has errors, IntelliJ IDEA highlights the fragment in red.

By default, folding icons in the gutter show up on hover. You can change this and configure other code folding settings in .

Go to in the main menu (Ctrl+Shift+A) and search for folding. IntelliJ IDEA will show a popup with all folding actions with their shortcuts:

Expand or collapse code elements

If code in a folded fragment is changed during reformatting or refactoring, IntelliJ IDEA automatically expands the folded fragment.

Fold or unfold nested fragments Custom folding regions

You can make any code fragment foldable by marking it as a custom folding region with dedicated comments. After that, you can expand and collapse the fragment with Ctrl+. or have it collapsed automatically on opening the file.

  1. In the editor, select a code fragment and press Ctrl+Alt+T.

  2. From the popup menu, select <editor-fold...> Comments or region...endregion Comments.

  3. Optionally, specify a description under which the collapsed fragment will be hidden.

  4. To collapse or expand the created region, press Ctrl+..

  5. To navigate to the created custom region, press Ctrl+Alt+..

Configure code folding icons

You can select how to display folding icons that appear in the gutter or disable them completely.

  1. Press Ctrl+Alt+S to open settings and then select .

  2. From the Show code folding arrows list, select Always or On mouse hover.

    Clear the checkbox to disable the icons.

21 July 2025


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4