1
Fork 0

Maintain search and switch registers

master
Joshua Potter 2016-11-07 10:32:23 -08:00
parent 0da7b0457e
commit 9c0c54dd00
1 changed files with 16 additions and 14 deletions

View File

@ -100,7 +100,7 @@ endfunction
" ======================================================================
function! s:AppendToSearch(reg, pattern)
let s:last_seen = a:pattern
if len(a:pattern) > 0
if !has_key(s:registry_colors, a:reg)
call s:InitRegister(a:reg, g:highlight_register_default_color)
endif
@ -113,6 +113,7 @@ function! s:AppendToSearch(reg, pattern)
\ matchadd(s:GroupName(a:reg), a:pattern)
endif
call s:ActivateRegister(a:reg)
endif
endfunction
@ -155,15 +156,16 @@ endfunction
exe 'hi Search cterm=bold,underline ctermbg=none ctermfg=' . g:highlight_register_default_color
call s:InitRegister('0', 'Yellow')
call s:InitRegister('1', 'DarkYellow')
call s:InitRegister('1', 'Blue')
call s:InitRegister('2', 'Red')
call s:InitRegister('3', 'Magenta')
call s:InitRegister('4', 'Green')
call s:InitRegister('5', 'Cyan')
call s:InitRegister('6', 'Blue')
call s:InitRegister('6', 'DarkYellow')
call s:InitRegister('7', 'White')
call s:InitRegister('8', 'Gray')
call s:InitRegister('9', 'Black')
call s:AppendToSearch(v:register, @/)
noremap <unique> <silent> <Plug>HighlightRegistry_AppendToSearch
\ :call <SID>AppendToSearch(v:register, '\<'.expand('<cword>').'\>')<CR>