search

Home  >  Q&A  >  body text

vim continuously verifies substitutions

:%s/souce/source/c

How to make it continuously verify replacement

迷茫迷茫2822 days ago626

reply all(2)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 16:37:50

    :%s/souce/source/gc

    reply
    0
  • 黄舟

    黄舟2017-05-16 16:37:50

    Copy the following code into your .vimrc file

    " 不确认、非整词
    nnoremap <Leader>R :call Replace(0, 0, input('Replace '.expand('<cword>').' with: '))<CR>
    " 不确认、整词
    nnoremap <Leader>rw :call Replace(0, 1, input('Replace '.expand('<cword>').' with: '))<CR>
    " 确认、非整词
    nnoremap <Leader>rc :call Replace(1, 0, input('Replace '.expand('<cword>').' with: '))<CR>
    " 确认、整词
    nnoremap <Leader>rcw :call Replace(1, 1, input('Replace '.expand('<cword>').' with: '))<CR>
    nnoremap <Leader>rwc :call Replace(1, 1, input('Replace '.expand('<cword>').' with: '))<CR>

    Source: https://github.com/yangyangwi...

    reply
    0
  • Cancelreply