JavaRush /Java Blog /Random EN /IntelliJ IDEA User Guide. Basics of using the code editor...
theGrass
Level 24
Саратов

IntelliJ IDEA User Guide. Basics of using the code editor.

Published in the Random EN group
Code Editor Basics
При разработке в IntelliJ IDEA большую часть времени вы проводите в редакторе codeа. Поэтому стоит знать его основные возможности.
  1. Default Settings The editor by default highlights paired brackets, scope, vertical indentation marks, and places where the element under the cursor is used. You can reconfigure all this and much more in Settings → Editor and Settings → Editor → Appearance. IntelliJ IDEA User Guide.  Basics of using the code editor.  - 1 Two other settings worth mentioning here:
    • Allow placing the cursor after the end of the line, enabled by default. If this annoys you, you can turn it off in the settings.
    • Show line numbers, disabled by default.
    • Saving Changes One of the best features of the editor that newbies take a while to get used to is how it saves changes. IntelliJ IDEA does this automatically, meaning you don't have to worry about missing something. If you need to undo changes you've made, you can always do so using your local change history .
      • Status Bar Indicators In the Status Bar you can find useful information about the currently open file, such as line ending type ( Windows/Unix ) ( \r\n or \n ), encoding, current version control branch, and whether the file is open read-only.
        • Method separators Another useful setting (disabled by default) is to display method separators. IntelliJ IDEA User Guide.  Basics of using the code editor.  - 2
          • Structural highlighting You definitely need to know about this feature, because it greatly increases productivity. Structural highlighting allows you to highlight expressions based on syntax. By pressing Ctrl + W (Cmd + W on Mac), you expand the selection (starting at the cursor) to the boundaries of the next structural unit of the expression. Conversely, you can shorten the selection by pressing Shift + Ctrl + W (Shift + Cmd + W on Mac). IntelliJ IDEA User Guide.  Basics of using the code editor.  - 3
            • Selecting by Columns You can select text by columns using the mouse if you hold down Alt . You can also make this mode the default mode in the settings, Edit → Column Selection Mode . IntelliJ IDEA User Guide.  Basics of using the code editor.  - 4
              • Collapse Another useful feature of the code editor is collapsing. You can collapse or expand parts of the code by pressing Ctrl + . ( Cmd + . on Mac). IntelliJ IDEA User Guide.  Basics of using the code editor.  - 5
                • Other useful features
                  • Move the current line of code (or selected block) using Shift + Ctrl + arrows (Shift + Cmd + arrows on Mac) .
                  • Duplicate the current line of code (or selected block) using Ctrl + D (Cmd + D on Mac) .
                  • Delete a line of code (or selected block) using Ctrl + Y (Cmd + Y on Mac) .
                  • Закомментировать or раскомментировать строку codeа (or выделенный блок) с помощью Ctrl + / (Cmd + / на Mac) и Shift + Ctrl + / (не построчный комментарий, а блоком для выделенного codeа).
                  • Оптимизировать директивы импорта с помощью Ctrl + O (Cmd + O на Mac).
                  • Поиск в открытом в текущей вкладке файле с помощью Alt + F3 (по F3 переход к следующему совпадению, по Shift + F3 - к предыдущему совпадению). Или, замена в открытом в текущей вкладке файле с помощью Ctrl + R (Cmd + R на Mac).
                  • Включить/отобразить мягкие переносы строк, отключенные по умолчанию.
                  • Вставка из стэка с помощью Shift + Ctrl + V (Shift + Cmd + V на Mac).
                  • Перемещаться по открытым вкладкам с помощью Alt + стрелки (ctrl + стрелки на Mac).
                Оригинал статьи
                Comments
                TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
                GO TO FULL VERSION