Ⅰ. 插件描述
Locate the quickfix item at the cursor position.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/quickfixcurrentnumber'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/quickfixcurrentnumber'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/quickfixcurrentnumber'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/QuickFixCurrentNumber
Ⅳ. 文档说明
DESCRIPTION
You can navigate through the errors in the quickfix list with the built-in
:cfirst, :cnext, etc. commands. The quickfix and location lists have a
notion of "current item" (the highlighted one), and you can easily jump back
to it or others. But there's no built-in way to find out which error is at or
after the current cursor position, and you cannot limit the navigation to
errors in the current buffer.
This plugin provides additional quickfix commands like :Cnr and :Cgo to
print / go to the item at or after the cursor position, and motions like ]q
to go to previous / next errors in the current buffer, based on the cursor
position.
SOURCE
Inspired by the following Stack Overflow question:
http://stackoverflow.com/questions/14778612/jump-to-the-errors-in-the-quickfix-or-location-list-for-the-current-line-in-vim
USAGE
:Cnr, :Lnr Print the number of the item in the quickfix /
location list for the current cursor position (or the
next item after the cursor).
:Cgo[!], :Lgo[!] Go to the item in the quickfix / location list for the
g<C-Q> current cursor position (or the next item after the
cursor). g<C-Q> (and the commands when [!] is given)
also jump to the last item if the cursor is after all
errors; without [!], the commands then abort with an
error.
[q / ]q Go to [count] previous / next start of an error in the
current buffer.
g[q / g]q Go to [count] first / last error in the current
buffer.
[l / ]l Go to [count] previous / next start of a location list
item in the current buffer.
g[l / g]l Go to [count] first / last location list item in the
current buffer.