将所有选定文件打开为隐藏缓冲区?

时间:2015-10-24 06:52:01

标签: ctrlp

有没有办法Ctrl-P可以打开所有选定的文件作为隐藏缓冲区? 这就是我尝试将文件加载到缓冲区的方式:

<c-p>               (opens Ctrl-P in file mode)
<c-o>               
a                   (marks all files in the match window)
i

最后一次&#34; i&#34;旨在将所选文件作为隐藏缓冲区打开。 相反&#34;我&#34;出现在搜索对话框中。

发件人:帮助CtrlP

Opening multiple files:

  <c-z>
    - Mark/unmark a file to be opened with <c-o>.
    - Mark/unmark a file to create a new file in its directory using <c-y>.

  <c-o>
    - Open files marked by <c-z>.
    - When no file has been marked by <c-z>, open a console dialog with the
      following options:

      Open the selected file:
        t - in a tab page.
        v - in a vertical split.
        h - in a horizontal split.
        r - in the current window.
        i - as a hidden buffer.
        x - (optional) with the function defined in |g:ctrlp_open_func|.

      Other options (not shown):
        a - mark all files in the match window.
        d - change CtrlP's local working directory to the selected file's
            directory and switch to find file mode.

2 个答案:

答案 0 :(得分:3)

以下是如何将所有选定文件作为隐藏缓冲区打开。

将此行添加到vimrc:

let g:ctrlp_open_multiple_files = 'ij'

,其中

i - all files as hidden buffers.
j - after opening, jump to the first opened tab or window.

在Vim:

<c-p>               open Ctrl-P in file mode
<c-o>               open a console dialog
a                   mark all files in the match window
<c-z>               mark/unmark a file
<c-o>               open marked files as hidden buffers

答案 1 :(得分:0)

这也有效:

" 1r - open the first file in the current window, and remaining opened as hidden buffers.
let g:ctrlp_open_multiple_files = '1r'