Last active
February 27, 2017 18:39
-
-
Save arp242/1fe1d86745a20e3bfc0e0fccfad07551 to your computer and use it in GitHub Desktop.
Make semicolon wrap around
This file contains 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
" http://stackoverflow.com/a/42465336/660921 | |
function! RepeatFind(reverse) | |
let l:pos = col('.') | |
let l:reverse = a:reverse == getcharsearch()['forward'] | |
exe 'normal! ' . (l:reverse ? ',' : ';') | |
if col('.') == l:pos | |
exe 'normal! ' . (l:reverse ? '$' : '0') . ';,'[l:reverse] | |
endif | |
endfunction | |
nnoremap ; :call RepeatFind(0)<cr> | |
nnoremap , :call RepeatFind(1)<cr> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment