On Friday, March 30, 2012 7:30:36 AM UTC-5, coot_. wrote:
> 
> Hi,
> 
> What about using an autocommand:
> 
> au BufEnter * if &filetype == 'help' | :only | endif
> 

This will wreck havoc if you ever intentionally split the help window, for 
example to view two help topics side by side.

I would lean toward something like this, were I to want an automatic method:

au bufwinenter *.txt
\ if &filetype=='help' | wincmd p | 
\   if &filetype!='help' | wincmd p | wincmd T | 
\   else | wincmd p | endif | 
\ endif

Probably I would tweak this to not actually switch the window but use a 
function to retrieve the option value without switching windows, but this seems 
to work fairly well in a few minutes of testing.

I normally just prefix the :tab though, and don't really feel the need for any 
automatic method.

-- 
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

Reply via email to