vim中的quickfix window

vimgrep是vim自带的一个工具,类似于grep的用法就可以实现。比如要在当前目录查找word,使用如下:

如果想要递归查找所有下级目录里面,那么就用

另外,如果想要在使用是快捷查找当前光标下的字母,则只需要在vimrc中添加如下代码:

通过vimgrep查找到的结果会生成到quickfix中,如下图:

There are a lot of commands for quickfix as you have said, but I tend to find I only use a small subset of them:

:copen " Open the quickfix window
:ccl   " Close it
:cw    " Open it if there are "errors", close it otherwise (some people prefer this)
:cn    " Go to the next error in the window
:cnf   " Go to the first error in the next file
get back to the  Quickfix List  I type  Ctrl + W

You can also use :cc 2 (or any other number) to jump to, in this case, the second error in the quickfix window. Navigating with :cn:cc 4, etc will put the cursor on the line in question.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值