Skip to content

Instantly share code, notes, and snippets.

@deris
Created May 28, 2012 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deris/2819673 to your computer and use it in GitHub Desktop.
Save deris/2819673 to your computer and use it in GitHub Desktop.
検索文字列をレジスタでグローバル置換
" 検索文字列をレジスタでグローバル置換
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