qthelp


Ⅰ. 插件描述

This plugin opens Qt help pages in browser from C++ source code.

Ⅱ. 基本信息

创建日期:  2010-11-28
使用用户:  1
Github星:  2
插件作者:  x aizek

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'xaizek/qthelp'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'xaizek/qthelp'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'xaizek/qthelp'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/xaizek/vim-qthelp

Ⅳ. 文档说明

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.

Examples:

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

trackTitle.ri|ght(10);
Running command :QHelpOnThis will open help on QString::right.

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

Configuring:

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.

Using:

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

Limitation:

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

Warning:

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.

Advice:

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: https://github.com/xaizek/vim-qthelp
Feel free to contact me if you have any question or suggestions.

添加新评论