Sticky Selection

Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
Nov 18, 2017
699
You can mark a selection to be permanently highlighted, even when your caret moves away. Inspired by "Style token" of Notepad++.
You can define an arbitrary number of Paint Groups. Selecting the appropriate editor action (keystroke or context menu), the all occurrences of currently selected text will be added to the Paint Group and will be permanently highlighted (until you clear the selection with an other editor action). So you can have different text fragments to be selected with the same Paint Group. The Paint Groups are kept when IntelliJ is closed.
  • You can set different colours for each Paint Group
  • You can set a marker to be visible on the right side of the editor
  • You can add multiple selections to the same group
  • You can convert a Paint Group to multi caret selection (and thus edit, copy, delete, etc. it)
  • For convenience you can undo the last addition (until the document is edited)
  • You can cycle through each element in a given Paint Group or in all Paint Groups
  • Keymap actions are added dynamically for paint, clear and convert as you add more Paint Group

Undo works up until the document is changed, or the editor is closed. Navigating in a specific Paint Group works like this:
  • If the caret is inside a Paint Group upcoming navigation will move caret among the Paints in that Paint Group.
  • If the caret is not inside a Paint Group the plugin will find the closest selection (in the direction the navigation happens), and will select that Paint Group for upcoming navigation
  • In the setting you can select if you wish the navigation to continue from the beginning of the document when you have reached the end of the document (or from the end if you have reached the beginning, when navigating to the other direction)
  • If caret is moved, decision starts from the beginning.

Default shortcuts (but I highly encourage to define your own or at least check with your current shortcuts)>
  • Press Ctrl + Alt + F9 to paint a selection (showing popup for selecting Paint Group). If nothing is selected, then the plugin tries to select automatically the word or block under the caret.
  • Press Ctrl + Alt + F10 than F9 to clear a selection (showing popup for selecting Paint Group).
  • Press Ctrl + Alt + F10 than F10 to clear all selections.
  • Press Ctrl + Alt + F8 to undo last selection.
  • Press Ctrl + Alt + quote to navigate to next Paint in the current Paint Group.
  • Press Ctrl + Alt + semicolon to navigate to previous Paint in the current Paint Group.

Note: control + alt on Mac is (I guess) meta + alt

If you find this plugin useful, please consider inviting me for a beer. I develop this plugin in my free time and I'm more motivated when I have a beer on desk :-)
http://PayPal.Me/mnwDevelopment/

Download plugin

Recent change notes

v2.4 fixed: exception when changing color, fixed: lingering highlights when changing color
v2.3 fixed: caret can jump to deleted highlight, fixed: preferences page does not respond to Paint Group changes, fixed: exception after "paint, convert, paint, undo"
v2.2 fixed: exception during first start, fixed: incorrectly restored Paint after reopening the IDE (when the document has changed)
v2.1 persisting selections when IDE gets closed
v2.0 redesign and lots of new features (navigation, convert, arbitrary number of groups, visual hints, undo)
v1.2
v1.0 this is the first release

General usage instructions

You can mark a selection to be permanently highlighted, even when your caret moves away. Inspired by "Style token" of Notepad++.

You can define an arbitrary number of Paint Groups. Selecting the appropriate editor action (keystroke or context menu), the all occurrences of currently selected text will be added to the Paint Group and will be permanently highlighted (until you clear the selection with an other editor action). So you can have different text fragments to be selected with the same Paint Group.



  • You can set different colours for each Paint Group

  • You can set a marker to be visible on the right side of the editor

  • You can add multiple selections to the same group

  • You can convert a Paint Group to multi caret selection (and thus edit, copy, delete, etc. it)

  • For convenience you can undo the last addition (until the document is edited)

  • You can cycle through each element in a given Paint Group or in all Paint Groups

  • Keymap actions are added dynamically for paint, clear and convert as you add more Paint Group



Undo works up until the document is changed. Navigating in a specific Paint Group works like this:

  • If the caret is inside a Paint Group upcoming navigation will move caret among the Paints in that Paint Group.

  • If the caret is not inside a Paint Group the plugin will find the closest selection (in the direction the navigation happens), and will select that Paint Group for upcoming navigation

  • In the setting you can select if you wish the navigation to continue from the beginning of the document when you have reached the end of the document (or from the end if you have reached the beginning, when navigating to the other direction)

  • If caret is moved, decision starts from the beginning.



Default shortcuts (but I highly encourage to define your own or at least check with your current shortcuts)>

  • Press Ctrl + Alt + F9 to paint a selection (showing popup for selecting Paint Group). If nothing is selected, then the plugin tries to select automatically the word or block under the caret.

  • Press Ctrl + Alt + F10 than F9 to clear a selection (showing popup for selecting Paint Group).

  • Press Ctrl + Alt + F10 than F10 to clear all selections.

  • Press Ctrl + Alt + F8 to undo last selection.

  • Press Ctrl + Alt + quote to navigate to next Paint in the current Paint Group.

  • Press Ctrl + Alt + semicolon to navigate to previous Paint in the current Paint Group.



Note: control + alt on Mac is (I guess) meta + alt

If you find this plugin useful, please consider inviting me for a beer. I develop this plugin in my free time and I'm more motivated when I have a beer on desk :-)


https://PayPal.Me/mnwDevelopment/