I have setup my Vim Help to appear as a listed buffer for my ease of quick access and return to same page. The problem I face is that every time I jump around in Vim Help page using Ctrl-] a new Vim-Help-page-buffer is created, which is not what I want.

Is there a way to disable Vim from creating a new buffer every time I jump to a hyperlinked page within Vim Help pages?

Or else perhaps, is it possible to have the opening of a Vim-Help-hyperlinked-page to automatically trigger the deletion of the previous Vim-Help buffer? How could this be scripted?

  • 2
    It may be easier to let the help buffer unlisted, and use :ls! and :buffer <number> to jump to an existing help buffer instead.
    – VanLaser
    Oct 6, 2015 at 13:39
  • Thanks, but choose not this way bec. want to have help listed. Oct 7, 2015 at 1:18

1 Answer 1


Well, I decided to answer my own question:

autocmd BufEnter,BufWinEnter * if &filetype=='help' 
        \| let w:bufnuc = bufnr("%")
        \| let w:bufnua = bufnr("#")
        \| if w:bufnua > 0
            \| execute "buffer " . w:bufnua
                \| if &filetype=='help' 
                    \| if w:bufnua != w:bufnuc
                        \| set nobuflisted
                    \| endif
                \| endif 
            \| execute "buffer " . w:bufnuc
        \| endif
    \| endif

It works as per spec's above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.