Is there a way to prevent :help from splitting the window?!
I never, ever want a horizontal split. I'd just like to see the help
text in a new tab.
I mostly use gvim, sometimes vim. So I need a solution that works in
both cases.
--
Best Regards,
Tarlika Elisabeth Schmitz, Scotland
Tarlika Elisabeth Schmitz wrote:
> This is one of my biggest bug bears and it drives me absolutely nuts:
>
> Is there a way to prevent :help from splitting the window?!
> I never, ever want a horizontal split. I'd just like to see the help
> text in a new tab.
>
>
> I mostly use gvim, sometimes vim. So I need a solution that works in
> both cases.
:tab help topic
Regards,
J�rgen
--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)
Hi,
What about using an autocommand:
au BufEnter * if &filetype == 'help' | :only | endif
See ':help :only' for how it works when 'hidden' is not set.
The drawback of it is that if you have several windows opened it will hide
them all, but it seems that you don't split windows in which case this doesn't
matter.
Best regards,
Marcin
I always use that method to read help pages. In fact I have added an abbreviation in my .vimrc for it:
cabbrev help tab help
Now whenever you start typing :help on the commandline and press the spacebar the enter the subject, it will automatically expand to 'tab help'.
Jeroen
Same here
>
>
> I mostly use gvim, sometimes vim. So I need a solution that works in
> both cases.
>
I have this command abbreviation:
" h open help in new tab
cabbrev h tab help
So whenever I ask help with ':h' it just opens a new tab with it.
HTH,
Guido
--
What I want is all of the power and none of the responsibility.
On 30/03/2012 13:39, Guido Van Hoecke wrote:
> On Fri, Mar 30, 2012 at 13:51, Tarlika Elisabeth Schmitz
> <v...@numerixtechnology.de> wrote:
>> This is one of my biggest bug bears and it drives me absolutely nuts:
>>
>> Is there a way to prevent :help from splitting the window?!
>> I never, ever want a horizontal split. I'd just like to see the help
>> text in a new tab.
>
> Same here
>
>>
>>
>> I mostly use gvim, sometimes vim. So I need a solution that works in
>> both cases.
>>
>
> I have this command abbreviation:
>
> " h open help in new tab
> cabbrev h tab help
>
> So whenever I ask help with ':h' it just opens a new tab with it.
Maybe it's just me but if I type:
`:tab help topic` that works but the above abbreviation doesn't do anything.
Vim 7.2.445 huge with GTK2 GUI & the same console version on Debian
Squeeze + Vim 7.3.462 huge no GUI & MacVim 7.3.353 huge with MacVim GUI
on OS X.
Cheers,
Phil...
- --
But masters, remember that I am an ass.
Though it be not written down,
yet forget not that I am an ass.
Wm. Shakespeare - Much Ado About Nothing
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJPdbCIAAoJEKpMeDHWT5ADxAsH/iPqXFjeRiJMGRHRLhw6EdEB
n3seaTxR1wxgVOk3FGoZb7x+erPeq+ygHtu6FqdTP+eMvnYBGNlKSOtcRIDn/I8S
wHfsOiWz2PTPf3WFZDc772i/RwlU0ASnlgGj7KniRZY3AO4CnKc6EjJglyIX1FJK
Jgp9X0xvYRVmFDCU7DcSenspU41IoncbA/MZMDd/tTW0VX7pzvngd4JU8TQWYPbA
yCgIeNTp187I+sO/tZmXjVGlDpVnfb67w7uCan44vEOadwKm0m6U7LUURqXcsSyp
+PxQG0VGH2K3NyXRnkzFcXTJSSo/F4sHARyK8Pdz2e/j1vkwsGKIUaH8BzqRW20=
=4SIZ
-----END PGP SIGNATURE-----
`:h topic` should work equally well.
>
> Vim 7.2.445 huge with GTK2 GUI & the same console version on Debian
> Squeeze + Vim 7.3.462 huge no GUI & MacVim 7.3.353 huge with MacVim GUI
> on OS X.
Strange, I have this cabbrev in my .vimrc longer than I can remember.
Currently I use
:version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 2 2012 17:38:47)
MacOS X (unix) version
Included patches: 1-390
Compiled by Bjorn Winckler <bjorn.w...@gmail.com>
Huge version with MacVim GUI.
So sorry I can't give any further assistance.
It's basic vim, can't think of any reason why it would not work.
With kind regards,
Guido
--
All I ask of life is a constant and exaggerated sense of my own
importance.
>> Is there a way to prevent :help from splitting the window?!
>cabbrev h tab help
Many thanks - works fine here.
I've covered all options in .vimrc now:
" always open help in new tab
cabbrev help tab help
cabbrev he tab help
cabbrev h tab help
On 30/03/2012 14:35, Tarlika Elisabeth Schmitz wrote:
> On Fri, 30 Mar 2012 14:39:33 +0200 Guido Van Hoecke
> <gui...@gmail.com> wrote:
>
>>> Is there a way to prevent :help from splitting the window?!
>> cabbrev h tab help
>
> Many thanks - works fine here.
>
> I've covered all options in .vimrc now:
>
> " always open help in new tab cabbrev help tab help cabbrev he tab
> help cabbrev h tab help
Very odd. Never mind, `:tab h topic` it is then...
Cheers,
Phil...
- --
But masters, remember that I am an ass.
Though it be not written down,
yet forget not that I am an ass.
Wm. Shakespeare - Much Ado About Nothing
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJPdbt8AAoJEKpMeDHWT5AD45EIAMtDgRTtTIaIA7ts6POay+5y
v8Oihnta51JJ/S+y6mDSjWE8vDSmr10+nl0SDioEx6Fs+hbEmnlyhco4xkci33hr
wcbGyerCTBJIgvW9ykf88mKU94dmmfXb2btBFl6JOMMgqkvvE2Z39Tjze3lvBWrh
+NigFm8Vdwss9hLhsFfl/iW4oY2Ou6etjwgcJ3mkt/7ZzRQjMQfp96EFZ8ktOtI8
jx77IZEjplplLTy61pN8u1cYAX3ip2vEd55cIaqMr27gIZOG8GiVzbSIB1OVoXlT
M3+GLivEhr1CtKVB2FxG0M/IFdmHhfltyt6QEvS2I57SjtF5HEX2BTBl8XzAiC0=
=7Sv7
-----END PGP SIGNATURE-----
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.
Manpageview (see
http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW), which
handles several kinds of help (vim, manpages, perl, php, and python),
has a TMan command, which provides help in a separate tab. As a
variant, there's OMan, which saves your window(s) and opens the help
page in its stead (and a :q will restore your previous window(s)).
Regards,
Chip Campbell
>Manpageview (see
>http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW), which
>handles several kinds of help (vim, manpages, perl, php, and python),
>has a TMan command, which provides help in a separate tab.
Just installed (v24c). I like K Map! Great for Vim and bash!
There doesn't seem to be a TMan though.
On vim help pages PgUp, PgDn work but on bash man pages and python help
they don't; there I need to scroll using the scroll bars.
I'll have to look into PgUp and PgDn later...
Regards,
Chip Campbell
>Tarlika Elisabeth Schmitz wrote:
>> On Fri, 30 Mar 2012 13:17:44 -0400
>> Charles Campbell<Charles.E...@nasa.gov> wrote:
>>
>>
>>> Manpageview (see
>>> http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW), which
>>> handles several kinds of help (vim, manpages, perl, php, and
>>> python), has a TMan command, which provides help in a separate tab.
>>>
>> Just installed (v24c).
>>
>> There doesn't seem to be a TMan though.
>>
>I've now loaded v24d on my website; its the one with TMan.
I installed v24d but the plugin/manpageviewPlugin.vim is from 16/9/2008
and doesn't define TMan. (unless I've done something dumb?)
Excerpt from Ben Fritz:
-- <snip> --
> 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
How about:
au bufwinenter *.txt
\ if &buftype == "help"
\ | wincmd T
\ | 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.
>
--
Regards,
Thilo
4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F
One slight disadvantage of the above (which can be worked around in
recent versions) is that if you ever type the word "help" on a command
lne, it will be abbreviated even if not at the start. For example, the
(very useful) command
:help help
will become
:tab help tab help
which not only is not what you want, it is illegal. In addition, the
abbreviation will be triggered also in / or ? (search) command-lines,
which you don't want either.
The way to work around it is as follows:
if version < 700
cnoreabbrev h tab h
cnoreabbrev he tab he
cnoreabbrev hel tab hel
cnoreabbrev help tab help
" in Vim 6.x or earlier (which is now obsolete
" but hasn't got :abbr <expr> )
" we'll need to break the abbrev halfway
" (e.g. by <Left><Right>)
" to avoid expanding the argument of :help help
" or h he hel help in a search command
else
cnoreabbrev <expr> h
\ ((getcmdtype() == ':' && getcmdpos() <= 2)?
\ 'tab h' : 'h')
cnoreabbrev <expr> he
\ ((getcmdtype() == ':' && getcmdpos() <= 3)?
\ 'tab he' : 'he')
cnoreabbrev <expr> hel
\ ((getcmdtype() == ':' && getcmdpos() <= 4)?
\ 'tab hel' : 'hel')
cnoreabbrev <expr> help
\ ((getcmdtype() == ':' && getcmdpos() <= 5)?
\ 'tab help' : 'help')
endif
Notes:
-----
- The above (meant for cut'n paste) assumes 'nocompatible', which is the
default if your vimrc is named .vimrc or _vimrc but not .exrc or _exrc
- The deprecated (but still valid) variable name "version" is used in
preference to "v:version" for compatibility with some even older
obsolete versions.
Best regards,
Tony.
--
Once Law was sitting on the bench
And Mercy knelt a-weeping.
"Clear out!" he cried, "disordered wench!
Nor come before me creeping.
Upon you knees if you appear,
'Tis plain you have no standing here."
Then Justice came. His Honor cried:
"YOUR states? -- Devil seize you!"
"Amica curiae," she replied --
"Friend of the court, so please you."
"Begone!" he shouted -- "There's the door --
I never saw your face before!"
-- Ambrose Bierce, "The Devil's Dictionary"
I just downloaded v24d myself from my website -- and TMan is there (its
actually defined as a command in manpageviewPlugin.vim). It worked for
me when I tested it, too.
Please check again... (and be sure that you're actually getting v24d,
it'll say so in manpageview.vim -- perhaps the browser cache is causing
problems?).
Regards,
Chip Campbell
>I just downloaded v24d myself from my website -- and TMan is there
ok, got it now. No idea where I went wrong.
Yes, you could also use &buftype rather than &filetype. But this will never allow you to intentionally split a help window and look up a new topic to see two of them side-by-side. Hence the wincmd p stuff in my suggestion.
--
.~. In my life God comes first....
/V\ but Linux is pretty high after that :-D
/( )\ Francis (Grizzly) Smit
^^-^^ http://www.smit.id.au/
Excerpt from Ben Fritz:
-- <snip> --
> Yes, you could also use &buftype rather than &filetype. But this will never
> allow you to intentionally split a help window and look up a new topic to see
> two of them side-by-side. Hence the wincmd p stuff in my suggestion.
Good Point. This version seem to resemble this:
au bufwinenter *.txt
\ if &buftype == "help"
\ | if getwinvar(winnr("#"), '&ft') != 'help'
\ | wincmd T
\ | endif
\ | endif
>Tarlika Elisabeth Schmitz wrote:
>> On Fri, 30 Mar 2012 13:17:44 -0400
>> Charles Campbell<Charles.E...@nasa.gov> wrote:
>>
>>
>>> Manpageview (see
>>> http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW), which
>>> handles several kinds of help (vim, manpages, perl, php, and
>>> python), has a TMan command, which provides help in a separate tab.
>>>
>> On vim help pages PgUp, PgDn work but on bash man pages and python
>> help they don't; there I need to scroll using the scroll bars.
>>
>I'll have to look into PgUp and PgDn later...
Did you ever get a chance to look into this?
--
Tarlika Elisabeth Schmitz, Scotland
Saor Alba