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

qthelp : Allows you to open Qt help pages in browser from your C++ source code.

 script karma  Rating 5/2, Downloaded by 634    Comments, bugs, improvements  Vim wiki

created by
x aizek
script type
This plugin would allow you to open Qt help pages in browser from your C++ source code. Currently it can show help if the word underneath your cursor is a class name, a variable name or a class-member name.


QStr|ing trackTitle, artistName;
QString track|Title, artistName("Unknown");
track|Title = "Unknown";
Running command :QHelpOnThis will open help on QString.

Running command :QHelpOnThis will open help on QString::right.

Running command :QHelp QPixmap::QPixmap will open help on
QPixmap constructor.


g:qthelp_browser - command to run your browser
default: '' (so an error message will be printed if your try to use plugin)
Note: on Windows use something like (notice 'start' at the beginning)
'start c:\\Program files\\Mozilla Firefox\\firefox.exe'
or Vim will be waiting until you close your browser.


1. Make tags-file for your html-qthelp. Addition by DFrank: just go to <Qt-current-version-path>/doc (say, D:/Qt/4.8.4/doc), and run 'ctags -R .'.
2. Add that tags-file into your 'tags' option (WARNING: doing this in your .vimrc file can slow down and pollute completion list for not Qt-projects).
3. Setup g:qthelp_browser variable with the command to run browser.  The value is not escaped, this is up to you, so it's possible to specify parameter list along with command to be executed.  URL is appended to this command after a space.
4. Optionally setup g:qthelp_tags variable with custom value for the 'tags' option, which will be used to look for Qt documentation tags.
5. Map command QHelpOnThis on some hotkey.
6. Use QHelp from command-line for faster navigating through help (to escape manual searching of needed section).


I didn't found a way to determine inheritance hierarchy using tags so trying
QStringList strlst;
will open reference for QString, not for QList::insert.


In some cases it can take a while for searching definition (for example when it doesn't exist) if this happens hit Ctrl-C to break searching.


You may be interesting in inccomplete (vimscript #3345) plugin, that can help to find header file you need.

You could always find the latest version on github: http://github.com/xaizek/vim-qthelp
Feel free to contact me if you have any question or suggestions.
install details
Just extract the archive into your ~/.vim/ or ~/vimfiles/ (~/.vim/bundle/ or ~/vimfiles/bundle/ if you use Pathogen (vimscript #2332)).

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-qthelp-v1.1.6.zip 1.1.6 2013-06-14 7.0 x aizek Fixed support for latest versions of Qt by the :QHelp command (thanks to Dmitry Frank).
Fixed regular expression for filtering help tags (thanks to Dmitry Frank).
Fixed issue with 'shellslash' option on Windows (thanks to Dmitry Frank).
Don't escape g:qthelp_browser on invocation (thanks to Dmitry Frank).
Added g:qthelp_tags option (thanks to Dmitry Frank).
vim-qthelp-v1.1.1.zip 1.1.1 2013-03-09 7.0 x aizek Fixed multiple load guard
Added support for latest versions of Qt (thanks to Dmitry Frank)
vim-qthelp-v1.0.0.zip 1.0.0 2010-12-07 7.0 x aizek Initial upload
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