1
Fork 0

Prefix variables with highlight and get register_prefix

master
Joshua Potter 2017-05-24 18:04:59 -07:00
parent c81985c519
commit 717177006f
2 changed files with 16 additions and 5 deletions

View File

@ -35,10 +35,10 @@ let s:registry = {}
" Convenience method to determine which register is being currently used. " Convenience method to determine which register is being currently used.
" The unnamed register defaults to the last used register to avoid having to " The unnamed register defaults to the last used register to avoid having to
" constantly prefix registration. This can be changed by setting the value of " constantly prefix registration. This can be changed by setting the value of
" g:persist_unnamed_register to 1. " g:highlight_persist_unnamed_register to 1.
function! highlight#expand_reg(reg) function! highlight#expand_reg(reg)
if !g:persist_unnamed_register && a:reg ==# '"' if !g:highlight_persist_unnamed_register && a:reg ==# '"'
return s:active_register return s:active_register
endif endif
return a:reg return a:reg

View File

@ -45,13 +45,24 @@ if !exists('g:highlight_registry')
endif endif
" g:persist_unnamed_register :: Boolean {{{2 " g:highlight_persist_unnamed_register :: Boolean {{{2
" ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------
" Determines how to manage the unnamed register '"'. If set to false, we regard " Determines how to manage the unnamed register '"'. If set to false, we regard
" the unnamed register to implicitly imply use of the last activated register. " the unnamed register to implicitly imply use of the last activated register.
if !exists('g:persist_unnamed_register') if !exists('g:highlight_persist_unnamed_register')
let g:persist_unnamed_register = 0 let g:highlight_persist_unnamed_register = 0
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}.
if !exists('g:highlight_register_prefix')
let g:highlight_register_prefix = 'HighlightRegister'
endif endif