One of the things I missed the most when moving from auto-complete to company was the documentation popups that would appear when idling on a completion candidate. This package remedies that situation.
auto-complete uses
popup-el to do its thing
and this results in quite a few glitches. This package uses the much
better pos-tip to display the
popups. I recommend installing pos-tip
using MELPA
which fetches the version of pos-tip
which is located
here.
This version contains a few bugfixes not included in the original on
EmacsWiki.
Since this library relies on pos-tip
, and I prefer libraries that do
one thing well, company-quickhelp
will never be extended with
optional terminal support.
I highly recommend installing company-quickhelp
through package.el
.
It's available on MELPA:
M-x package-install company-quickhelp
To activate company-quickhelp
add the following to your init.el
:
(company-quickhelp-mode)
You can adjust the time it takes for the documentation to pop up by
changing company-quickhelp-delay
.
If you don't want the help popup to appear automatically, but prefer
it to the popup help buffer provided by
company, you can set
company-quickhelp-delay
to nil
and manually trigger the popup with
M-h
.
If you hit M-x customize-group <RET> company-quickhelp <RET>
you'll
find a few variables you can diddle.
For instance, you can change the help popup text background and foreground colors.
You might also want to put this in your init.el
:
(eval-after-load 'company
'(define-key company-active-map (kbd "C-c h") #'company-quickhelp-manual-begin))
This gives you a key to manually trigger the help popup, but only when company is doing its thing.
By default, company-quickhelp
displays the contents of the buffer returned by a doc-buffer
backend call. To override this default, backends should respond to the quickhelp-string
command with a string to display instead of the contents of doc-buffer
.
Yes!