From 758449bd72b6e73bb1120a0cf8f1a04c01817d06 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Fri, 26 May 2017 10:05:27 -0700 Subject: [PATCH] Allow custom linking of prefixed group --- autoload/highlight.vim | 2 +- doc/highlight.txt | 8 ++++++++ doc/tags | 13 ++++++------- plugin/hightlight.vim | 18 +++++++++++++++--- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/autoload/highlight.vim b/autoload/highlight.vim index aa74698..bb436d8 100644 --- a/autoload/highlight.vim +++ b/autoload/highlight.vim @@ -283,7 +283,7 @@ function! highlight#clear_register(reg) endif if a:reg ==# s:active_register hi! link Search NONE - exe 'hi! link' g:highlight_register_prefix 'NONE' + exe 'hi! link' g:highlight_register_prefix g:highlight_register_prefix_link endif endfunction diff --git a/doc/highlight.txt b/doc/highlight.txt index c842f93..4ee53ba 100644 --- a/doc/highlight.txt +++ b/doc/highlight.txt @@ -68,6 +68,14 @@ g:persist_unnamed_register regard the unnamed register to implicitly imply use of the last activated register. +g:highlight_register_prefix + + Prefix used in naming the generating highlight register highlight groups. + +g:highlight_register_prefix_link + + Default link the highligh group g:highlight_register_prefix points to. + ============================================================================== Section 3: Statusline *highlight-statusline* diff --git a/doc/tags b/doc/tags index a02caf2..2d40ef3 100644 --- a/doc/tags +++ b/doc/tags @@ -1,7 +1,6 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f1de2a89/ +highlight-commands highlight.txt /*highlight-commands* +highlight-contents highlight.txt /*highlight-contents* +highlight-registry highlight.txt /*highlight-registry* +highlight-statusline highlight.txt /*highlight-statusline* +highlight-usage highlight.txt /*highlight-usage* +highlight-variables highlight.txt /*highlight-variables* diff --git a/plugin/hightlight.vim b/plugin/hightlight.vim index 21d40c7..506d08c 100644 --- a/plugin/hightlight.vim +++ b/plugin/hightlight.vim @@ -32,7 +32,7 @@ let g:loaded_highlight_registry = 1 if !exists('g:highlight_registry') function! s:InitializeHighlightRegistry() let g:highlight_registry = {} - let l:colors = [ 'Yellow', 'Blue', 'Red', 'Magenta', 'Green', 'Cyan', + let l:colors = [ 'Yellow', 'LightBlue', 'Red', 'Magenta', 'Green', 'Cyan', \ 'DarkYellow', 'White', 'Gray', 'Black' ] let l:index = 0 while l:index < len(l:colors) @@ -58,14 +58,26 @@ endif " g:highlight_register_prefix :: String {{{2 " ------------------------------------------------------------------------------ " Prefix used for group names and for link between Search highlight group and -" the highlight registries. That is, hi link Search {g:highlight_register_prefix} -" and hi link {g:highlight_register_prefix} {active search register}. +" the highlight registries. That is, +" hi link Search {g:highlight_register_prefix} +" and +" hi link {g:highlight_register_prefix} {active search register}. if !exists('g:highlight_register_prefix') let g:highlight_register_prefix = 'HighlightRegister' endif +" g:highlight_register_prefix_link :: String +" ------------------------------------------------------------------------------ +" Name of the highlight group the highlight_register_prefix group should be +" linked to when no longer active. By default, this is NONE. + +if !exists('g:highlight_register_prefix_link') + let g:highlight_register_prefix_link = 'NONE' +endif + + " MAPPINGS: {{{1 " ==============================================================================