All Projects → bimlas → vim-high

bimlas / vim-high

Licence: MIT license
Vim plugin: All-in-one highlighter, highlight custom pattern like indentation, inactive window, word under the cursor

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-high

vim-strip-trailing-whitespace
🎞️ Vim plugin that removes trailing whitespace from *modified* lines on save
Stars: ✭ 66 (+230%)
Mutual labels:  vim-plugin, trailing-spaces
Traces.vim
Range, pattern and substitute preview for Vim
Stars: ✭ 568 (+2740%)
Mutual labels:  vim-plugin, highlight
DidYouMean
Vim plugin which asks for the right file to open
Stars: ✭ 82 (+310%)
Mutual labels:  vim-plugin
nim.nvim
Nim plugin for NeoVim
Stars: ✭ 159 (+695%)
Mutual labels:  highlight
vim-commentor
Toggling comments became easier!
Stars: ✭ 29 (+45%)
Mutual labels:  vim-plugin
Studyit-club
​💔 ​针对校社团开发的一套IT俱乐部官网 -> http://sunhang.gz01.bdysite.com/
Stars: ✭ 17 (-15%)
Mutual labels:  highlight
vim-terminal
A Vim plugin that opens an interactive terminal in a buffer for running programs
Stars: ✭ 45 (+125%)
Mutual labels:  vim-plugin
denops-gh.vim
Vim/Neovim plugin for GitHub
Stars: ✭ 27 (+35%)
Mutual labels:  vim-plugin
fzf-preview.vim
fzf ❤️ preview
Stars: ✭ 49 (+145%)
Mutual labels:  vim-plugin
fzf-hoogle.vim
(neo)vim plugin that uses fzf for previewing hoogle search results
Stars: ✭ 37 (+85%)
Mutual labels:  vim-plugin
Dot-It-Up
A collection of dotfile scripts, plugins, and clever hacks so that you can become the master of your own OS! 🚀
Stars: ✭ 254 (+1170%)
Mutual labels:  vim-plugin
swdc-vim
Track your programming activity in real-time in Vim
Stars: ✭ 19 (-5%)
Mutual labels:  vim-plugin
vim-gnote
make your mailbox as a note place
Stars: ✭ 16 (-20%)
Mutual labels:  vim-plugin
vim-lamp
💡Language Server Protocol client for Vim.
Stars: ✭ 34 (+70%)
Mutual labels:  vim-plugin
todo-vim
Simple todo plugin for vim
Stars: ✭ 24 (+20%)
Mutual labels:  vim-plugin
bolt.nvim
⚡ Ultrafast multi-pane file manager for Neovim with fuzzy matching
Stars: ✭ 100 (+400%)
Mutual labels:  vim-plugin
poet-v
Vim Meets Poetry and Pipenv Virtual Environments
Stars: ✭ 57 (+185%)
Mutual labels:  vim-plugin
vue-highlight-text
🔦 Vue component for highlight multiple instances of a word
Stars: ✭ 55 (+175%)
Mutual labels:  highlight
onestatus
an api to customize tmux from vim
Stars: ✭ 82 (+310%)
Mutual labels:  vim-plugin
SimpleSnippets.vim
Simple snippet support for your Vim and Neovim
Stars: ✭ 86 (+330%)
Mutual labels:  vim-plugin

Vim-High: all-in-one Vim highlighter plugin

A Vim plugin to highlight custom patterns on any buffer (filetype whitelist/blacklist supported), for example highlight indentation, inactive window, word under the cursor or even user made Vim highlighting.

Travis CI License

Note

It’s in beta version (API and defaults may change) while I don’t get enough response that everything works as expected.

Philosophy of the plugin
Vim-High in action, showing the example config

To try out, install in your preferred way, then enable a lighter by :HighEnable <C-D>.

To enable lighters by default, add the preferred ones to g:high_lighter as a dictionary in your .vimrc, like this:

let g:high_lighters = {
\ '_': {                                                                  (1)
\   'blacklist': ['help', 'qf', 'lf', 'vim-plug'],                        (2)
\ },
\ 'inactive_window': {},                                                  (3)
\ 'indent': {'_hlgroupA': 'HighIndentA', '_hlgroupB': 'HighIndentB'},     (4)
\ 'long_line': {'hlgroup': 'DiffAdd'},
\ 'unite_directory': {},
\ 'your_custom_lighter': {'pattern': 'TODO\|NOTE', 'hlgroup': 'ErrorMsg'} (5)
\ }
  1. The _ key means these settings will affect every lighter,

  2. for example all of them will be disabled in these filetypes.

  3. You can add predefined lighters, whose can be found in autoload/high/light/ directory.

  4. To override the global settings, pass the lighter-specific ones in the dictionary.

  5. You can create your own lighters as you want.

Override default settings

By default, every lighter in g:high_lighters are enabled at Vim startup, but passing 'enabled': 0 will disable it. To use the lighter, call :HighEnable lighter or :HighToggle lighter.

The available configuration parameters can be found in plugin/high.vim as g:high.defaults. Options starting with double underscore (__init_function for example) are private and you shouldn’t override those. See :help matchadd for pattern and priority; :highlight for possible values of hlgroup.

Some lighters have specific settings, starting with an underscore (_length of long_line for example) are lighter-specific, the underscore is used only to prevent conflicts with global settings, but you can safely override those.

Do not fear to view the source files to get the possibilities, because there is no help file for the plugin, source codes and test files contains everything.

Custom colors

To define your own hlgroup, take a look at :help highlight. Here are the highlight groups of the example config, place it to your .vimrc:

autocmd ColorScheme,VimEnter *
\ highlight! HighIndentA guibg=#002029 guifg=#063642 |
\ highlight! HighIndentB guibg=#003542 guifg=#063642

Dynamic update of highlighters

Some lighters are based on Vim settings, for example indent uses shiftwidth to highlight the indentation. The highlighting will follow the change of it only on certain events (jumping to another window, switching buffer, etc.). To apply the new settings automatically, you have to write an autocommand in your .vimrc:

autocmd CursorHold *
\ let pos = winnr()
\ | windo call high#UpdateGroups()
\ | exe pos.'wincmd w'

It will update every lighter where the __update_function is set.

Examples of user-defined highlight in Vim

For example, a very basic implentation of Valloric/vim-operator-highlight should looks like this:

let g:high_lighters = {
\ 'operator': {                                                            (1)
\   'pattern': '[-?+|*;:,<>&|!~%=)({}.\[\]]',                              (2)
\   'blacklist': ['help', 'markdown', 'qf', 'conque_term', 'diff', 'html', (3)
\                 'css', 'less', 'xml', 'sh', 'bash', 'notes', 'jinja'],
\   'hlgroup': 'Error',                                                    (4)
\ }}
  1. Add a name to the lighter (which is not in use),

  2. define the pattern to match,

  3. add whitelist/blacklist,

  4. choose a hlgroup from the existing ones.

Vim Netrw filetype coloring

The plugin can be used in another plugins, for example if you want to colorize files by extension in Netrw (:Explore, :edit ./), then you can do something like this:

let g:high_lighters = {
\ 'netrw_yaml': {
\   'whitelist': ['netrw'],
\   'pattern': '\v^([|│] )*\zs\f+\.yml',
\   'hlgroup': 'HighNetrwYaml',
\ },
\ 'netrw_asciidoc': {
\   'whitelist': ['netrw'],
\   'pattern': '\v^([|│] )*\zs\f+\.adoc',
\   'hlgroup': 'HighNetrwAsciidoc',
\ }}

autocmd ColorScheme,VimEnter *
\ highlight! HighNetrwYaml guifg=#ae9400 |
\ highlight! HighNetrwAsciidoc guifg=#dd3a00

Note that ^([|│] )* part is needed by tree view (most right picture on the screenshot).

Vim Netrw filetype coloring
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].