Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vim:跳转到包含/string的缓冲区/_Vim - Fatal编程技术网

vim:跳转到包含/string的缓冲区/

vim:跳转到包含/string的缓冲区/,vim,Vim,我通常会打开相当多的缓冲区,我使用Bufexplorer和FuzzyFinder的组合导航这些缓冲区。找到正确的缓冲区仍然需要遍历文件名。但通常说“跳转到包含“wip”的缓冲区”会容易得多。有人知道怎么做吗?签出缓冲区grep:签出缓冲区grep:我正在使用我放在.vimrc中的一个小函数: function! s:GrepOpenBuffers(search, jump) call setqflist([]) let cur = getpos('.') silent!

我通常会打开相当多的缓冲区,我使用Bufexplorer和FuzzyFinder的组合导航这些缓冲区。找到正确的缓冲区仍然需要遍历文件名。但通常说“跳转到包含“wip”的缓冲区”会容易得多。有人知道怎么做吗?

签出缓冲区grep:

签出缓冲区grep:

我正在使用我放在.vimrc中的一个小函数:

function! s:GrepOpenBuffers(search, jump)
    call setqflist([])
    let cur = getpos('.')
    silent! exe 'bufdo vimgrepadd /' . a:search . '/ %'
    let matches = len(getqflist())
    if a:jump && matches > 0
        sil! cfirst
    else
        call setpos('.', cur)
    endif
    echo 'BufGrep:' ((matches) ? matches : 'No') 'matches found'
endfunction
com! -nargs=1 -bang BufGrep call <SID>GrepOpenBuffers('<args>', <bang>0)
函数!s:GrepOpenBuffers(搜索、跳转)
调用setqflist([])
设cur=getpos('.'))
安静!exe'bufdo vimgrepad/'。a:搜索“/%”
让matches=len(getqflist())
如果:跳转与匹配>0(&M)
西尔!第一
其他的
调用setpos('.',cur)
恩迪夫
回显“BufGrep:”((匹配项)?匹配项:“否”)“找到匹配项”
端功能
com-nargs=1-bang BufGrep调用GrepOpenBuffers(“”,0)

您可以使用类似于上面的方法在所有打开的缓冲区中grep搜索词。

我正在使用我在.vimrc中放入的一个小函数:

function! s:GrepOpenBuffers(search, jump)
    call setqflist([])
    let cur = getpos('.')
    silent! exe 'bufdo vimgrepadd /' . a:search . '/ %'
    let matches = len(getqflist())
    if a:jump && matches > 0
        sil! cfirst
    else
        call setpos('.', cur)
    endif
    echo 'BufGrep:' ((matches) ? matches : 'No') 'matches found'
endfunction
com! -nargs=1 -bang BufGrep call <SID>GrepOpenBuffers('<args>', <bang>0)
函数!s:GrepOpenBuffers(搜索、跳转)
调用setqflist([])
设cur=getpos('.'))
安静!exe'bufdo vimgrepad/'。a:搜索“/%”
让matches=len(getqflist())
如果:跳转与匹配>0(&M)
西尔!第一
其他的
调用setpos('.',cur)
恩迪夫
回显“BufGrep:”((匹配项)?匹配项:“否”)“找到匹配项”
端功能
com-nargs=1-bang BufGrep调用GrepOpenBuffers(“”,0)

您可以使用类似上面的方法在所有打开的缓冲区中grep搜索词。

这一点很好!实际上我已经安装了EasyGrep,它也可以搜索缓冲区。。。但是我遇到的所有*grep插件都会在quickfix窗口中打开。理想情况下,我想要的是即时跳转到(比如说,第一场)比赛。像“gf”或标签。很好!实际上我已经安装了EasyGrep,它也可以搜索缓冲区。。。但是我遇到的所有*grep插件都会在quickfix窗口中打开。理想情况下,我想要的是即时跳转到(比如说,第一场)比赛。像“女朋友”或标签。很酷!要是它也能跳到第一场比赛就好了。。。可能是?@artemave要跳转到第一场比赛,您必须使用
:BufGrep!搜索词
非常酷!要是它也能跳到第一场比赛就好了。。。可能是?@artemave要跳转到第一场比赛,您必须使用
:BufGrep!搜索术语