highlight-selected

Highlights the current word selected when double clicking

richrace

2,774,951

3,277

Bug Reports

0.17.0

MIT

GitHub

This package provides the following services:

This package consumes the following services:

Highlight Selected

Version Travis CI Gitter Downloads Licence David

Highlight occurrences of a selection within the open editor.

Can be triggered by either double clicking a word, or selecting a word/text with your cursor.

Gif in action

Commands

Command Name Command Code Keymap Description
Toggle highlight-selected:toggle ctrl+cmd+h Enables/Disabled this package
Select all markers highlight-selected:select-all Select all markers

To set a Keymap for select all open your Keymap file and add:

'atom-text-editor:not([mini])':
  'cmd-*': 'highlight-selected:select-all'

Settings

Setting Default Description
Only Highlight Whole Words true This uses the "Allowed Characters To Select" option with Atom's "Non-word characters" to find word boundaries.
Hide Highlight On Selected Word false When enabled to will not add a box around the selected words.
Ignore Case false Case sensitivity
Light Theme false Different CSS classes get applied (see styling). Should makes it easier to switch between Atom's themes
Highlight Background false Adds a background colours via CSS class (see styling)
Minimum Length 2 How many characters to select before searching for occurrences
Timeout 20 Defers searching for matching strings for X ms
Highlight In Panes true Highlight selection in another panes
Show In Status Bar true Show how many matches there are
Status Bar String 'Highlighted: %c The text to show in the status bar. %c = number of occurrences
Allowed Characters To Select '$@%-' Non Word Characters that are allowed to be selected. This is useful for languages like PHP where variables like $test need to be highlighted
Show Results On Scroll Bar false Show highlight on the scroll bar. Requires Scroll Marker Package (if you enable this setting you will be prompted to install the package)

Styling

If you want to change any of the styling of the region use the following as a guide:

atom-text-editor .highlights {
  // Box
  .highlight-selected .region {
    border-color: #ddd;
    border-radius: 3px;
    border-width: 1px;
    border-style: solid;
  }
  // Background (set in settings)
  .highlight-selected.background .region {
    background-color: rgba(155, 149, 0, 0.6);
  }
  // Light theme box (set in settings)
  .highlight-selected.light-theme .region {
    border-color: rgba(255, 128, 64, 0.4);
  }
  // Light theme background (set in settings)
  .highlight-selected.light-theme.background .region {
    background-color: rgba(255, 128, 64, 0.2);
  }
  }

// If you have the Scroll Marker package installed https://atom.io/packages/scroll-marker
// These are the colours that will be shown in the scroller
.highlight-selected-marker-layer.scroll-marker-layer {
  .scroll-marker {
    background-color: #ffff00
  }
}

.highlight-selected-selected-marker-layer.scroll-marker-layer {
  .scroll-marker {
    background-color: #f71010
  }
}

Contributing

Please look at the Contributing Guide

Donate

If you want to say thanks by buying me a coffee/beer, that would be awesome! You can do so via Monzo