Skip to content

chen-chao/.emacs.d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Emacs config

This is a simple Emacs config. It starts up quickly and works well in gui and terminal.

It is tested on:

  • GNU/Linux, both in gui and terminal.
  • emacs-nox on Windows Subsystem for Linux.
  • emacs-mac on Mac OS X.

Emacs 26+ is required for thread support(for emacs-wttrin).

Installation

You can use this config by cloning the repo to your home directory(please back up your own config first). Required packages will be installed automatically if you have internet access.

if Emacs complains some packages are not found, please run M-x package-refresh-contents and restart.

Keybindings and Package management

I use Emacs default keybindings. evil is also fantastic, but I’m not an expert of vim now.

To avoid “Emacs pinky”, I switch right ALT with right CTRL(I don’t use it anyway), so I can use right thumb to press CTRL.

Packages are managed by use-package.

Theme

The color theme used in this config is abo-abo/eclipse-theme, which is light background and works quite well both in gui and terminal. The color theme falls back to default dark background with a nice look in emacs-nox(since there is bug displaying emacs on WSL, I use goreliu/wsl-terminal instead of the default terminal).

The config uses emacs-zh-align to config han, kana, cjk-misc and other similar charsets’ font size to make them be compatible with English font size in tabular like environment(org-table, elfeed-search and so on), see emacs-zh-align for details.

Completion

I use ivy as the completion frontend, which is simple and very powerful. A few tips:

  • M-n and M-j in swiper could select and expand text under cursor.
  • M-q could replace the matching candidates.
  • C-M-j is useful when you don’t need the minibuffer completion.

counsel and swiper come along as the interactively command selection and searching tools.

avy is a quick tree-like selection tool. avy-goto-line and avy-goto-char-timer have changed my way to walk through the codes and texts.

company are used as the universal completion backend. There are many packages integrated with company, like company-lsp for lsp mode and company-tabnine for tabnine.

yasnippet provides a code template system, which is simple and powerful. In many cases, yasnippet is always a better choice for template, even when there is a built-in template system in some packages. For example, I thought yasnippet template is easier to use than org mode templates.

Major modes

lsp-mode are used for code highlight, navigation and completion(you have to install the languages tools separately, see lsp-mode#supported-languages):

  • golang(gopls)
  • python(pyls)
  • c/c++/object-c via ccls
  • java via lsp-java

Other support languages or major modes:

  • protobuf
  • markdown
  • yaml
  • octave
  • asymptote, for vector graphic language asymptote.
  • po-mode, for GNU gettext PO files.

Project management

The config uses these packages for project management:

  • magit, a git interface for emacs for version control.
  • projectile, a project interaction library.

Utilities

Some useful and interesting packages:

  • emacs-wttrin for weather report at time.
  • nov-mode for epub reading.

Org mode

Config refile targets, capture templates and html export settings for org mode. Integrate Chinese lunar holidays with org agenda using cal-china-x package.

Finally…

Have fun!

About

my emacs config

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published