Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

My personal emacs settings, and the ones used in @emacsrocks

branch: master

This branch is 0 commits ahead and 0 commits behind master

Octocat-spinner-32 defuns Even smarter newline-dwim December 09, 2013
Octocat-spinner-32 project-archetypes Update yasnippet and get it from melpa August 24, 2013
Octocat-spinner-32 site-lisp Update crappy-jsp-mode and expand-region March 17, 2014
Octocat-spinner-32 snippets Add datomic-snippets June 24, 2013
Octocat-spinner-32 themes Update yasnippet and get it from melpa August 24, 2013
Octocat-spinner-32 users Personal: zombieclj ffip March 10, 2014
Octocat-spinner-32 .gitignore Use ido-at-point August 18, 2013
Octocat-spinner-32 .gitmodules Use https for crappy-jsp-mode too October 07, 2013
Octocat-spinner-32 .mc-lists.el More commands for .mc-lists March 10, 2014
Octocat-spinner-32 README.md Update README September 04, 2013
Octocat-spinner-32 appearance.el Update yasnippet and get it from melpa August 24, 2013
Octocat-spinner-32 custom.el Update yasnippet and get it from melpa August 24, 2013
Octocat-spinner-32 init.el Use smartparens in java-mode February 20, 2014
Octocat-spinner-32 key-bindings.el FFIP for .edn March 10, 2014
Octocat-spinner-32 mac.el Make sure font size remains between frames May 21, 2013
Octocat-spinner-32 mode-mappings.el Use crappy-jsp-mode for html, since it has better indentation March 17, 2014
Octocat-spinner-32 my-misc.el Misc February 05, 2014
Octocat-spinner-32 sane-defaults.el Save minibuffer history between emacs sessions January 11, 2014
Octocat-spinner-32 setup-clojure-mode.el Clojure: Warn about missing nREPL instead of doing stupid things January 11, 2014
Octocat-spinner-32 setup-dired.el Reload dired after dired-do-copy June 24, 2013
Octocat-spinner-32 setup-elnode.el Even less elnode logging please. November 14, 2012
Octocat-spinner-32 setup-ffip.el Ignore more directories in FFIP March 10, 2014
Octocat-spinner-32 setup-flycheck.el Only check flycheck every 30s on clean buffers September 27, 2013
Octocat-spinner-32 setup-hippie.el Complete full-line hippie-expand from end of line March 20, 2013
Octocat-spinner-32 setup-html-mode.el html-mode: M-k to kill attribute March 10, 2014
Octocat-spinner-32 setup-ido.el Update yasnippet and get it from melpa August 24, 2013
Octocat-spinner-32 setup-js2-mode.el Don't mess with kill-ring in js2-stuff November 06, 2013
Octocat-spinner-32 setup-magit.el Don't let flyspell steal C-. in git-commit-mode February 05, 2014
Octocat-spinner-32 setup-markdown-mode.el Add imenu support to markdown files December 17, 2012
Octocat-spinner-32 setup-mu4e.el Update mail from header view with M-u January 02, 2013
Octocat-spinner-32 setup-org.el Set up org-capture January 11, 2014
Octocat-spinner-32 setup-package.el Add @purcell's require-package June 12, 2013
Octocat-spinner-32 setup-paredit.el Do backward-kill-sexp on C-M-<backspace> February 28, 2014
Octocat-spinner-32 setup-perspective.el Move project mappings to my user directory. January 26, 2012
Octocat-spinner-32 setup-rgrep.el Fix C-w in ido-read-directory-name July 18, 2013
Octocat-spinner-32 setup-ruby-mode.el avoid ridiculous ruby indentation March 20, 2013
Octocat-spinner-32 setup-shell.el Correction: mac users still need .profile January 05, 2012
Octocat-spinner-32 setup-skewer.el Add html and css support for skewer May 19, 2013
Octocat-spinner-32 setup-yasnippet.el Update yasnippet and get it from melpa August 24, 2013
README.md

My emacs settings

An ever-changing set of emacs settings. Micro-optimizations are super fun. These are used in the Emacs Rocks screencasts. You can also see some thoughts behind the settings on my What the .emacs.d!?-blog.

Setup

To grab all the dependencies:

git clone --recursive git://github.com/magnars/.emacs.d.git

The first time you start emacs, it will install some additional packages that are best handled by the package manager.

Install emacs on mac

I use Cocoa Emacs, installed like this:

brew install emacs --cocoa

To open it with Alfred or Quicksilver, you have to copy Emacs.app into /Applications instead of the symlink that brew places there.

Tips for using these emacs settings

If you want to use my settings straight out of the box, here are some things to note:

  • I recommend starting with a blank emacs + Technomancy's better-defaults package, and then dig through this repo for useful nuggets, instead of forking it directly.

  • The key bindings are optimized for a norwegian keyboard layout.

  • Start by reading up on all the cool stuff in key-bindings.el.

  • You quit emacs with C-x r q, mnemonic Really Quit.

  • Find file in project with C-x o, in dir with C-x C-f, recent with C-x f

  • Add your user- and project-specific stuff in .emacs.d/users/[machine name]/*.el

  • C-h is rebound to backspace, like in the shell. Get help on F1 instead.

  • Autocomplete with C-. (autocomplete entire lines with C-:)

  • expand-region is your friend. Find its bound key by doing F1 f er/expand-region

  • Undo with C-_ and redo with M-_. Watch the undo-tree with C-x u

  • Quickly jump anywhere in the buffer with C-ø then the starting letter of a word.

  • Indent and clean up white space in the entire buffer with C-c n

  • On a mac, the Meta key M is bound to Command.

  • I recommend rebinding Caps Lock to Ctrl and use that instead of the often badly placed Ctrl-key.

  • Watch emacsrocks.com

Survival guide for the first week of emacs

When you start using emacs for the first time, your habits fight you every inch of the way. Your fingers long for the good old familiar keybindings. Here's an overview of the most commonly used shortcuts to get you through this pain:

  • C Shorthand for the ctrl-key
  • M Shorthand for the meta-key (bound to cmd on my mac settings)
  • S Shorthand for the shift-key

Files

  • C-x C-f Open a file. Starts in the current directory
  • C-x f Open a recently visited file
  • C-x o Open a file in the current project (based on .git ++)
  • C-x C-s Save this file
  • C-x C-w Save as ...
  • C-x C-j Jump to this files' current directory
  • C-x b Switch to another open file (buffer)
  • C-x C-b List all open files (buffers)

Cut copy and paste

  • C-space Start marking stuff. C-g to cancel.
  • C-w Cut (aka kill)
  • C-k Cut till end of line
  • M-w Copy
  • C-y Paste (aka yank)
  • M-y Cycle last paste through previous kills
  • C-x C-y Choose what to paste from previous kills
  • C-@ Mark stuff quickly. Press multiple times

General

  • C-g Quit out of whatever mess you've gotten yourself into
  • M-x Run a command by name
  • C-. Autocomplete
  • C-_ Undo
  • M-_ Redo
  • C-x u Show the undo-tree
  • C-x m Open magit. It's a magical git interface for emacs

Navigation

  • C-arrow Move past words/paragraphs
  • C-a Go to start of line
  • C-e Go to end of line
  • M-g M-g Go to line number
  • C-x C-i Go to symbol
  • C-s Search forward. Press C-s again to go further.
  • C-r Search backward. Press C-r again to go further.

Window management

  • C-x 0 Close this window
  • C-x 1 Close other windows
  • C-x 2 Split window horizontally
  • C-x 3 Split window vertically
  • S-arrow Jump to window to the left/right/up/down

Help

  • F1 t Basic tutorial
  • F1 k Help for a keybinding
  • F1 r Emacs' extensive documentation
Something went wrong with that request. Please try again.