问题
I am trying to setup searching word under cursor with ag/ack, grep etc. In vimrc adding:
map <Leader>b :Bsgrep <C-R>=expand("<cword>") <CR>
When pushing \b it makes command line filed with bsgrep + word under cursor, but I also need to push enter because CR is ignored. My os is ubuntu trusty with xfce.
回答1:
try this:
map <Leader>b :Bsgrep <C-R>=expand("<cword>") <CR><CR>
the first <cr>
is for your <c-r>={expression}
the 2nd <cr>
is for the command in your command line.
来源:https://stackoverflow.com/questions/32379061/vim-ignores-cr