user3003873
user3003873

Reputation: 553

Vim ignores <cr>

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

Answers (1)

Kent
Kent

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

Related Questions