GNU Emacs as a lightweight IDE

If you have a small project in any of the supported languages, you can get IDE like features without any additional installation in Emacs. Given the CEDET framework, supporting more languages boils down to simply adding a new grammar and overloading few functions.

Presently, it works for the following languages (demo links in brackets):
- C ( Auto-suggest data structure , Auto-suggest basic )
- LaTex ( Auto-suggest )
- SQL ( Auto-suggest from connected DB , Auto-suggest local names and statements )
- Java ( Auto-suggest , Refactoring , Debugging , Type hierarchy, Semantic font-lock , Getter/setter)
- Elisp ( Auto-suggest , Refactoring )


- IDE Basics, Outline view, Rename symbol, Lexer based indent region, Call tree, Semantic font lock

Complete playlist is here.



Config (.emacs):

(global-ede-mode 1)
(semantic-mode 1)    
(srecode-minor-mode 1) 
;; Install company for inline completion with dropdown
(require 'company)
(global-set-key (kbd "M-.") 'semantic-ia-fast-jump)
  • Visit a file in the root of the project. This is typically a Makefile for C or a pom.xml/build.xml for Java projects. If this is the first time you're opening the project, run M-x ede . (Notice: It's assumed that files are under some source control like git.)
  • For Java, you can set classpath using M-x semantic-java-update-classpath. For C, you should add system includes using M-x semantic-c-update-include-path . These are file paths separated by colon.
  • Then you should be able to edit a file in any of the supported languages. First time load of a buffer might lag a bit based on how many includes it has. However, second time onwards, you should have a pleasant experience.
  • Use M-. for jump to definition and M-, to jump back to previous position.
  • Use M-x speedbar-window-mode for outline view.
  • Use M-x semantic-font-lock-mode for semantic font lock.
  • Use M-x srecode-minor-mode for code generation. It provides you menu options to generate variables, functions and classes. Additionally, in java-mode, use M-x getset-dialog for generating getter/setters.
  • Use M-x semantic-symref-symbol for renaming a symbol across files in a project.
  • Use M-x semantic-symref-call-tree for displaying and navigating a function call tree. 


Call tree
Semantic Pre-processor font lock



Popular posts from this blog

Formula Editor in GNU Emacs

Draw and Scribble Notes in GNU Emacs

GNU Emacs: A configurable browser