Select multiple occurrences of a word or a text range While Alt+Click will add a new caret, double-clicking words or dragging the mouse over text ranges (keeping the same keys pressed) will add new carets with the corresponding selections. If you want to select words, set your caret at an occurrence of the desired word. Otherwise, select the desired range with the mouse or with keyboard shortcuts. ![]() Successively press Alt+J to find and select the next occurrence of case-sensitively matching word or text range. Press Ctrl+Alt+Shift+J to select all case-sensitively matching words or text ranges in the document. In case you're wondering how I am displaying keyboard shortcuts of the invoked commands on the screen on my gifs - it uses Presentation Assistant Plugin, which is very useful during presentations and webinars.To return the selection to the lastly skipped occurrence, press Shift+F3.įind and select multiple occurrences of a string To remove selection from the last selected occurrence, press Alt+Shift+J.Īfter the second or any consecutive selection was added with Alt+J, you can skip it and select the next occurrence with F3. Removing the last occurrence from your selection is the same shortcut with Shift added: When you have a part of text selected, you can add the next occurrence of this string to your selection. In some cases, you may want more fine-grained control instead of selecting ALL the occurrences. Shift + Ctrl + Alt + J on Linux or Windows.In case no text is selected, the closest word to the current cursor is selected. Select All occurrencesĪnother way of selecting multiple blocks of text with multiple cursors is Select All Occurrences command, which selects all the other occurrences in the current file of the already selected text. Then select the blocks by the mouse as usual. This selection can be achieved by holding: Also, when copying/cutting the selected blocks into the clipboard, you can later paste the results into a new place when still using multiple cursors and each copied block will be pasted to the corresponding cursor. You can replace multiple blocks of text of various lengths by new ones. ![]() Pressing Esc will exit multiple cursors mode and will leave you with your first original single cursor.Īs of IntelliJ IDEA 14.1, you can not only insert multiple carets, but you can also select multiple parts of the text and then start typing. Unlike column selection, these cursors can be anywhere and don't need to be vertically aligned. When holding Alt + Shift (or ⌥ + ⇧ on Mac), clicking on a location creates a new cursor on that location in addition to all the already existing cursors. This is possible since IDEA version 13.1. In other situations, you need to stick to proper multiple cursor support. While the column selection mode is useful, it is limited to cases where places you need to edit are vertically aligned, which may not usually be the case. While still holding Ctrl, you can press ↑ and ↓ arrows to clone cursor to the line above or bellow. ![]() The commands are issued by pressing Ctrl (or ⌥ on Mac), then pressing it again and not releasing. The same functionality of creating new cursors as with Shift + arrows can be achieved by Clone caret above and Clone caret bellow commands. When in column selection mode and holding Shift, you can extend cursor to the line above/bellow by using ↑ or ↓ keys. ![]() You can exit column selection mode by using Esc key.Ĭolumn selection mode can be also used with keyboard only. This feature can be toggled using Edit → Column selection. Note that after I used End key (go to the end of the line), the cursor was properly placed at the end of each line even if the cursors were no longer vertically aligned. You can then move the cursor, as usual, using the arrow keys and even commands like Home or End. It allows you to select a block of text and then start typing with multiple cursors starting on each selected line at the beginning of the selected block. This feature is the oldest one, which was available even before the introduction of the proper multiple cursors support. IntelliJ IDEA supports having multiple cursors at once, meaning you can type and edit at multiple locations at the same time. Sometimes it is useful to edit multiple places in a file at once, which can save you precious time and increase your productivity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |