Giter Site home page Giter Site logo

adolenc / vim-interestingwords Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lfv89/vim-interestingwords

0.0 2.0 0.0 29 KB

vim-interestingwords allows you to highlight and navigate through (multiple) different words in a buffer

Vim Script 100.00%

vim-interestingwords's Introduction

vim-interestingwords

Screenshot

What is it?

A plugin that highlights the occurrences of the word under your cursor. It can be used to highlight different words at the same time. It also lets you navigate through the highlighted words just like you would navigate through the results of a search.

Installation

Using vundle, add this to your .vimrc:

Plugin 'lfv89/vim-interestingwords'

Then run:

:PluginInstall

Usage

Highlight with <Leader>k

This key 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.

Navigate with n and N

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.

Clear with <Leader>K

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:

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

nnoremap <silent> n :call WordNavigation('forward')<cr>
nnoremap <silent> N :call WordNavigation('backward')<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

Author

twitter.com/lfv89

luisvasconcellos.com

Feel free to talk to me about anything related to this project.

vim-interestingwords's People

Contributors

adolenc avatar dissonant-tech avatar gelguy avatar m42e avatar nedbat avatar wikimatze avatar

Watchers

 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.