PyCharm Edu 2017.3 Help

Joining Lines and Literals

Basics

PyCharm Edu makes it possible to concatenate two unselected or several selected lines into one, removing the extra spaces, and providing the proper syntax. This operation smartly analyzes the lines being joined and treats them accordingly. For example, you can join lines of code, lines of comments, field declaration and initialization.

Joining lines

  1. Place the caret on the line, to which the other lines should be added.
    py ctrlShiftJ1
  2. Sequentially press Ctrl+Shift+J keyboard shortcut, until all fragments are joined in a single line.
    py ctrlShiftJ2
    py ctrlShiftJ3

Joining string literals

  1. Select the lines with string literals that should be joined.
  2. Press Ctrl+Shift+J keyboard shortcut. All redundant characters (spaces, quotes, and plus signs) are gone.

Examples

Joining a list of parameters:

py ctrlShiftJ8

Joining commented lines:

py ctrlShiftJ9
Last modified: 14 December 2017

See Also