1
Fork 0

Allow custom linking of prefixed group

master
Joshua Potter 2017-05-26 10:05:27 -07:00
parent ef0e11d86d
commit 758449bd72
4 changed files with 30 additions and 11 deletions

View File

@ -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

View File

@ -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*

View File

@ -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*

View File

@ -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
" ==============================================================================