Wiki

Clone wiki

VimLabo / verymagic

" use very magic
noremap     /       /\v
cnoreabbrev s/      s/\v<C-r>=Eatchar()<CR>
cnoreabbrev '<,'>s  '<,'>s/\v<C-r>=Eatchar()<CR>
cnoreabbrev %s      %s/\v<C-r>=Eatchar()<CR>
cnoreabbrev g/      g/\v<C-r>=Eatchar()<CR>
cnoreabbrev v/      v/\v<C-r>=Eatchar()<CR>

function! Eatchar(...)
    let pat = (exists('a:1') && s:isString(a:1)
    \                       ? a:1
    \                       : '/\|\s\|\\')
    let char = nr2char(getchar(0))
    return char =~? pat ? '' : char
endfunction

Updated