Multiple cursors

Multiple cursor support was introduced with version 5.93 of katepart.

Creating multiple cursors

  • To create them via mouse, use Alt + left mouse button. The modifier is configurable, see Configure multicursor modifier

  • To create via keyboard, press Ctrl+Alt+Up to create cursor above primary cursor and Ctrl+Alt+Down to create cursor below. These shortcuts are also configurable

  • To create cursors out of a selection, first select some text and then press Shift+Alt+I. This will create a cursor at the end of each line in selection.

  • Use Alt+J to find the next occurrence of the word under cursor and select it + create a cursor. If you want to skip the current word under cursor, press Alt+K and it will mark the currently selected word as skipped. When you press Alt+J again it will unselect the current word and move to the next word.

  • Use Ctrl+Alt+Shift+J to find all occurrences of the word under cursor and select them with a cursor at the end of each selection. You can use Alt+J to cycle through the selected words and use Alt+K to unselect any word as mentioned in the previous paragraph.

Working with multiple cursors

Once you have created a few cursors, you can perform most of the editing operations on them as you would on a single cursor. For example, typing a letter will type it for each cursor. Similarly you can perform text transforms e.g., capitalization for all the positions or selections.

Sometimes you will want to remove cursors. To do so, you can Alt + left mouse button on the cursor that you want to remove. If you just want to remove cursors on lines that are empty, there is a ready-made action for it that will do it for you. To invoke the action, open the Command Bar using Ctrl+Alt+I and look for Remove cursors from empty lines and hit Enter. You can also configure a shortcut for this action.