Created
October 7, 2015 09:42
-
-
Save raine/86a5ddfddb5a8f645c3a 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! AgSearchAndReplaceCursor() | |
let search = expand('<cword>') | |
execute "Ag! " . search | |
call feedkeys(':QFdo %s/' . search . "//gc") | |
call feedkeys("\<Left>\<Left>\<Left>") | |
endfunction | |
nmap <space>ac :silent Ag<CR> " word on cursor | |
nmap <space>ag :silent Ag! ""<Left> | |
nmap <space>as :silent AgFromSearch<CR> | |
nmap <space>ar :call AgSearchAndReplaceCursor()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment