简体   繁体   English

Vim忽略<cr>

[英]Vim ignores <cr>

I am trying to setup searching word under cursor with ag/ack, grep etc. In vimrc adding: 我正在尝试使用ag / ack,grep等在光标下设置搜索词。在vimrc中添加:

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. 当按下\\ b时,它将使命令行在光标下带有bsgrep + word,但是我也需要按下Enter键,因为CR被忽略了。 My os is ubuntu trusty with xfce. 我的操作系统对xfce十分信任。

try this: 尝试这个:

map <Leader>b :Bsgrep <C-R>=expand("<cword>") <CR><CR>

the first <cr> is for your <cr>={expression} 第一个<cr>用于您的<cr>={expression}

the 2nd <cr> is for the command in your command line. 第二个<cr>用于命令行中的命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM