Created
May 28, 2012 15:15
-
-
Save deris/2819673 to your computer and use it in GitHub Desktop.
検索文字列をレジスタでグローバル置換
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
" 検索文字列をレジスタでグローバル置換 | |
function! s:ReplaceGlobalSearchToRegister() | |
let l:reg = getreg(v:register) | |
let l:cmd = '%substitute//' | |
let l:opt = '/g' | |
execute l:cmd . l:reg . l:opt | |
endfunction | |
nnoremap <silent> <Space>rs :<C-u>call <SID>ReplaceGlobalSearchToRegister()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment