Vim忽略< cr> [英] Vim ignores <cr>

查看:109
本文介绍了Vim忽略< cr>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ag/ack,grep等在光标下设置搜索词. 在vimrc中添加:

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>

当按下\ b时,它将使命令行在光标下带有bsgrep + word,但是我也需要按下Enter键,因为CR被忽略了. 我的操作系统对xfce十分信任.

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.

推荐答案

尝试一下:

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

第一个<cr>用于您的<c-r>={expression}

第二个<cr>用于您命令行中的命令.

the 2nd <cr> is for the command in your command line.

这篇关于Vim忽略&lt; cr&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆