sponsor Vim development Vim logo go to HTTPS page Vim Book Ad

VerticalHelp : Launch help in vertical window for wide-screen displays

 script karma  Rating 0/2, Downloaded by 473    Comments, bugs, improvements  Vim wiki

created by
Mel Davis
script type
This is a very simple script to display help in an appropriately sized vertical window.

With a wide-screen monitor, vim's help is best displayed in a vertical window; but the command 'vertical help' opens a help window taking up half of the display. In my case, it opens a 250 column window to display an 80 column file.  The width of the vertical window is the buffer's textwidth, typically specified in the file's modeline.  

:H  <topic>    " Opens a help window vertically on the right

If a help topic was opened horizontally using :h, then the command :H will move and resize the window.
If a help window already exists that is vertical and sized appropriately, then :H will toggle between the help window and the previous window without having to <C-W>p.

:H allows for command-line completion, just as :h does.

g:vertical_help_left -- Define this to display the window on the left instead of the right.

I especially like to use this to display custom cheatsheets, which I format as vim help files.  I put the cheatsheets under vimfiles/bundle/cheatsheets/doc.  Then I call, for example,
:H git-cheatsheet, to pull up my notes. By basing the window width on textwidth, the cheatsheets are not limited to 80 columns.
install details
Put the .vim file to ~/.vim/plugin

Rating scripts is only available on the HTTPS page

script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
VerticalHelp.vim 1.02 2013-10-20 7.0 Mel Davis Sets help window to textwidth, instead of defaulting to 80 columns.
VerticalHelp.vim 1.01 2013-09-25 7.0 Mel Davis Corrected check for windows size and corrected a normal command.
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo