Skip to content

ghancoder/vim-highlight-hero

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-highlight-hero

The highlight-hero highlights multiple words and visual selections. On the fly and statically. It is particularly useful for

  • spotting typos
  • finding variable usages
  • resolving merge conflicts (see :help highlight-hero-merge-conflicts)

Quick start >> :HHauto or :HH, :1HH!, ...

Highlight-Hero Screenshot

Installation

Pathogen
  1. In the terminal,
    git clone https://github.com/borisbrodski/vim-highlight-hero ~/.vim/bundle/vim-highlight-hero
  2. In vimrc,
    call pathogen#infect()
    syntax on
    filetype plugin indent on
  3. Restart Vim, and run :helptags ~/.vim/bundle/vim-highlight-hero/doc/ or :Helptags.
Vundle
  1. Add the following text to your vimrc.
    call vundle#begin()
      Plugin 'borisbrodski/vim-highlight-hero'
    call vundle#end()
  2. Restart Vim, and run the :PluginInstall statement to install your plugins.
Vim-Plug
  1. Add the following text to your vimrc.
call plug#begin()
  Plug 'borisbrodski/vim-highlight-hero'
call plug#end()
  1. Restart Vim, and run the :PlugInstall statement to install your plugins.
Dein
  1. Add the following text to your vimrc.
    call dein#begin()
      call dein#add('borisbrodski/vim-highlight-hero')
    call dein#end()
  2. Restart Vim, and run the :call dein#install() statement to install your plugins.
Vim 8+ packages

From Vim 8+ you can use its own built-in package management. See :help packages for details.

Execute the following in your console:

git clone https://github.com/borisbrodski/vim-highlight-hero ~/.vim/pack/vendor/start/vim-highlight-hero
vim -u NONE -c "helptags ~/.vim/pack/vendor/start/vim-highlight-hero/doc" -c q

Getting started

" Turn on auto-highlighing! (Navigate around to see the impact)
:HHauto
" Highlight current word with color 0
:HH
" Highlight another word with color 1
:1HH
" Highlight "String args" color 2
:2HH String args
" Turn all highlights OFF
:HHoff!

Documentation

" Open comprehensive docs
:help highlight-hero 

Frequently Asked Questions

Why are the default colors so weird?

Well, getting decent foreground and background colors is the most challenging part. The foreground and the background colors should work well for

  • different color schemes
  • different terminals & UIs
  • for color-blind people

Please, help me with it and contribute your colors!

  1. Call :HHprint to see all the colors
  2. Go to the bottom of plugin/highlighter.vim
  3. Enter your color values for both dark and light modes
  4. Create a push request.

Defining colors in the plugin/highlighter.vim:

call s:add_highlight('highlight HighlightHeroCurrent <<<DARK>>>',
                   \ 'highlight HighlightHeroCurrent <<<LIGHT>>>')

TODO: Support different color configurations and providing simple commands to change individual colors.

License

Copyright (c) Boris Brodski. Distributed under the same terms as Vim itself. See :help license.

About

Vim advanced text highlighting plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%