1

I'm using minibufexplorer plugin with VIM that displays buffers atop of my window. Default Ctrl+O (jump back using jumplist) opens files in separate buffers, so after a number of jumps displayed buffer count grows very large. Is it possible to modify Ctrl+O behaviour so it will open new buffer and close previous one? I have tried to program it with vimscript, but did not found any API to interact with jumplist. And if i replace Ctrl+O with my own function i don't know how to call the original implementation to do actual jump :(. Any help?

4

1 回答 1

3

您可以使用:normal!来调用原始实现,如下所示:

function s:CtrlO(count1)
    let buf=bufnr('%')
    execute 'normal!' a:count1 "\<C-o>"
    if bufnr('%')!=buf
        execute 'bwipeout' buf
    endif
endfunction
nnoremap <silent> <C-o> :<C-u>call <SID>CtrlO(v:count1)<CR>
于 2013-07-13T10:50:31.750 回答