Simple Emacs for Simple Users
Introduction
GNU Emacs is a beast that cannot be tamed easily. But once you know its workarounds, it will be a place better than heaven. So, I have tried to convert this beast into a puppy that you will love using. If the puppy gets harsh on you then open an issue or send a pull request so that the beast becomes nicer than before.
Target users
This configuration is targeted towards new users who have been using modern editors like Sublime Text and want to see the power of Emacs.
If you are a Vim user then you might want to checkout Spacemacs which has everything setup top to bottom for Vim experience in Emacs.
If you are a power user and you want to squeeze out every functionality out of Emacs then you should go with Spacemacs which has far better support for grouping buffers and different window configurations.
Tested on GNU Emacs development build
It is recommended that you use Emacs development build instead of normal builds.
For Ubuntu:
sudo add-apt-repository ppa:ubuntu-elisp/ppa
sudo apt-get update
sudo apt-get install emacs-snapshotFor Arch Linux:
pacaur -S emacs-gitFor Mac OS:
brew install emacs-mac --with-cocoa --with-xml2 --with-gnutls --with-imagemagick --with-glib --HEADIt is better to compile from source but that is totally upto you.
Installing simple-emacs
If you have been using Emacs from before then backup your configurations:
mv ~/.emacs.d ~/.emacs.d.bak
mv ~/.emacs ~/.emacs.bakClone the simple-emacs repository using git:
git clone https://github.com/Compro-Prasad/simple-emacs.git ~/.emacs.dNow open your Emacs and start doing your stuff.
Some conventions
C-x→ Ctrl + XM-x→ Alt + XC-S-x→ Ctrl + Shift + XC-M-x→ Ctrl + Alt + XM-S-x→ Alt + Shift + x
C-g the Panic key
When you think you pressed the wrong key or Emacs isn’t responding then you can
press C-g to cancel any action.
Creating and opening files
- Press
C-norC-oto open or create a file. Both present you the same interface. - When creating files you need to enter file name first.
- You can use
upanddownto switch between selections. - To get into a directory use
rightkey on the selection. - To get back to previous directory use
leftkey. - You can use
TABto list all possible actions on the selected candidate(s). HitTABagain to hide the actions.
Multiple cursors
Work in progress.
| Select next occurance | M-S-down |
| Select previous occurance | M-S-up |
| Select all occurances | C-; |
| Create cursor with mouse | M-S-click |
Undo and Redo
- To undo a change press
C-zorC-/. - There is no redo in Emacs, so when you use
C-S-zit will open undo tree where you can navigate the undo history usingupanddownkeys. To switch to different undo branch useleftandrightkeys. To quit this state just pressq.
Switching tabs and buffers
- You can switch tabs using
C-TABandC-S-TAB. - To switch buffers use
C-x C-rightandC-x C-left. - You can switch to any buffer in any tab.
- You can list buffers using
C-x bwhich also shows you recently opened files.
Closing tabs and buffers
- You can close tab using
C-wwhich will also kill the buffers in the tab. - To close the tab but not the buffer you may try
C-f4. - To kill the buffer but not the tab you can use
C-x k.
Searching
C-fdoes forward searchC-S-fdoes backward searchC-rsearches in a Git project. If it is not a Git repository then directory is asked first. For it to work in absence of git project install the_silver_searcher:
Ubuntu:
sudo apt install silversearcher-agArch Linux:
sudo pacman -S the_silver_searcherShell
- There are three shells in Emacs:
shell,eshellandterm - Default shell is
eshell - Use
C-lto clear eshell buffer - Pop up, switch or close shell using ~C-‘~
- In Eshell, type use-theme to list and preview available themes
- To customize shell behaviour look into
simple-shell.el
C/C++ setup
Install clang++ on your distro for better experience. To auto compile a single C++ file your file should have:
/*= compile: g++ -std=c++11 -Wall -Werror -o $exe $src =*/
/*= run: $exe =*/at top of your file. To insert this code snippet type compile (in the buffer
and not in the M-x prompt) and hit TAB key.
If you are into competitive programming then you might want to try cp then hit
TAB. For this you may need to create input.txt with program’s input.
Use F9 to run your single file programs.
Preview HTML pages
When you open an HTML file in Emacs you can see its live preview by going to http://localhost:8080/imp/.
Python
To make Emacs a Python IDE, you need to have anaconda_mode installed:
sudo pip2 install anaconda_mode # For python2
sudo pip3 install anaconda_mode # For python3This will enable syntax checking and symbol completion for python files.
- Find definitions using
M-. - Find assignments using
M-* - Find references using
M-r - Jump back to previous location using ~M-,~
- Activate virtual environment using
M-x pyvenv-activate. Enter root directory of the virtual environment as input. - If you are using
pipenvthen you can easily doM-x pipenv-activate.
See official repository for more information on keybindings for jumping to definitions and stuff.
Toggling features
| Keybinding | Feature | Function |
|---|---|---|
C-S-t m | Menu bar | menu-bar-mode |
C-S-t t | Tool bar | tool-bar-mode |
C-S-t l | Line numbers | linum-mode |
C-S-t s | Syntax checking | flycheck-mode |
C-S-t c | Completion | company-mode |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
