For Emacs beginners, it's hard to have a suitable Emacs configuration. There are some good popular kits which are helpful for people to use, such as
emacs prelude and
Steven Purcell's emacs.d. This is the note of my configuration and it should be updated frequently.
Why do I want to use Emacs? Because it's fast and efficient. There are tons of pages introducing how useful Emacs can be. In terms of my use of Emacs, it can give you a relatively integral experiences dealing with most of tasks you are facing efficiently.
My Emacs Configuration is based on Steven Purcell's emacs.d 2 project whose framework is clean and clear. Purcell is a web developer so most of his configurations are for web development. I am a robotics guy and I am more interested in different topics. I work on programming a lot with C/C++, Python and MATLAB and also write papers using LaTeX. GitHub and SVN are extremely useful for my development. Plus, email is necessary for everyone. This Emacs configuration is helpful for these things plus some other useful tools which are capable of making your workflow more efficient.
There are three different installation modes: full, text and programming. The default installation mode is full. When selecting text, corresponding configurations and packages about Python, C/C++, MATLAB, ROS, HTML and XML won't be loaded. When selecting programming, corresponding configurations and packages about Markdown, TeX, Email and Blog won't be loaded. Make an option before starting.
- K&R indent style for C/C++ programming;
- Three key-bindings for embedded programming with microcontroller:
C-x C m: make;
C-x C f: make flash;
C-x C c: make clean.
- company-c-headers is configured to enable the completion of C/C++ header file names using Company mode for Emacs and
.emacs.d/cc-mode-header-custom.elcan be used to customize the include paths.
- CEDET Configuration
- Semantic is configured for C/C++ programming. See Semantic in CEDET, for details.
- EDE mode is enabled for C/C++ project and project local variables can be stored in
- cmake-mode, as well as company-cmake, are configured for editing CMake source files.
- Jedi is configured for Python programming and
.emacs.d/jedi-custom.elcan be used to customize Jedi, like adding some special sys.path when starting Jedi server. See Documentation of Jedi, for details;
- IPython is used as Python shell interpreter. See IPython for details;
- autopep8 is required for automatically formatting Python code to conform to the PEP 8 style guide. See autopep8 package for details.
matlab mode package is configured for editing .m-files and launching MATLAB shell.
ROS (Robot Operating System)
- rosemacs is configured for ROS users;
- yaml-mode, nxml-mode and cmake-mode are configured for editing YAML files, XML files and
Org mode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system. 3 Most of my Org mode configurations are from Purcell. Furthermore, I added these following settings:
- MobileOrg is configured to synchronize the contents on a mobile platform with those stored in Dropbox on a computer. Directories can be customized by setting some variables in
- org-bullets is used for Org mode in Emacs to show org-mode bullets as UTF-8 characters;
- Size of heading fonts is customized for better view;
- AUCTeX is configured for writing and formatting TeX files in Emacs. See homepage of AUCTeX for details.
- company-math is configured for math unicode symbols and latex tags completion. See README in company-math for details;
markdown-mode is configured to support Markdown in Emacs. See README in markdown-mode, for details.
Deft is configured to manage my notes in Emacs. See README in Deft for details.
- Notes directory can be customized by setting deft-directory in
C-x N: launch Deft;
C-c n: use Deft to find notes.
- git-blamed, git-messenger and git-timemachine are useful tools for using Git in Emacs;
- Magit is a very power interface to Git in Emacs. See Magit homepage for details;
- gist, github-browse-file, github-clone and some other packages are installed for GitHub in Emacs;
C-x v p: use git-messenger to pop up messages;
C-x g: invoke Magit.
Emacs has built-in version control interface which is pretty nice for SVN. psvn is also installed for using SVN in Emacs. git-svn is recommended for SVN users (see git-svn, for more details).
C-x v d: vc-directory – show all files which are not up to date.
Gnus is configured to be an email client in Emacs. Most of my configurations are from Chen Bin. See this article for details. In addition, I configured BBDB for its new version with company mode for address completion.
- company-mode is configured for completion. See homepage of company-mode for details;
- dired+ and dired-sort are configured to enhance Emacs directory editor;
- iedit is configured to edit multiple regions simultaneously in a buffer or a region. Use
C-c ;to invoke iedit-mode;
- fill-column-indicator is configured to graphically indicates the fill column;
- Flycheck is configured to do syntax checking for Emacs. See homepage of Flycheck for details;
- Flyspell is configured to do spell checking in Emacs. See homepage of Flyspell for details. Use
M-cto correct spelling of the word at a point or a region;
- Default font settings can be found in
init-fonts.el. The sizes of fonts for different operating systems are set differently to ensure the table with Chinese characters in Org mode can be aligned well;
C-x C-bto invoke ibuffer;
- Ivy, Counsel and Swiper are configured. See README in swiper, for details;
- BBDB is used to manage address book for email and gmail2bbdb is installed to import name and email from Gmail contacts into BBDB file;
- MultiTerm is configured to be the interface to the terminal. See Multi Term on Emacs Wiki, for details. Use
C-x Mto invoke multi-term;
- Projectile is configured to manage projects in Emacs. See README in Projectile, for details. Hit
C-c pand wait for a little bit, user can get a menu of Projectile.
- Smex is configured to enhance
- Tramp mode is configured for ssh;
- whitespace-cleanup-mode is installed and whitespace is showed by default;
- YASnippet is configured to be a template system for Emacs. Use
C-c kto expand using YASnippet.
Render by hexo-renderer-org with Emacs 25.2.1 (Org mode 8.2.10)