Last active
March 21, 2017 02:06
-
-
Save hyuki0000/45189cb5e188ef42c8ca0925cd3acf95 to your computer and use it in GitHub Desktop.
eregexプラグイン用に、 1,$s/ → 1,$S/ に変換 g/ → G/ に変換
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
" eregexプラグイン用に、 1,$s/ → 1,$S/ に変換 g/ → G/ に変換 | |
" Based on: https://twitter.com/koturn/status/843830301780406272 | |
" https://gist.github.com/hyuki0000/45189cb5e188ef42c8ca0925cd3acf95 | |
cnoremap <expr>/ ReplaceSlash() | |
function ReplaceSlash() | |
if getcmdtype() ==# ':' | |
if getcmdline() ==# '1,$s' | |
call feedkeys("\<C-u>1,$S/", 'n') | |
return | |
elseif getcmdline() ==# 'g' | |
call feedkeys("\<C-u>G/", 'n') | |
return | |
endif | |
endif | |
return '/' | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment