commit 44b2861a8a89aed11078b30e4375935cf5a68c26
parent 86d829ad6c5a645141f46f0ae901e9a17b1a9a8b
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Sat, 12 Apr 2014 13:39:44 +0200
experiment with Emacs+Evil
Diffstat:
4 files changed, 193 insertions(+), 1 deletion(-)
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
@@ -0,0 +1,190 @@
+;; emacs kicker --- kick start emacs setup
+;; Copyright (C) 2010 Dimitri Fontaine
+;;
+;; Author: Dimitri Fontaine <dim@tapoueh.org>
+;; URL: https://github.com/dimitri/emacs-kicker
+;; Created: 2011-04-15
+;; Keywords: emacs setup el-get kick-start starter-kit
+;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/
+;;
+;; This file is NOT part of GNU Emacs.
+
+(require 'cl) ;common lisp goodies, loop
+
+(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
+
+(unless (require 'el-get nil t)
+ (url-retrieve
+ "https://github.com/dimitri/el-get/raw/master/el-get-install.el"
+ (lambda (s)
+ (end-of-buffer)
+ (eval-print-last-sexp))))
+
+;; now either el-get is `require'd already, or have been `load'ed by the
+;; el-get installer.
+
+;; set local recipes
+
+;; now set our own packages
+(setq
+ my:el-get-packages
+ '(el-get ; el-get is self-hosting
+ evil ; extensible vi layer
+ evil-leader ; add <leader> shortcuts
+ evil-surround ; like Tim Pope's surround plugin
+ helm ; Emacs incremental and narrowing framework
+ popup ; visual popup interface library
+ doxymacs ; doxygen integration
+ powerline ; powerline for emacs
+ rainbow-delimiters ; color nested parantheses
+ magit ; emacs mode for git
+ markdown-mode ; emacs mode for markdown
+ org-mode ; emacs mode for org
+ flycheck ; on the fly syntax check
+ auto-complete ; complete as you type with overlays
+ zencoding-mode ; http://www.emacswiki.org/emacs/ZenCoding
+ color-theme ; nice looking emacs
+ color-theme-solarized)) ; check out color-theme-solarized
+
+;;
+;; Some recipes require extra tools to be installed
+;;
+;; Note: el-get-install requires git, so we know we have at least that.
+;;
+;(when (el-get-executable-find "cvs")
+ ;(add-to-list 'my:el-get-packages 'emacs-goodies-el)) ; the debian addons for emacs
+
+(when (el-get-executable-find "svn")
+ (loop for p in '(psvn ; M-x svn-status
+ yasnippet ; powerful snippet mode
+ )
+ do (add-to-list 'my:el-get-packages p)))
+
+(setq my:el-get-packages
+ (append
+ my:el-get-packages
+ (loop for src in el-get-sources collect (el-get-source-name src))))
+
+;; install new packages and init already installed packages
+(el-get 'sync my:el-get-packages)
+
+;; color theme
+(load-theme 'solarized-dark t)
+
+;; customized Vim-like behavior
+(require 'evil)
+(evil-mode 1)
+(require 'powerline)
+(powerline-default-theme)
+
+;; on to the visual settings
+(setq inhibit-splash-screen t) ; no splash screen, thanks
+(line-number-mode 1) ; have line numbers and
+(column-number-mode 1) ; column numbers in the mode line
+
+(tool-bar-mode -1) ; no tool bar with icons
+(scroll-bar-mode -1) ; no scroll bars
+(unless (string-match "apple-darwin" system-configuration)
+ ;; on mac, there's always a menu bar drown, don't have it empty
+ (menu-bar-mode -1))
+
+;; choose your own fonts, in a system dependant way
+(if (string-match "apple-darwin" system-configuration)
+ (set-face-font 'default "Monaco-13") ; os x
+ (set-face-font 'default "termsynu")) ; other
+ ;(set-face-font 'default "Monospace-10"))
+
+(global-hl-line-mode) ; highlight current line
+(global-linum-mode 1) ; add line numbers on the left
+
+;; avoid compiz manager rendering bugs
+(add-to-list 'default-frame-alist '(alpha . 100))
+
+;; copy/paste with C-c and C-v and C-x, check out C-RET too
+(cua-mode)
+
+;; under mac, have Command as Meta and keep Option for localized input
+(when (string-match "apple-darwin" system-configuration)
+ (setq mac-allow-anti-aliasing t)
+ (setq mac-command-modifier 'meta)
+ (setq mac-option-modifier 'none))
+
+;; Use the clipboard, pretty please, so that copy/paste "works"
+(setq x-select-enable-clipboard t)
+
+;; Navigate windows with M-<arrows>
+(windmove-default-keybindings 'meta)
+(setq windmove-wrap-around t)
+
+; winner-mode provides C-<left> to get back to previous window layout
+(winner-mode 1)
+
+;; whenever an external process changes a file underneath emacs, and there
+;; was no unsaved changes in the corresponding buffer, just revert its
+;; content to reflect what's on-disk.
+(global-auto-revert-mode 1)
+
+;; M-x shell is a nice shell interface to use, let's make it colorful. If
+;; you need a terminal emulator rather than just a shell, consider M-x term
+;; instead.
+;(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
+;(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
+
+;; If you do use M-x term, you will notice there's line mode that acts like
+;; emacs buffers, and there's the default char mode that will send your
+;; input char-by-char, so that curses application see each of your key
+;; strokes.
+;;
+;; The default way to toggle between them is C-c C-j and C-c C-k, let's
+;; better use just one key to do the same.
+;(require 'term)
+;(define-key term-raw-map (kbd "C-'") 'term-line-mode)
+;(define-key term-mode-map (kbd "C-'") 'term-char-mode)
+
+;; Have C-y act as usual in term-mode, to avoid C-' C-y C-'
+;; Well the real default would be C-c C-j C-y C-c C-k.
+;(define-key term-raw-map (kbd "C-y") 'term-paste)
+
+;; use ido for minibuffer completion
+;(require 'ido)
+;(ido-mode t)
+;(setq ido-save-directory-list-file "~/.emacs.d/.ido.last")
+;(setq ido-enable-flex-matching t)
+;(setq ido-use-filename-at-point 'guess)
+;(setq ido-show-dot-for-dired t)
+
+;; default key to switch buffer is C-x b, but that's not easy enough
+;;
+;; when you do that, to kill emacs either close its frame from the window
+;; manager or do M-x kill-emacs. Don't need a nice shortcut for a once a
+;; week (or day) action.
+;(global-set-key (kbd "C-x C-b") 'ido-switch-buffer)
+;(global-set-key (kbd "C-x C-c") 'ido-switch-buffer)
+;(global-set-key (kbd "C-x B") 'ibuffer)
+
+;; C-x C-j opens dired with the cursor right on the file you're editing
+;(require 'dired-x)
+
+;; full screen
+;(defun fullscreen ()
+; (interactive)
+; (set-frame-parameter nil 'fullscreen
+; (if (frame-parameter nil 'fullscreen) nil 'fullboth)))
+;(global-set-key [f11] 'fullscreen)
+
+;; Syntax rules
+(setq-default indent-tabs-mode nil)
+(setq-default tab-width 4)
+(setq c-default-style "linux" c-basic-offset 4)
+
+;; Setup modes for files
+(setq auto-mode-alist
+ (append
+ '(("\\.c" . c-mode)
+ ("\\.cpp" . c-mode)
+ ("\\.h" . c-mode)
+ ("\\.cuh" . cuda-mode)
+ ("\\.cu" . cuda-mode)
+ ("\\.m" . matlab-mode))
+ auto-mode-alist)
+ )
diff --git a/.i3/config b/.i3/config
@@ -67,6 +67,7 @@ bindsym $mod+Shift+Return exec i3-sensible-terminal
# other application launchers
#bindsym $mod+b exec uzbl-browser
bindsym $mod+b exec firefox
+bindsym $mod+c exec emacs
bindsym $mod+t exec tor-browser.sh
# mpd control
diff --git a/.zshrc b/.zshrc
@@ -44,6 +44,7 @@ function fname() { find . -iname "*$@*"; }
#[[ -z "$TMUX" ]] && exec tmux
alias svim='sudoedit'
+alias e='emacs -nw'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
diff --git a/create_symlinks.sh b/create_symlinks.sh
@@ -14,7 +14,7 @@ for F in .bashrc .vimrc .inputrc .tmux.conf .xpdfrc .signature .Xresources .Xmod
done
# Home folder dotfolders
-for F in .colors .config/uzbl .config/awesome .config/bspwm .config/sxhkd .config/luakit .config/openbox .config/zathura .i3 .mutt .ncmpcpp .vim .vimperrator .w3m wallpapers; do
+for F in .colors .config/uzbl .config/awesome .config/bspwm .config/sxhkd .config/luakit .config/openbox .config/zathura .i3 .mutt .ncmpcpp .vim .vimperrator .w3m wallpapers .emacs.d; do
SOURCE=$PWD/$F
TARGET=~/$F