Sunday, February 27, 2011

using the help system in split screen mode

I'm having a bit of trouble displaying two help windows side by side.

Here'as a typical scenario: I am reading the help file for a given topic
such as ':help folding' and I want to split the screen vertically so
that I can for instance take a look at relevant Vim options - foldclose,
foldcolumn.. foldopen.. etc.

Vim's behavior when I issue a ':help topic' Ex-mode command is to check
whether there already is an ft=help window open in the current tab, and
if so.. reuse this window to display the requested help.

When I am editing a file rather than displaying a help subject, I issue
a ':vhl topic' command (with vhl mapped to ':vertical help', and Vim
vertically splits the screen and displays the topic's help file in
a separate window, so that the buffer I am editing remains visible.

Unfortunately, when I already have a help window open in the current
tab, this does not work.

If I try..

:vertical split +help topic

.. Vim splits the screen.. creates an empty buffer named 'topic'.. and
displays the new help in the original ft=help window.

If I do a...

:vertical split help topic

.. Vim considers 'help' and 'topic' are file names and gives an 'E172:
Only one file name allowed' error message..

I am able to work around this dilemma like so:

:tab help " creates a tab with full-screen help
:help topic " displays topic's help
:vertical split +help " splits screen, displays help & focuses the
" new sub-window
:help option " displays help for topic-related option

The result of the above is that the Vim window is split down the middle
with e.g. the discussion of 'folding' on the left and the 'foldopen'
help on the left, exactly what I need.

This is just an example.. there are many other scenarios where I find it
considerably more convenient to split the window than use tags and start
yet another descent into hypertext hell. :-)

In any event, what I do after this, is that when I'm done reading the
'auxiliary help', I issue a 'CTRL-W w' and I am back to the main topic
and continue reading. And when I run into something else tha I do not
'understand well enough', I issue another 'CTRL-W w' to switch to my
second help sub-window and issue another :help command to investigate.
And when done with it, another 'CTRL-W w' brings me back to where I was
and I can continue reading in sequence. etc..

Could anyone suggest a better help subwindow management scheme..?

Thanks,

cj

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

No comments: