" ====================================================================== " File: highlight.vim " Maintainer: Joshua Potter " " ====================================================================== if exists('g:loaded_highlight_registry') finish endif let g:loaded_highlight_registry = 1 " GLOBAL VARIABLES: " ====================================================================== " g:highlight_register_default_color :: String {{{2 " ---------------------------------------------------------------------- if !exists('g:highlight_register_default_color') let g:highlight_register_default_color = 'Yellow' endif " g:highlight_registry :: { String : String } {{{2 " ---------------------------------------------------------------------- if !exists('g:highlight_registry') let g:highlight_registry = { '0' : 'Yellow' \ '1' : 'Blue' \ '2' : 'Red' \ '3' : 'Magenta' \ '4' : 'Green' \ '5' : 'Cyan' \ '6' : 'DarkYellow' \ '7' : 'White' \ '8' : 'Gray' \ '9' : 'Black' \ } endif " MAPPINGS: {{{1 " ====================================================================== " Append Searches noremap HRegistry_AppendToSearch \ :call highlight#append_to_search('\<'.expand('').'\>') \ :call highlight#count_last_seen() noremap HRegistry_GlobalAppendToSearch \ :call highlight#append_to_search(expand('')) \ :call highlight#count_last_seen() noremap HRegistry_VisualAppendToSearch \ :call highlight#append_to_search(highlight#get_visual_selection()) \ :call highlight#count_last_seen()'< " Remove Searches noremap HRegistry_RemoveFromSearch \ :call highlight#remove_from_search('\<'.expand('').'\>') noremap HRegistry_VisualRemoveFromSearch \ :call highlight#remove_from_search(highlight#get_visual_selection())'< " Other Modifications noremap HRegistry_ClearRegister :call highlight#clear_register() noremap HRegistry_ActivateRegister :call highlight#activate_register() noremap HRegistry_CountLastSeen :call highlight#count_last_seen() " Normal Mappings nmap & HRegistry_AppendToSearch nmap g& HRegistry_GlobalAppendToSearch nmap y& HRegistry_ActivateRegister nmap d& HRegistry_RemoveFromSearch nmap c& HRegistry_ClearRegister nmap * :silent norm! *& nmap g* :silent norm! *g& nmap # :silent norm! #& nmap g# :silent norm! #g& " Visual Mappings vmap & HRegistry_VisualAppendToSearch vmap d& HRegistry_VisualRemoveFromSearch vmap * &nHRegistry_CountLastSeen vmap # &NHRegistry_CountLastSeen " PROCEDURE: Initialize {{{1 " ====================================================================== for key in keys(g:highlight_registry) call highlight#init_register(key, g:highlight_registry[key]) endfor call highlight#append_to_search(v:register, @/)