AppCode 2018.3 Help

Adding, Deleting and Moving Code Fragments

To add a line

  • Press ⇧⏎ to add a new line after the one where the caret is currently located and move the caret to the beginning of this new line.

    For instance, you have typed some text.

    AppCodeShiftEnter1

    Press ⇧⏎ to start the next line immediately.

    AppCodeShiftEnter2
  • To add a line before the current one, press ⌥⌘⏎.

To duplicate a line or fragment

  1. Place the caret at the line to be duplicated, or select the desired fragment of text.

  2. Press ⌘D.

To remove a line

  • Press ⌘⌫ to delete the line at caret.

To move a line

  1. Place the caret at the line to be moved.

  2. Do one of the following:
    • On the main menu, choose Code | Move Line Up/Down.

    • Press ⌥⇧↑ or ⌥⇧↓.

    AppCode moves the selected line one line up or down, performing the syntax check. For example:

    AppCodeMoveLIne1

    After moving line at caret:

    AppCodeMoveLIne2

To move a statement up or down

  1. Select a statement to be moved, or just place the caret at the first or last lines of a multi-line statement. Note that if moving a statement is not allowed in the current context, the commands will be disabled.

  2. Do one of the following:
    • On the main menu, choose Code | Move Statement Up/Move Statement Down.

    • Press ⇧⌘↑ or ⇧⌘↓.

    If you apply the same commands to a line at caret, or a to a selection, it will be moved one line up or down.

    AppCode moves the selected statement above the previous one, or directly underneath the next one, performing the syntax check. For example, place the caret at the method declaration:

    AppCodeMoveStatement1

    After moving the statement:

    Moving statement
Last modified: 28 March 2019

See Also