Code Monkey home page Code Monkey logo

vim-interestingwords's Introduction

vim-interestingwords

Word highlighting and navigation throughout out the buffer.

vim-interestingwords highlights the occurrences of the word under the cursor throughout the buffer. Different words can be highlighted at the same time. The plugin also enables one to navigate through the highlighted words in the buffer just like one would through the results of a search.

Screenshot

Installation

The recommended installation is through vim-plug:

Plug 'lfv89/vim-interestingwords'

Usage

  • Highlight with <Leader>k
  • Navigate highlighted words with n and N
  • Clear every word highlight with <Leader>K throughout the buffer

Highlighting Words

<Leader>k will act as a toggle, so you can use it to highlight and remove the highlight from a given word. Note that you can highlight different words at the same time.

Navigating Highlights

With a highlighted word under your cursor, you can navigate through the occurrences of this word with n and N, just as you would if you were using a traditional search.

Clearing (every) Highlight

Finally, if you don't want to toggle every single highlighted word and want to clear all of them, just hit <Leader>K

Configuration

The plugin comes with those default mapping, but you can change it as you like:

let g:interestingWordsDefaultMappings = 0 if to disable default mapping

nnoremap <silent> <leader>k :call InterestingWords('n')<cr>
vnoremap <silent> <leader>k :call InterestingWords('v')<cr>
nnoremap <silent> <leader>K :call UncolorAllWords()<cr>

nnoremap <silent> n :call WordNavigation(1)<cr>
nnoremap <silent> N :call WordNavigation(0)<cr>

Thanks to @gelguy it is now possible to randomise and configure your own colors

To configure the colors for a GUI, add this to your .vimrc:

let g:interestingWordsGUIColors = ['#8CCBEA', '#A4E57E', '#FFDB72', '#FF7272', '#FFB3FF', '#9999FF']

And for a terminal:

let g:interestingWordsTermColors = ['154', '121', '211', '137', '214', '222']

Also, if you want to randomise the colors (applied to each new buffer), add this to your .vimrc:

let g:interestingWordsRandomiseColors = 1

Credits

The idea to build this plugin came from the @stevelosh video's where he shows some pretty cool configurations from his .vimrc. He named this configuration interesting words, and I choose to keep the name for this plugin. The video is on youtube: https://www.youtube.com/watch?v=xZuy4gBghho

vim-interestingwords's People

Contributors

adolenc avatar dissonant-tech avatar gelguy avatar m42e avatar myii avatar nedbat avatar shane-xb-qian avatar wikimatze avatar

Watchers

 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.