This is a minimal, somewhat opinionated Emacs configuration
intended to for VIM users who prefer to build their own init.el
file instead of more heavy weight solutions.
This is the configuration I wish I’d had starting out.
While there are comprehensive Emacs frameworks, people more comfortable maintaining their own configuration may prefer to start of with something smaller they can extend as needed.
In this case it can be hard to know where to start.
Since VIM is quite minimal by default, this aims to provide a setup roughly matching what a developer using VIM might be familiar with.
While evil-mode
on it’s own gives most of Vim’s functionality to Emacs,
there are various additional packages needed for features such as incrementing numbers.
- Minimal: Avoiding complexity in the configuration where possible.
- No faffing about: Packages install on startup.
- Documented: Each entry must justify it’s existence.
Copy .emacs.d
to your home directory, eg:
cp -R ./.emacs.d ~/
While mostly you can use this as VIM clone, there are differences to be aware of.
- Pressing
Alt-X
(often written asM-x
) gives you access to many commands. - Pressing
Ctrl-Z
toggles VIM emulation (if you ever want to, or press this by accident). - Packages can be upgraded by pressing:
M-x
, then typingpackage-utils-upgrade-all-and-recompile
.
Some popular packages have been enabled which don’t have standardized ways of access for VIM or Emacs.
Ctrl-N
: Simple auto-complete based on words in current buffer).Ctrl-Space
: Context sensitive auto-complete (usingcompany-complete
).Ctrl-Plus/Minus
: Zoom in/out.
These have been assigned to the leader key, feel free to change them.
Space, K
: Interactive file-name search.Space, F
: Interactive file-content search (for git repositories).Space, S
: Interactive current-buffer content search.Space, B
: Interactive buffer switching.
These packages are used:
company
: Auto-complete.counsel
: Search.default-font-presets
: Scale all text.evil-numbers
: Additional VIM functionality to increment/decrement numbers.evil-surround
: Additional VIM functionality.evil
: VIM functionality.find-file-in-project
: Project level file navigation.highlight-numbers
: Support for highlighting numbers.diff-hl
Shows changes in the gutter.hl-prog-mode-extra
: Highlight common tags in code-comments, e.g:TODO
,FIXME
,URL's
and email addresses.inkpot-theme
: Theme ported from VIM.ivy
: Interactive completion.package-utils
: Provides functionality to upgrade packages.swiper
: Interactive current-buffer search.undo-fu
: Provides typical undo/redo behavior, without loosing full non-linear undo history.which-key
: Shows available key shortcuts (for leader key).
Functionality not covered here which you might want add yourself.
- A file side-bar.
- A more advanced mode-line.
- File format packages depending on your usage.
These have intentionally been omitted to keep this fairly minimal, and avoid too many opinionated decisions about which packages you’d like to use.
If you have suggestions or corrections, feel free to submit a PR.