Reputation: 553
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.
Upvotes: 0
Views: 117
Reputation: 195039
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.
Upvotes: 3