For XML or HTML, use these actions for tag attributes. To move (swap) a code element to the left or to the right, place the caret at it, or select it and press Control+Alt+Shift+ArrowLeft for left or Control+Alt+Shift+ArrowRight for right.įor example, for Java you can use these actions for method invocation or method declaration arguments, enum constants, array initializer expressions. To move a line up or down, press Alt+Shift+ArrowUp or Alt+Shift+ArrowDown respectively. Press Control+/ again on the same line to uncomment it. To comment a line of code, place the caret at the appropriate line and press Control+/. Press Alt+Enter or click to select this intention. You can also use the Break string on '\n' intention to split string literals. IntelliJ IDEA splits the string and provides the correct syntax. ![]() To split string literals into two parts, press Enter. Note that IntelliJ IDEA checks the code style settings and eliminates unwanted spaces and redundant characters. You can also join string literals, a field or variable declaration, and a statement. Keep pressing the keys until all the needed elements are joined. To join lines, place the caret at the line to which you want to join the other lines and press Control+Shift+J. To adjust your keymap after the installation, refer to Choose the right keymap. Note that when you install IntelliJ IDEA with Windows default keymap for the first time, a dialog appears offering you to map this shortcut to either the Redo or Delete Line action. To delete a line, place the caret at the line you need and press Control+Y. If you need to assign shortcuts to those actions, refer to Configure keyboard shortcuts for more information. These actions might be helpful when you work with property files, data sets, text files, log files, and so on. To sort lines alphabetically in the whole file or in a code selection, go to Edit | Sort Lines or Edit | Reverse Lines. IntelliJ IDEA moves the caret to the previous line. To add a line before the current one, press Control+Alt+Enter. IntelliJ IDEA moves the caret to the next line. To add a line after the current one, press Shift+Enter. If you need to undo or redo your changes, press Control+Z/ Control+Shift+Z respectively. IntelliJ IDEA offers several useful shortcuts for manipulating code lines. You can also disable the toolbar using the toolbar options: click on the toolbar and select Don't Show Toolbar. In the Editor section, enable the Hide floating toolbar for code selection option. Press Control+Alt+S to open the IDE settings and then select Advanced Settings. Press Control+Alt+S to open the IDE settings and then select Appearance & Behavior | Menus and Toolbars.Īlternatively, click on the toolbar and select Customize Toolbar.Īdd or remove actions under Floating Code Toolbar.įor more information, refer to Menus and toolbars. Surround: view available Surround actions : AI actions (only if AI Assistant is enabled)Įxtract: view available Extract refactorings ![]() When you select a code fragment in a Java or Kotlin file, IntelliJ IDEA shows a floating toolbar with various actions for code editing. ![]() There is no default shortcut for this action. In the editor, place the caret at the characters you want to swap. For more information, refer to Search Everywhere. You can use the same dialog to find classes, files, or symbols. If you do not remember a shortcut for the action you want to use, press Control+Shift+A to find any action by name. It offers various shortcuts and features to help you add, select, copy, move, edit, fold, find occurrences, and save code.įor navigation inside the editor, refer to Editor basics. When you work with code, IntelliJ IDEA ensures that your work is stress-free.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |