On Tuesday, October 6, 2015 at 12:06:17 PM UTC+2, Annis Monadjem wrote:
> Hi,
>
> 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?
Here is my own answer. It unlists earlier Vim-Help buffers which makes it very handy:
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
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment