开发者

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.

B开发者_运维技巧T


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.


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


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.


CClookup will do precisely what you want.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜