Vim ignores <cr>

馋奶兔 提交于 2019-12-12 00:32:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!