Giter Site home page Giter Site logo

nathanpotolsky / highlight-selected Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pulsar-edit-highlights/selected

5.0 6.0 5.0 1009 KB

Highlights the current word selected when double clicking

License: MIT License

CSS 1.66% JavaScript 98.34%

highlight-selected's Introduction

Highlight Selected

Version Github Actions 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

highlight-selected's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.