Created
May 18, 2014 17:15
-
-
Save RobertAudi/99a656670eaec8a5f9c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set hlsearch | |
highlight CurSearch guibg=green | |
nnoremap <silent> N N:silent! call HighlightCurrentMatch()<CR> | |
nnoremap <silent> n n:silent! call HighlightCurrentMatch()<CR> | |
function! HighlightCurrentMatch() | |
let col = col(".") - 1 | |
let endCol = searchpos(getreg("/"), "cne")[1] + 1 | |
let line = line(".") | |
let matchPat = '/\%' . line . 'l\%>' . col . 'c\%<' . endCol . 'c/' | |
echomsg matchPat | |
3match none | |
exe ':3match CurSearch ' . matchPat | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment