Emacs code completion for C/C++? [closed]

混江龙づ霸主 提交于 2019-11-27 05:14:36

问题


  1. Emacs wiki
  2. Xrefactory
  3. CEDET
  4. ?

What can you recommend me ?


回答1:


You can try company-mode. It's a multi-backend in-buffer completion mechanism.
Watch the screencast to get an idea of how it works.

Some of the back-ends are:

  • CEDET Semantic
  • dabbrev
  • XCode
  • PySmell
  • Ropemacs
  • GNU Global

And it's also available via ELPA.




回答2:


You could also use an autocomplete plugin for clang as long as your source compiles with it. links:

  • https://github.com/Golevka/emacs-clang-complete-async
  • https://github.com/brianjcj/auto-complete-clang
  • https://github.com/mikeandmore/auto-complete-clang or
  • the mode which is included in the clang-source: http://llvm.org/svn/llvm-project/cfe/trunk/utils/clang-completion-mode.el



回答3:


GCCSense

From the author of Auto Complete Mode. It uses gcc to find candidates for code completion as the name suggests.




回答4:


CEDET is just great, certainly needs some time at the beginning but worth it though.




回答5:


I tend to use etags.

For emacs integration: http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/etags.html

For how to run etags. http://www.delorie.com/gnu/docs/emacs/etags.1.html

As a bonus, this blog post describes a bit more emacs setup and how to use etags. http://tulrich.com/geekstuff/emacs.html

Edit: To answer the comment, after runnning etags across your code, you can complete words with C-x t(that's what it's bound to on my machine.) Or you can call the tag-search method.




回答6:


to be honest for i like plain old dabbrev-expand (M-/), yes it doesn't use any contextual information other than what characters are adjacent in the open buffers, but on the plus side it doesn't use any contextual information ;) this means you can complete from text you have written first in tests or comments.

for other options http://www.emacswiki.org/emacs/CategoryCompletion




回答7:


When I'm editing python code in Emacs, I like and use pysmell for code completion:

http://code.google.com/p/pysmell/




回答8:


I find that learning how to type fast (and having a decent memory) beats auto completion every time. How far must we go to try and dumb down programming?



来源:https://stackoverflow.com/questions/1285971/emacs-code-completion-for-c-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!