6

在 中搜索后unite.vim,您打开了一个候选人。有没有一种简单的方法可以跳转到下一个而无需再次运行搜索命令?类似的插件 ( ack.vim, git-grep) 使用快速修复窗口,因此您可以键入:cn:cp跳转到下一个/上一个结果。里面有没有类似的unite.vim

谢谢!

4

2 回答 2

7

我还没有找到将结果放入快速修复或位置列表的方法,但我确信您可以扩展 Unite 以包含该操作。

同时,Unite 文档中的这段小摘录可以帮助您重新打开您最近打开的 Unite 缓冲区:

:UniteResume [{options}] [{buffer-name}]    *:UniteResume*
        Reuses the unite buffer named {buffer-name} that you opened
        previously.  Narrowing texts or candidates are
        as-is.  If {options} are given, context information gets
        overridden.

        Note: Reuses the last unite buffer you used in current tab if
        you skip specifying {buffer-name}.

我在我的 vimrc 中以下列方式使用它:

 " Press <leader>ll to re-open last Unite buffer
 nnoremap <silent><leader>ll :<C-u>UniteResume<CR>

文档中另一个有用的片段:

    -no-quit
    Doesn't close unite buffer after firing an action.  Unless you
    specify it, a unite buffer gets closed when you selected an
    action which is "is_quit".

    -keep-focus
    Keep the focus on a unite buffer after firing an action.
    Note: This option is used with "-no-quit" option.

例如,您可以绑定

nnoremap <silent><leader>lg :<C-u>Unite -no-quit -keep-focus grep<CR>

To be able to press <leader>lg to grep through your source files, without closing or de-focusing the Unite buffer when you select an item.

于 2014-02-20T08:08:35.443 回答
6

Good news, everyone! I created an issue-724 with your request in Unite repo and it has been implemented in the blink of an eye! Glory to Shougo!

From the docs:

:UniteNext [{buffer-name}] *:UniteNext*
 Do the default action with next candidates in the unite buffer
 with {buffer-name}.
 You can use it like |:cnext|.

:UnitePrevious [{buffer-name}] *:UnitePrevious*
 Do the default action with previous candidates in the unite
 buffer with {buffer-name}.
 You can use it like |:cprevious|.
于 2014-09-09T13:20:47.247 回答