BT.in
BT.in

Reputation: 141

emacs c c++ reference document

I am using emacs as C , C++ ide.

I want to configure emacs so I can read C and C++ APIs (reference library) inside emacs.

Please let em know how to do it.

BT

Upvotes: 14

Views: 4808

Answers (6)

stardiviner
stardiviner

Reputation: 1130

Add this code into your emacs config file. this code will add key binding [C-h d] to c-mode and c++-mode.

(dolist (hook
         '(c-mode-hook
           c++-mode-hook))
  (add-hook hook
            (lambda ()
              (local-set-key (kbd "C-h d") 'manual-entry))))

Upvotes: 1

Antoine Pelisse
Antoine Pelisse

Reputation: 13099

CClookup will do precisely what you want.

Upvotes: 1

nenchev
nenchev

Reputation: 2077

Check out the following link, it contains man-pages based on the www.cppreference.com offline archive: https://github.com/jeaye/stdman

After installing, you could use: man std::string or whatever and view the cpp reference directly.

There are also other offline reference formats available here: http://en.cppreference.com/w/Cppreference:Archives

Hope this helps.

Upvotes: 6

jevenus
jevenus

Reputation: 1

I also encountered the same problem as you have and I find an emacs extension for the function which help myself to check the cpp document. its name of the extension is cppref, this is the github address for this package: https://github.com/realfirst/cppref

you can bind a key (e.g. F1) to the function or invoke it via M + cppref. Wish you enjoy it.

Upvotes: 0

kosack
kosack

Reputation: 152

I use the following line in my .emacs file to automatically show a man page for the c function under the cursor when I push F1 (of course it assumes you have the development man pages installed):

(global-set-key  [f1] (lambda () (interactive) (manual-entry (current-word))))

For example on an Ubuntu linux system, the manpages-dev and libstdc++6-4.4-doc packages contain manpages for the C and C++ standard libraries, respectively. Similar packages exist for other systems, including MacOSX

Upvotes: 4

vpit3833
vpit3833

Reputation: 7951

M-x man should work on Linux systems for reading the man pages that are installed in standard locations.

If you install the stl-manual for C++, they come in HTML. You could use M-x w3m-browse-url and pass it the file:///path/to/index.html if you want to read the stl-manuals from inside Emacs.

The info pages explain in detail. M-x info, m emacs, m man page.

Upvotes: 3

Related Questions