Commits

Anonymous committed 8bdcf6e

Add new files, get rid of vendor, use use-package everywhere

Comments (0)

Files changed (34)

 syntax: glob
 auto-save-list/*
 backups/*
+dev/*
+elnode/*
 elpa/*
 eshell/history
+eshell/lastdir
+image-dired/*
+misc/*
+semanticdb/*
 server/*
-semanticdb/*
+tmp/*
+url/*
+vendor/*
+.ispell
+.projectile
+ac-comphist.dat
 bookmarks
+calc.el
+commit.bat
+dyneval.el
+ede-projects.el
+mark-multiple.el
 org-clock-save.el
-commit.bat
-url/*
 overlay.el
-mark-multiple.el
-desktop/*
-eshell/lastdir
-files/sunrise-x-w32-addons.vbs
+projectile-bookmarks.eld
+projectile.cache
 tramp
-calc.el
-vendor/smartparens/.git/*
-vendor/yasnippet/yasnippet-debug.el
-vendor/yasnippet/yasnippet-tests.el
-vendor/yasnippet/.git/*
-vendor/yasnippet/.gitignore
-vendor/yasnippet/.gitmodules
-vendor/yasnippet/doc/*
-vendor/yasnippet/README.mdown
-vendor/yasnippet/README.org
-vendor/yasnippet/Rakefile
-ac-comphist.dat
-test.el
-vendor/smartparens.wiki/*
-vendor/smartparens/*
-.ispell
-vendor/markdown-mode/*
-vendor/letcheck/*
-vendor/use-package/.git/*
-vendor/use-package/README.md
-vendor/indicators.el/*
-.projectile
-projectile.cache
-tmp/*
-todo.txt
-image-dired/*
-vendor/keyadvice.el/*
-dev/*
-vendor/clippy.el/*
-vendor/wrap-region/*
-vendor/typoel/*
-vendor/interval-tree/*
-vendor/google-maps/.git/*
-vendor/elxiki/*
-vendor/litable/*
-vendor/elwm/*
-vendor/skeleton-complete/*
-vendor/multifiles.el/*
-elnode/*
-eshell/*
-vendor/workman-layout/*
-vendor/emodal/*
 
 (setq mc/cmds-to-run-for-all
       '(
+        beginning-of-region
+        cua-copy-region
         cua-cut-region
         cua-delete-region
         cua-paste
         end-of-region
         eval-defun
         eval-expression
+        forward-sexp
         haskell-indentation-delete-char
         keyboard-escape-quit
         kill-region
         sp-backward-unwrap-sexp
         sp-backward-up-sexp
         sp-cua-replace-region
+        sp-delete-char
         sp-emit-sexp
         sp-forward-barf-sexp
         sp-forward-sexp
+        sp-forward-slurp-sexp
         sp-join-sexp
+        sp-kill-hybrid-sexp
         sp-kill-sexp
+        sp-kill-word
         sp-remove-active-pair-overlay
         sp-select-next-thing
         sp-select-next-thing-exchange
+;; This file is automatically generated by achievements-mode.el
+;; It keeps track of achievements you've already achieved.
+;; Do not edit it manually, otherwise you'll spoil yourself the fun!
+
+(amode-set-achievement-data-plist "EVIL_MODE" (list :level 3))
+(amode-set-achievement-data-plist "NO_ARROWS" (list :level 1 :data 7))
+(amode-set-achievement-data-plist "CHEATING_BASTARD" (list :level 1))
+(amode-set-achievement-data-plist "TUTORIAL" (list :level 1))
+alias gp git push
+alias gs git status
+alias ff find-file $1
+alias gbva git branch -va
+alias gcb git checkout -b $*
+alias gc git checkout $*
+alias lla ls -la
+alias du1 du --max-depth=1 -h
 alias ga git add $*
-alias du1 du --max-depth=1 -h
-alias lla ls -la
-alias gc git checkout $*
-alias gcb git checkout -b $*
-alias gbva git branch -va
-alias ff find-file $1
-alias asd ad $*
-alias gs git status

files/auto-complete.el

-(require 'auto-complete-config)
-(ac-config-default)
+(use-package auto-complete-config
+  :commands auto-complete-mode
+  :config
+  (progn
+    (ac-config-default)
+    (setq-default ac-sources
+                  (append '(
+                            ac-source-filename
+                            ac-source-yasnippet
+                            )
+                          ac-sources))
 
-(setq-default ac-sources
-              (append '(
-                        ac-source-filename
-                        ac-source-yasnippet
-                        )
-                      ac-sources))
-
-(setq ac-use-menu-map t)
-(bind-key "RET" 'popup-isearch-done popup-isearch-keymap)
+    (setq ac-use-menu-map t)
+    (bind-key "RET" 'popup-isearch-done popup-isearch-keymap)))

files/diminish.el

 (require 'diminish)
-(diminish 'yas-minor-mode)
 (diminish 'undo-tree-mode)
 (diminish 'visual-line-mode)
-(diminish 'skeleton-complete-mode "SC")
 (diminish 'smartparens-mode)
 (eval-after-load "eldoc"
   '(diminish 'eldoc-mode " δ"))
   '(diminish 'reftex-mode))
 (eval-after-load "emmet-mode"
   '(diminish 'emmet-mode))
+(eval-after-load "skeleton-complete"
+  '(diminish 'skeleton-complete-mode))
+(eval-after-load "golden-ratio"
+  '(diminish 'golden-ratio-mode))

files/dired-setup.el

 ;; see commentary in dired-defs.el
 (use-package dired
-  :bind ("C-x d" . my-dired-files)
+  :bind (("C-x d"  . my-dired-files)
+         ("M-<f2>" . my-find-dired))
   :init
   (progn
     (defun my-dired-files (&optional arg)
         (ido-dired))))
   :config
   (progn
-    (load "files/dired-defs")
-
-    ))
+    (load "files/dired-defs")))

files/emacs-custom.el

  '(ansi-color-names-vector ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#ad7fa8" "#8cc4ff" "#eeeeec"])
  '(background-color "#002b36")
  '(background-mode dark)
+ '(backup-directory-alist (quote (("." . "~/.emacs.d/backups"))))
  '(blink-cursor-mode nil)
  '(blink-matching-paren nil)
  '(bmkp-last-as-first-bookmark-file "~/.emacs.d/bookmarks")
  '(browse-kill-ring-quit-action (quote save-and-restore))
  '(bs-configurations (quote (("all" nil nil nil nil nil) ("files" nil nil nil bs-visits-non-file bs-sort-buffer-interns-are-last) ("files-and-scratch" "^\\*scratch" nil nil bs-visits-non-file bs-sort-buffer-interns-are-last) ("all-intern-last" nil nil nil nil bs-sort-buffer-interns-are-last) ("dired" nil (lambda (b) (with-current-buffer b (eq major-mode (quote dired-mode)))) nil (lambda (b) t) nil))))
  '(calc-settings-file "~\\.emacs.d\\my-calc.el")
+ '(calendar-week-start-day 1)
  '(cua-enable-cua-keys nil)
  '(cursor-color "#839496")
  '(custom-enabled-themes (quote (my-tango-dark)))
  '(custom-theme-directory "~/.emacs.d/themes/")
  '(cycbuf-buffer-sort-function (quote cycbuf-sort-by-recency))
  '(debug-on-error t)
+ '(delete-by-moving-to-trash t)
  '(desktop-buffer-filter (quote my-desktop-filter))
  '(desktop-save t)
  '(dired-dwim-target t)
  '(dired-listing-switches "-alh")
  '(dired-omit-extensions (quote (".o" "~" ".bin" ".bak" ".obj" ".map" ".ico" ".pif" ".lnk" ".a" ".ln" ".blg" ".bbl" ".dll" ".drv" ".vxd" ".386" ".elc" ".lof" ".glo" ".idx" ".lot" ".svn/" ".hg/" ".git/" ".bzr/" "CVS/" "_darcs/" "_MTN/" ".fmt" ".tfm" ".class" ".fas" ".lib" ".mem" ".x86f" ".sparcf" ".dfsl" ".pfsl" ".d64fsl" ".p64fsl" ".lx64fsl" ".lx32fsl" ".dx64fsl" ".dx32fsl" ".fx64fsl" ".fx32fsl" ".sx64fsl" ".sx32fsl" ".wx64fsl" ".wx32fsl" ".fasl" ".ufsl" ".fsl" ".dxl" ".lo" ".la" ".gmo" ".mo" ".toc" ".aux" ".cp" ".fn" ".ky" ".pg" ".tp" ".vr" ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs" ".pyc" ".pyo" ".idx" ".lof" ".lot" ".glo" ".blg" ".bbl" ".cp" ".cps" ".fn" ".fns" ".ky" ".kys" ".pg" ".pgs" ".tp" ".tps" ".vr" ".vrs" ".log" ".ilg" ".out" ".ind" ".dsc")))
+ '(display-time-24hr-format t)
+ '(display-time-format "%H:%M ")
+ '(display-time-mode t)
+ '(display-time-string-forms (quote ((if (and (not display-time-format) display-time-day-and-date) (format-time-string "%a %b %e " now) "") (propertize (format-time-string (or display-time-format (if display-time-24hr-format "%H:%M" "%-I:%M%p")) now) (quote help-echo) (format-time-string "%a %b %e, %Y" now)) (if mail (concat " " (propertize display-time-mail-string (quote display) (\` (when (and display-time-use-mail-icon (display-graphic-p)) (\,@ display-time-mail-icon) (\,@ (if (and display-time-mail-face (memq (plist-get (cdr display-time-mail-icon) :type) (quote (pbm xbm)))) (let ((bg (face-attribute display-time-mail-face :background))) (if (stringp bg) (list :background bg))))))) (quote face) display-time-mail-face (quote help-echo) "You have new mail; mouse-2: Read mail" (quote mouse-face) (quote mode-line-highlight) (quote local-map) (make-mode-line-mouse-map (quote mouse-2) read-mail-command))) ""))))
  '(echo-keystrokes 0.1)
  '(ediff-merge-split-window-function (quote split-window-vertically))
  '(ediff-window-setup-function (quote ediff-setup-windows-plain))
+ '(eldoc-eval-preferred-function (quote eval-expression))
+ '(eldoc-in-minibuffer-mode t)
+ '(emmet-indentation 2)
  '(emmet-preview-default nil)
  '(erc-autojoin-channels-alist (quote (("chat.freenode.org" "#emacs" "##latin"))))
  '(erc-away-timestamp-format "<%H:%M:%S>")
  '(eshell-prompt-regexp "^[^#$
 ]*>[#$] ")
  '(exec-path (quote ("d:/progs/perl/perl/site/bin/" "d:/progs/perl/perl/bin/" "d:/progs/gnuutils/bin/" "c:/Program Files (x86)/NVIDIA Corporation/PhysX/Common" "C:/Windows/system32" "C:/Windows" "C:/Windows/System32/Wbem" "C:/Windows/System32/WindowsPowerShell/v1.0/" "d:/progs/MiKTeX/miktex/bin/" "D:/progs/Git/cmd" "D:/progs/TortoiseHg/" "d:/progs/Aspell/bin/" "C:/Users/Matus/AppData/Roaming/MiKTeX/2.9/miktex/bin/" "d:/progs/emacs-24.1/bin")))
+ '(flx-ido-mode t)
  '(font-latex-math-environments (quote ("display" "displaymath" "equation" "eqnarray" "gather" "multline" "align" "alignat" "xalignat" "derivation")))
  '(font-latex-quotes (quote auto))
  '(foreground-color "#839496")
+ '(gc-cons-threshold 20000000)
+ '(global-flex-isearch-mode t)
  '(global-linum-mode nil)
  '(global-undo-tree-mode t)
  '(golden-ratio-exclude-buffer-names (quote ("*helm kill-ring*")))
+ '(golden-ratio-extra-commands (quote (windmove-left windmove-right windmove-down windmove-up)))
+ '(golden-ratio-inhibit-functions nil)
+ '(golden-ratio-mode t)
  '(haskell-mode-hook (quote (turn-on-haskell-indentation turn-on-haskell-doc-mode)))
  '(haskell-program-name "d:\\progs\\HaskellPlatform\\bin\\ghci.exe")
  '(ibuffer-fontification-alist (quote ((10 buffer-read-only font-lock-constant-face) (15 (and buffer-file-name (string-match ibuffer-compressed-file-name-regexp buffer-file-name)) font-lock-doc-face) (20 (string-match "^*" (buffer-name)) font-lock-keyword-face) (25 (and (string-match "^ " (buffer-name)) (null buffer-file-name)) italic) (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) (35 (memq major-mode (quote (dired-mode sr-mode))) font-lock-function-name-face))))
- '(ibuffer-saved-filter-groups (quote (("default" ("Org" (mode . org-mode)) ("emacs-config" (or (predicate let ((bfn (buffer-file-name (current-buffer)))) (when bfn (and (string-match-p "\\.emacs\\.d" bfn) (eq major-mode (quote emacs-lisp-mode))))))) ("emacs" (or (mode . emacs-lisp-mode) (mode . lisp-interaction-mode) (mode . inferior-emacs-lisp-mode))) ("TeX" (or (mode . tex-mode) (mode . plain-tex-mode) (mode . latex-mode))) ("Markdown" (or (mode . markdown-mode) (mode . gfm-mode))) ("Web" (or (mode . html-mode) (mode . css-mode) (mode . php-mode) (mode . js-mode))) ("Dired" (mode . dired-mode)) ("Images" (or (mode . image-dired-display-image-mode) (mode . image-dired-thumbnail-mode) (mode . image-mode))) ("Tramp" (or (name . "tramp"))) ("Programming" (or (mode . c-mode) (mode . perl-mode) (mode . python-mode) (mode . cc-mode)))))) t)
+ '(ibuffer-saved-filter-groups (quote (("default" ("Org" (mode . org-mode)) ("emacs-config" (or (predicate let ((bfn (buffer-file-name (current-buffer)))) (when bfn (and (string-match-p "\\.emacs\\.d" bfn) (eq major-mode (quote emacs-lisp-mode))))))) ("emacs" (or (mode . emacs-lisp-mode) (mode . lisp-interaction-mode) (mode . inferior-emacs-lisp-mode))) ("TeX" (or (mode . tex-mode) (mode . plain-tex-mode) (mode . latex-mode))) ("Markdown" (or (mode . markdown-mode) (mode . gfm-mode))) ("Web" (or (mode . html-mode) (mode . css-mode) (mode . php-mode) (mode . js-mode))) ("Dired" (mode . dired-mode)) ("Images" (or (mode . image-dired-display-image-mode) (mode . image-dired-thumbnail-mode) (mode . image-mode))) ("Tramp" (or (name . "tramp"))) ("Programming" (or (mode . c-mode) (mode . perl-mode) (mode . python-mode) (mode . cc-mode)))))))
  '(ibuffer-saved-filters (quote (("irc" ((mode . erc-mode))) ("dipl" ((filename . "_dipl"))) ("gnus" ((or (mode . message-mode) (mode . mail-mode) (mode . gnus-group-mode) (mode . gnus-summary-mode) (mode . gnus-article-mode)))) ("programming" ((or (mode . emacs-lisp-mode) (mode . cperl-mode) (mode . c-mode) (mode . java-mode) (mode . idl-mode) (mode . lisp-mode)))))))
  '(ibuffer-show-empty-filter-groups nil)
  '(ibuffer-truncate-lines nil)
+ '(ido-default-buffer-method (quote selected-window))
+ '(ido-enable-flex-matching t)
+ '(ido-enable-last-directory-history nil)
+ '(ido-everywhere t)
+ '(ido-max-directory-size 100000)
+ '(ido-mode (quote both) nil (ido))
  '(ido-show-dot-for-dired t)
  '(ido-ubiquitous-command-compatibility-exceptions (quote (ibuffer-switch-to-saved-filter-groups)))
  '(ido-ubiquitous-command-exceptions (quote (smex-major-mode-commands beautify-smex ido-goto-symbol grep-read-files diredp-dired-files)))
  '(ido-ubiquitous-enable-compatibility t)
  '(ido-ubiquitous-function-exceptions (quote (diredp-dired-files-interactive-spec)))
  '(ido-ubiquitous-mode t)
+ '(ido-use-faces t)
  '(image-dired-cmd-create-temp-image-options "%p -size %wx%h \"%f\" -sample \"%wx%h>\" -strip jpeg:\"%t\"")
  '(image-dired-cmd-create-thumbnail-options "%p -size %wx%h \"%f\" -resize \"%wx%h>\" -strip jpeg:\"%t\"")
  '(imenu-auto-rescan t)
  '(indicate-empty-lines nil)
+ '(inhibit-startup-screen t)
  '(ispell-personal-dictionary "~/.emacs.d/.ispell")
  '(ispell-program-name "d:\\progs\\Aspell\\bin\\aspell.exe")
+ '(keyfreq-autosave-mode t)
+ '(keyfreq-mode t)
  '(linum-format "%3s|")
  '(ls-lisp-dirs-first t)
  '(ls-lisp-verbosity nil)
  '(magit-diff-refine-hunk (quote all))
  '(markdown-link-space-sub-char "-")
  '(max-lisp-eval-depth 50000)
+ '(message-log-max 10000)
  '(mouse-highlight nil)
+ '(multi-web-global-mode nil nil (multi-web-mode))
+ '(mweb-default-major-mode (quote html-mode))
+ '(org-cycle-emulate-tab nil)
+ '(org-emphasis-alist (quote (("*" markdown-bold-face "<b>" "</b>") ("/" markdown-italic-face "<i>" "</i>") ("_" underline "<span style=\"text-decoration:underline;\">" "</span>") ("=" org-code "<code>" "</code>" verbatim) ("~" org-verbatim "<code>" "</code>" verbatim) ("+" (:strike-through t) "<del>" "</del>"))))
+ '(org-src-fontify-natively t)
+ '(predictive-add-to-dict-ask nil)
+ '(predictive-auto-add-to-dict t)
+ '(predictive-auto-learn t)
+ '(predictive-use-auto-learn-cache nil)
  '(preview-gs-command "d:\\progs\\gs9.06\\bin\\gswin64c.exe")
  '(preview-scale-function 1.8)
+ '(projectile-global-mode t)
+ '(projectile-globally-ignored-directories (quote (".idea" ".eunit" ".git" ".hg" ".fslckout" ".bzr" "_darcs" "elpa")))
+ '(projectile-project-root-files (quote (".dir-locals.el" ".projectile" ".git" ".hg" ".fslckout" ".bzr" "_darcs" "rebar.config" "project.clj" "pom.xml" "build.sbt" "Gemfile" "Makefile")))
  '(reftex-label-alist (quote (("lemma" 101 nil nil t nil))))
- '(safe-local-variable-values (quote ((eval font-lock-add-keywords nil (quote (("(\\(dm-defun\\)\\(?:\\s-\\)+\\(\\_<.*?\\_>\\)" (1 font-lock-keyword-face) (2 font-lock-function-name-face))))) (eval font-lock-add-keywords nil (quote (("defexamples\\| => " (0 (quote font-lock-keyword-face)))))) (reftex-default-bibliography "./bibliography") (eval allout-mode t))))
+ '(safe-local-variable-values (quote ((eval font-lock-add-keywords nil (\` (((\, (concat "(" (regexp-opt (quote ("sp-do-move-op" "sp-do-move-cl" "sp-do-put-op" "sp-do-put-cl" "sp-do-del-op" "sp-do-del-cl")) t) "\\_>")) 1 (quote font-lock-variable-name-face))))) (TeX-master . main) (eval font-lock-add-keywords nil (quote (("(\\(dm-defun\\)\\(?:\\s-\\)+\\(\\_<.*?\\_>\\)" (1 font-lock-keyword-face) (2 font-lock-function-name-face))))) (eval font-lock-add-keywords nil (quote (("defexamples\\| => " (0 (quote font-lock-keyword-face)))))) (reftex-default-bibliography "./bibliography") (eval allout-mode t))))
+ '(save-place t nil (saveplace))
  '(send-mail-function (quote mailclient-send-it))
  '(shell-pop-autocd-to-working-dir t)
  '(shell-pop-shell-type (quote ("eshell" "*eshell*" (lambda nil (eshell)))))
  '(shell-pop-universal-key "<f11>")
  '(shell-pop-window-height 50)
+ '(show-smartparens-global-mode t)
+ '(smartparens-global-mode t)
+ '(smartparens-global-strict-mode t)
  '(sp-autoescape-string-quote-if-empty (quote (python-mode)))
  '(sp-autoinsert-if-followed-by-same 3)
- '(sp-autoinsert-if-followed-by-word t)
  '(sp-autoinsert-quote-if-followed-by-closing-pair nil)
  '(sp-autoskip-closing-pair (quote always))
  '(sp-autowrap-region t)
+ '(sp-hybrid-kill-excessive-whitespace nil)
  '(sp-ignore-modes-list (quote (image-dired-display-image-mode image-dired-thumbnail-mode ediff-mode recentf-dialog-mode)))
  '(sp-navigate-close-if-unbalanced t)
  '(sp-navigate-comments-as-sexps t)
  '(sp-navigate-consider-sgml-tags (quote (html-mode)))
- '(sp-navigate-consider-stringlike-sexp (quote (latex-mode gfm-mode emacs-lisp-mode html-mode)))
+ '(sp-navigate-consider-stringlike-sexp (quote (ruby-mode latex-mode gfm-mode emacs-lisp-mode html-mode org-mode python-mode)))
  '(sp-navigate-consider-symbols t)
  '(sp-navigate-reindent-after-up (quote ((interactive emacs-lisp-mode))))
  '(sp-override-key-bindings nil)
  '(text-mode-hook (quote (text-mode-hook-identify)))
  '(transient-mark-mode t)
  '(truncate-partial-width-windows nil)
+ '(uniquify-buffer-name-style (quote forward) nil (uniquify))
+ '(vc-make-backup-files t)
+ '(visible-bell t)
  '(w3m-command "c:\\cygwin\\bin\\w3m.exe")
- '(w3m-imagick-convert-program "c:\\cygwin\\bin\\convert.exe"))
+ '(w3m-imagick-convert-program "c:\\cygwin\\bin\\convert.exe")
+ '(winner-mode t))
 (custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  '(diredp-write-priv ((t nil)))
  '(eldoc-highlight-function-argument ((t (:inherit bold :foreground "#4e9a06"))))
  '(erc-nick-default-face ((t (:inherit erc-default))))
- '(eshell-prompt ((t (:foreground "#73d216" :weight normal))))
+ '(eshell-prompt ((t (:foreground "#73d216" :weight normal))) t)
  '(font-latex-sedate-face ((t (:inherit font-lock-keyword-face))))
  '(header-line ((t (:inherit mode-line))))
  '(my-diredp-sourcefile-face ((t (:foreground "#fcaf3e"))))
  '(my-hide-prefix ((t (:underline "#888a85"))))
+ '(org-block ((t (:inherit shadow :family "Consolas"))))
+ '(org-code ((t (:inherit markdown-pre-face))))
+ '(org-formula ((t (:inherit fixed-pitch :foreground "chocolate1"))))
+ '(org-mode-line-clock ((t nil)) t)
  '(sp-pair-overlay-face ((t (:background "#004a5d"))))
  '(w3m-anchor ((t (:foreground "#729fcf"))))
  '(w3m-arrived-anchor ((t (:inherit font-lock-builtin-face)))))

files/eshell-mode.el

+(use-package eshell
+  :commands eshell
+  :config
+  (progn
+    ;;;; git config
+    (defun my--get-git-branches (&optional all)
+      (let ((branches (-map 'car (magit-list-interesting-refs))))
+        (if all
+            branches
+          (--filter (not (string-match-p "/" it)) branches))))
+
+    (defun pcomplete/eshell-mode/gc ()
+      (pcomplete-here (my--get-git-branches)))
+
+    (defun pcomplete/eshell-mode/git ()
+      (pcomplete-here '("add"
+                        "bisect"
+                        "branch"
+                        "checkout"
+                        "clone"
+                        "commit"
+                        "diff"
+                        "fetch"
+                        "grep"
+                        "init"
+                        "log"
+                        "merge"
+                        "mv"
+                        "pull"
+                        "push"
+                        "rebase"
+                        "remote"
+                        "reset"
+                        "rm"
+                        "show"
+                        "status"
+                        "tag"))
+      (pcomplete-here
+       (let ((last-cmd (nth (1- pcomplete-last) pcomplete-args)))
+         (cond
+          ((equal "checkout" last-cmd)
+           (my--get-git-branches))
+          ((equal "add" last-cmd)
+           (pcomplete-entries))
+          ((equal "merge" last-cmd)
+           (my--get-git-branches t))))))
+
+    ;;;; hg config
+
+    (defun pcomplete/eshell-mode/hg ()
+      (pcomplete-here '("add"
+                        "annotate"
+                        "clone"
+                        "commit"
+                        "diff"
+                        "export"
+                        "forget"
+                        "init"
+                        "log"
+                        "merge"
+                        "pull"
+                        "push"
+                        "remove"
+                        "serve"
+                        "status"
+                        "summary"
+                        "update")))))
-;;; Global settings
-;;; Generic emacs settings I cannot live without
-
-;; Winner mode
-;; C-c left C-c right switch between window configurations, M-arrows to jump between windows
-(when (fboundp 'winner-mode)
-  (winner-mode 1))
-
-;; Don't show the startup screen
-(setq inhibit-startup-message t)
-
 ;; "y or n" instead of "yes or no"
 (fset 'yes-or-no-p 'y-or-n-p)
 
-;; Highlight regions and add special behaviors to regions.
-;; "C-h d transient" for more info
-(setq transient-mark-mode t)
-
-;; Display line and column numbers
-(setq line-number-mode    t)
-(setq column-number-mode  t)
-
-;; Modeline info
-(display-time-mode 1)
-;; (display-battery-mode 1)
-
 ;; Small fringes
 (set-fringe-mode '(1 . 1))
 
-;; Explicitly show the end of a buffer
-(set-default 'indicate-empty-lines t)
-
-;; Prevent the annoying beep on errors
-(setq visible-bell t)
-
-;; Make sure all backup files only live in one place
-(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
-
-;; Make backups of files, even when they're in version control
-(setq vc-make-backup-files t)
-
 ;; Don't truncate lines
 (setq truncate-lines t)
 (setq truncate-partial-width-windows nil)
 (add-hook 'before-save-hook 'cleanup-buffer-safe)
 (add-hook 'before-save-hook 'my-create-directory-on-save)
 
-;; Trash can support
-(setq delete-by-moving-to-trash t)
-
-;; Syntax hilight
-(global-font-lock-mode t)
-(setq font-lock-maximum-decoration t)
-
 ;; UTF
 (setq locale-coding-system 'utf-8)
 (set-terminal-coding-system 'utf-8)
 (set-selection-coding-system 'utf-8)
 (prefer-coding-system 'utf-8)
 
-(setq calendar-week-start-day 1)
-
-(setq message-log-max 10000)
-
 ;; cua-selection-mode for all the goodies ;)
 (cua-selection-mode t)
 
 (setq edebug-inhibit-emacs-lisp-mode-bindings t)
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Some text-mode settings
 
-;; turn on visual-line-mode for text-mode major mode
-;; (add-hook 'text-mode-hook 'turn-on-visual-line-mode)
-
 (setq-default cursor-type 'box)
-;; variable width font in text buffers ...
 (dolist (hook '(LaTeX-mode-hook
                 org-mode-hook
                 markdown-mode-hook
   (interactive)
   (setq buffer-face-mode-face '(:family "Verdana" :height 120))
   (buffer-face-mode))
+
 ;; Use monospaced font faces in current buffer
 (defun my-buffer-face-mode-fixed ()
   "Sets a fixed width (monospace) font in current buffer"
   (setq cursor-type 'bar)
   (setq indent-tabs-mode t)
   (turn-on-visual-line-mode))
-
-;; hack to make nicer format in keyfreq-show
-(eval-after-load 'keyfreq
-  '(progn
-     (defun keyfreq-format-list (list &optional func)
-       "Returns formatted string with command usage statistics.
-
-The LIST is the `keyfreq-table' converted to a list using the `keyfreq-list'.
-
-If FUNC is nil each line contains number of times command was
-called and the command; if it is t percentage usage is added in
-the middle; if it is 'raw each line will contain number an
-command separated by single line (with no formatting) otherwise
-FUNC must be a function returning a string which will be called
-for each entry with three arguments: number of times command was
-called, percentage usage and the command."
-       (let* ((sum (car list)))
-         (mapconcat
-          (cond
-           ((not func) (lambda (e) (format "%7d  %s\n" (cdr e) (car e))))
-           ((equal func t)
-            (lambda (e) (format "%7d  %6.2f%% %10s %s\n"
-                                (cdr e) (/ (* 1e2 (cdr e)) sum) (key-description (where-is-internal (car e) nil t)) (car e))))
-           ((equal func 'raw) (lambda (e) (format "%d %s\n" (cdr e) (car e))))
-           (t (lambda (e) (funcall func (cdr e) (/ (* 1e2 (cdr e)) sum) (car e)))))
-          (cdr list) "")))))

files/ibuffer-config.el

+(use-package ibuffer
+  :bind ("<f1> <f1>" . ibuffer)
+  :init
+  (progn
+    ;; startup function
+    (defun customize-ibuffer-mode ()
+      "Startup function."
+      (ibuffer-switch-to-saved-filter-groups "default")
+      (add-to-list 'ibuffer-hidden-filter-groups "Tramp")
+      (add-to-list 'ibuffer-hidden-filter-groups "emacs-elpa")
+      (visual-line-mode -1)
+      (toggle-truncate-lines 1))
+    (add-hook 'ibuffer-mode-hook 'customize-ibuffer-mode))
+  :config
+  (progn
+    (bind-key "M-o" 'elwm-activate-window ibuffer-mode-map)
+
+    ;; filter groups
+    (setq ibuffer-saved-filter-groups
+          (quote (("default"
+                   ("Org" ;; all org-related buffers
+                    (mode . org-mode))
+                   ("emacs-elpa"
+                    (or (predicate
+                         .
+                         (let ((bfn (buffer-file-name (current-buffer))))
+                           (when bfn
+                             (and (string-match-p "\\.emacs\\.d/elpa" bfn)
+                                  (eq major-mode 'emacs-lisp-mode)))))))
+                   ("emacs-config"
+                    (or (predicate
+                         .
+                         (let ((bfn (buffer-file-name (current-buffer))))
+                           (when bfn
+                             (and (string-match-p "\\.emacs\\.d" bfn)
+                                  (eq major-mode 'emacs-lisp-mode)))))))
+                   ("emacs"
+                    (or (mode . emacs-lisp-mode)
+                        (mode . lisp-interaction-mode)
+                        (mode . inferior-emacs-lisp-mode)))
+                   ("TeX"
+                    (or (mode . tex-mode)
+                        (mode . plain-tex-mode)
+                        (mode . latex-mode)))
+                   ("Markdown" (or (mode . markdown-mode)
+                                   (mode . gfm-mode)))
+                   ("Web"
+                    (or (mode . html-mode)
+                        (mode . css-mode)
+                        (mode . php-mode)
+                        (mode . js-mode)))
+                   ("Dired"
+                    (mode . dired-mode))
+                   ("Langs"
+                    (or (predicate
+                         .
+                         (let ((bfn (buffer-file-name (current-buffer))))
+                           (when bfn
+                             (string-match-p "d:/languages" bfn))))))
+                   ("Images"
+                    (or (mode . image-dired-display-image-mode)
+                        (mode . image-dired-thumbnail-mode)
+                        (mode . image-mode)))
+                   ("Tramp"
+                    (or (name . "tramp")))
+                   ("Programming" ;; prog stuff not already in MyProjectX
+                    (or
+                     (mode . c-mode)
+                     (mode . perl-mode)
+                     (mode . python-mode)
+                     (mode . cc-mode)
+                     ;; etc
+                     ))
+                   ("IRC"
+                    (or (mode . erc-mode)))
+                   ))))
+
+    ;; (define-ibuffer-filter in-directory
+    ;;   "Toggle current view to buffers whose default-directory is in QUALIFIER."
+    ;;   (:description "in-directory"
+    ;;    :reader (read-directory-name "Directory: "))
+    ;;   (with-current-buffer buf (file-in-directory-p default-directory qualifier)))
+
+    (define-ibuffer-column size-h
+      (:name "Size"
+             :inline t
+             :summarizer
+             (lambda (column-strings)
+               (let ((total 0))
+                 (dolist (string column-strings)
+                   (setq total
+                         ;; like, ewww ...
+                         (+
+                          (let ((number (float (string-to-number string))))
+                            (cond
+                             ((string-match-p "K" string)
+                              (* number 1000))
+                             ((string-match-p "M" string)
+                              (* number 1000000))
+                             (t number)))
+                          total)))
+                 (file-size-human-readable total 'si))))
+      (file-size-human-readable (buffer-size) 'si))
+
+    ;; Modify the default ibuffer-formats
+    (setq ibuffer-formats
+          '((mark modified vc-status-mini read-only
+                  " " (name 25 25 :left :elide)
+                  " " (size-h 9 -1 :right)
+                  " " (mode 16 16 :left :elide)
+
+                  " " filename-and-process)
+            (mark " " (name 16 -1)
+                  " " filename)))
+
+    ;; Switching to ibuffer puts the cursor on the most recent buffer
+    (defadvice ibuffer (around ibuffer-point-to-most-recent activate) ()
+      "Open ibuffer with cursor pointed to most recent buffer name"
+      (let ((recent-buffer-name (buffer-name)))
+        ad-do-it
+        (ibuffer-jump-to-buffer recent-buffer-name)))))
-;;; Interactive do, find-file and iswitchb replacement with fuzzy/flex matching.
+(use-package ido
+  :bind (("M-." . ido-goto-symbol) ;; was Find tag
+         )
+  :config
+  (progn
+    (require 'flx-ido)
 
-(require 'ido)
-(require 'flx-ido)
+    ;; Display ido results vertically, rather than horizontally
+    (setq ido-decorations (quote ("\n-> " "" "\n   " "\n   ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
+    (defun ido-disable-line-trucation () (set (make-local-variable 'truncate-lines) nil))
+    (add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-trucation)
 
-;; Display ido results vertically, rather than horizontally
-(setq ido-decorations (quote ("\n-> " "" "\n   " "\n   ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
-(defun ido-disable-line-trucation () (set (make-local-variable 'truncate-lines) nil))
-(add-hook 'ido-minibuffer-setup-hook 'ido-disable-line-trucation)
+    ;; see: http://emacswiki.org/emacs/InteractivelyDoThings#toc25
+    (defun ido-smart-select-text ()
+      "Select the current completed item.  Do NOT descend into directories."
+      (interactive)
+      (when (and (or (not ido-require-match)
+                     (if (memq ido-require-match
+                               '(confirm confirm-after-completion))
+                         (if (or (eq ido-cur-item 'dir)
+                                 (eq last-command this-command))
+                             t
+                           (setq ido-show-confirm-message t)
+                           nil))
+                     (ido-existing-item-p))
+                 (not ido-incomplete-regexp))
+        (when ido-current-directory
+          (setq ido-exit 'takeprompt)
+          (unless (and ido-text (= 0 (length ido-text)))
+            (let ((match (ido-name (car ido-matches))))
+              (throw 'ido
+                     (setq ido-selected
+                           (if match
+                               (replace-regexp-in-string "/\\'" "" match)
+                             ido-text)
+                           ido-text ido-selected
+                           ido-final-text ido-text)))))
+        (exit-minibuffer)))
 
-;; see: http://emacswiki.org/emacs/InteractivelyDoThings#toc25
-(defun ido-smart-select-text ()
-  "Select the current completed item.  Do NOT descend into directories."
-  (interactive)
-  (when (and (or (not ido-require-match)
-                 (if (memq ido-require-match
-                           '(confirm confirm-after-completion))
-                     (if (or (eq ido-cur-item 'dir)
-                             (eq last-command this-command))
-                         t
-                       (setq ido-show-confirm-message t)
-                       nil))
-                 (ido-existing-item-p))
-             (not ido-incomplete-regexp))
-    (when ido-current-directory
-      (setq ido-exit 'takeprompt)
-      (unless (and ido-text (= 0 (length ido-text)))
-        (let ((match (ido-name (car ido-matches))))
-          (throw 'ido
-                 (setq ido-selected
-                       (if match
-                           (replace-regexp-in-string "/\\'" "" match)
-                         ido-text)
-                       ido-text ido-selected
-                       ido-final-text ido-text)))))
-    (exit-minibuffer)))
+    (defun my-ido-keys ()
+      (bind-key "C-<tab>" 'ido-smart-select-text ido-file-dir-completion-map))
 
-(defun my-ido-keys ()
-  (bind-key "C-<tab>" 'ido-smart-select-text ido-file-dir-completion-map))
+    (add-hook 'ido-setup-hook 'my-ido-keys)
 
-(add-hook 'ido-setup-hook 'my-ido-keys)
+    ;; ido and imenu integration
+    (defun ido-goto-symbol (&optional symbol-list)
+      "Refresh imenu and jump to a place in the buffer using Ido."
+      (interactive)
+      (unless (featurep 'imenu)
+        (require 'imenu nil t))
+      (cond
+       ((not symbol-list)
+        (let ((ido-mode ido-mode)
+              (ido-enable-flex-matching
+               (if (boundp 'ido-enable-flex-matching)
+                   ido-enable-flex-matching t))
+              name-and-pos symbol-names position)
+          (unless ido-mode
+            (ido-mode 1)
+            (setq ido-enable-flex-matching t))
+          (while (progn
+                   (imenu--cleanup)
+                   (setq imenu--index-alist nil)
+                   (ido-goto-symbol (imenu--make-index-alist))
+                   (setq selected-symbol
+                         (ido-completing-read "Symbol? " symbol-names))
+                   (string= (car imenu--rescan-item) selected-symbol)))
+          (unless (and (boundp 'mark-active) mark-active)
+            (push-mark nil t nil))
+          (setq position (cdr (assoc selected-symbol name-and-pos)))
+          (cond
+           ((overlayp position)
+            (goto-char (overlay-start position)))
+           (t
+            (goto-char position)))))
+       ((listp symbol-list)
+        (dolist (symbol symbol-list)
+          (let (name position)
+            (cond
+             ((and (listp symbol) (imenu--subalist-p symbol))
+              (ido-goto-symbol symbol))
+             ((listp symbol)
+              (setq name (car symbol))
+              (setq position (cdr symbol)))
+             ((stringp symbol)
+              (setq name symbol)
+              (setq position
+                    (get-text-property 1 'org-imenu-marker symbol))))
+            (unless (or (null position) (null name)
+                        (string= (car imenu--rescan-item) name))
+              (setq word-under-cursor (thing-at-point 'symbol))
+              (setq fix-the-order (not (null (member word-under-cursor symbol-names))))
+              (add-to-list 'symbol-names name)
+              (when fix-the-order
+                (delete word-under-cursor symbol-names)
+                (add-to-list 'symbol-names word-under-cursor))
+              (add-to-list 'name-and-pos (cons name position))))))))
 
-;; ido and imenu integration
-(defun ido-goto-symbol (&optional symbol-list)
-  "Refresh imenu and jump to a place in the buffer using Ido."
-  (interactive)
-  (unless (featurep 'imenu)
-    (require 'imenu nil t))
-  (cond
-   ((not symbol-list)
-    (let ((ido-mode ido-mode)
-          (ido-enable-flex-matching
-           (if (boundp 'ido-enable-flex-matching)
-               ido-enable-flex-matching t))
-          name-and-pos symbol-names position)
-      (unless ido-mode
-        (ido-mode 1)
-        (setq ido-enable-flex-matching t))
-      (while (progn
-               (imenu--cleanup)
-               (setq imenu--index-alist nil)
-               (ido-goto-symbol (imenu--make-index-alist))
-               (setq selected-symbol
-                     (ido-completing-read "Symbol? " symbol-names))
-               (string= (car imenu--rescan-item) selected-symbol)))
-      (unless (and (boundp 'mark-active) mark-active)
-        (push-mark nil t nil))
-      (setq position (cdr (assoc selected-symbol name-and-pos)))
-      (cond
-       ((overlayp position)
-        (goto-char (overlay-start position)))
-       (t
-        (goto-char position)))))
-   ((listp symbol-list)
-    (dolist (symbol symbol-list)
-      (let (name position)
-        (cond
-         ((and (listp symbol) (imenu--subalist-p symbol))
-          (ido-goto-symbol symbol))
-         ((listp symbol)
-          (setq name (car symbol))
-          (setq position (cdr symbol)))
-         ((stringp symbol)
-          (setq name symbol)
-          (setq position
-                (get-text-property 1 'org-imenu-marker symbol))))
-        (unless (or (null position) (null name)
-                    (string= (car imenu--rescan-item) name))
-          (setq word-under-cursor (thing-at-point 'symbol))
-          (setq fix-the-order (not (null (member word-under-cursor symbol-names))))
-          (add-to-list 'symbol-names name)
-          (when fix-the-order
-            (delete word-under-cursor symbol-names)
-            (add-to-list 'symbol-names word-under-cursor))
-          (add-to-list 'name-and-pos (cons name position))))))))
+    ;; sort ido filelist by mtime instead of alphabetically
+    (defun ido-sort-mtime ()
+      (setq ido-temp-list
+            (sort ido-temp-list
+                  (lambda (a b)
+                    (time-less-p
+                     (sixth (file-attributes (concat ido-current-directory b)))
+                     (sixth (file-attributes (concat ido-current-directory a)))))))
+      (ido-to-end  ;; move . files to end (again)
+       (--select (char-equal (string-to-char it) ?.) ido-temp-list))
+      (when ido-show-dot-for-dired
+        (setq ido-temp-list
+              (cons "." (--remove (equal it ".") ido-temp-list)))))
 
-;; sort ido filelist by mtime instead of alphabetically
-(add-hook 'ido-make-file-list-hook 'ido-sort-mtime)
-(add-hook 'ido-make-dir-list-hook 'ido-sort-mtime)
-(defun ido-sort-mtime ()
-  (setq ido-temp-list
-        (sort ido-temp-list
-              (lambda (a b)
-                (time-less-p
-                 (sixth (file-attributes (concat ido-current-directory b)))
-                 (sixth (file-attributes (concat ido-current-directory a)))))))
-  (ido-to-end  ;; move . files to end (again)
-   (--select (char-equal (string-to-char it) ?.) ido-temp-list))
-  (when ido-show-dot-for-dired
-    (setq ido-temp-list
-          (cons "." (--remove (equal it ".") ido-temp-list)))))
+    (add-hook 'ido-make-file-list-hook 'ido-sort-mtime)
+    (add-hook 'ido-make-dir-list-hook 'ido-sort-mtime)))
-(defun my-isearch-forward ()
-  "Repeat the forward search.
+(use-package "isearch"
+  :bind (("C-s" . isearch-forward-regexp)
+         ("C-r" . isearch-backward-regexp))
+  :config
+  (progn
+    (use-package flex-isearch
+      :load-path "~/.emacs.d/vendor/flex-isearch/"
+      :config
+      (progn
+        (defadvice isearch-forward-regexp (around flex-isearch activate)
+          (when (and flex-isearch-mode
+                     (equal (ad-get-arg 0) '(16)))
+            (flex-isearch-activate)
+            (ad-set-arg 0 '(4)))
+          ad-do-it)
+
+        (defadvice isearch-backward-regexp (around flex-isearch activate)
+          (when (and flex-isearch-mode
+                     (equal (ad-get-arg 0) '(16)))
+            (flex-isearch-activate)
+            (ad-set-arg 0 '(4)))
+          ad-do-it)))
+
+    (defun my-isearch-forward ()
+      "Repeat the forward search.
 
 If called from backward search, immediately jump to the following
 occurance instead of jumping to the end of current one."
-  (interactive)
-  (when (not isearch-forward)
-    (isearch-repeat 'forward))
-  (isearch-repeat 'forward))
+      (interactive)
+      (when (not isearch-forward)
+        (isearch-repeat 'forward))
+      (isearch-repeat 'forward))
 
-(defun my-isearch-backward ()
-  "Repeat the backward search.
+    (defun my-isearch-backward ()
+      "Repeat the backward search.
 
 If called from forward search, immediately jump to the previous
 occurance instead of jumping to the beginning of current one."
-  (interactive)
-  (when (and isearch-forward
-             (/= (point) isearch-other-end))
-    (isearch-repeat 'backward))
-  (isearch-repeat 'backward))
+      (interactive)
+      (when (and isearch-forward
+                 (/= (point) isearch-other-end))
+        (isearch-repeat 'backward))
+      (isearch-repeat 'backward))
 
-(defun my-isearch-forward-to-beginning ()
-  "Repeat the forward search and place the point before the
+    (defun my-isearch-forward-to-beginning ()
+      "Repeat the forward search and place the point before the
 matched text."
-  (interactive)
-  (when (not isearch-forward)
-    (isearch-repeat 'forward))
-  (isearch-repeat 'forward)
-  (goto-char isearch-other-end))
+      (interactive)
+      (when (not isearch-forward)
+        (isearch-repeat 'forward))
+      (isearch-repeat 'forward)
+      (goto-char isearch-other-end))
 
-(defun my-isearch-kill-match ()
-  "Kill the text last matched by isearch."
-  (interactive)
-  (isearch-exit)
-  (kill-region (point) isearch-other-end))
+    (defun my-isearch-kill-match ()
+      "Kill the text last matched by isearch."
+      (interactive)
+      (isearch-exit)
+      (kill-region (point) isearch-other-end))
 
-(defun my-isearch-zap-to-match ()
-  "Kill the region between the point of origin of isearch and the
+    (defun my-isearch-zap-to-match ()
+      "Kill the region between the point of origin of isearch and the
 closest portion of the isearch match string.  The behaviour is
 meant to be analogous to zap-to-char.  The deleted region does
 not include the isearch word.  This is meant to be bound only in
 isearch mode."
-  (interactive)
-  (let* ((isearch-bounds (list isearch-other-end (point)))
-         (ismin (apply 'min isearch-bounds))
-         (ismax (apply 'max isearch-bounds))
-         (beg isearch-opoint))
-    (cond
-     ((< beg ismin)
-      (goto-char ismin)
-      (kill-region beg ismin))
-     ((> beg ismax)
-      (goto-char beg)
-      (kill-region ismax beg))
-     (t
-      (error "Internal error in isearch kill function.")))
-    (isearch-exit)))
+      (interactive)
+      (let* ((isearch-bounds (list isearch-other-end (point)))
+             (ismin (apply 'min isearch-bounds))
+             (ismax (apply 'max isearch-bounds))
+             (beg isearch-opoint))
+        (cond
+         ((< beg ismin)
+          (goto-char ismin)
+          (kill-region beg ismin))
+         ((> beg ismax)
+          (goto-char beg)
+          (kill-region ismax beg))
+         (t
+          (error "Internal error in isearch kill function.")))
+        (isearch-exit)))
 
-(defun my-isearch-exit-other-end ()
-  "Exit isearch, but at the other end of the search string.
+    (defun my-isearch-exit-other-end ()
+      "Exit isearch, but at the other end of the search string.
 This is useful when followed by an immediate kill."
-  (interactive)
-  (isearch-exit)
-  (goto-char isearch-other-end))
+      (interactive)
+      (isearch-exit)
+      (goto-char isearch-other-end))
 
-(defun my-isearch-yank-symbol ()
-  "Pull next symbol from buffer into search string."
-  (interactive)
-  (isearch-yank-internal (lambda () (sp-forward-symbol) (point))))
+    (defun my-isearch-yank-symbol ()
+      "Pull next symbol from buffer into search string."
+      (interactive)
+      (isearch-yank-internal (lambda () (sp-forward-symbol) (point))))
 
-(defun my-isearch-exit ()
-  "Exit search normally.
+    (defun my-isearch-exit ()
+      "Exit search normally.
 
 If in dired buffer, find file under cursor.  If it is a
 directory, go right back into search."
-  (interactive)
-  (isearch-exit)
-  (if (eq major-mode 'dired-mode)
-    ;; we're assuming no files are marked
-    (let ((d (car (dired-get-marked-files))))
-      (dired-find-file)
-      (when (file-directory-p d)
-        (dired-isearch-filenames)))))
+      (interactive)
+      (isearch-exit)
+      (if (eq major-mode 'dired-mode)
+          ;; we're assuming no files are marked
+          (let ((d (car (dired-get-marked-files))))
+            (dired-find-file)
+            (when (file-directory-p d)
+              (dired-isearch-filenames)))))
 
-;; keybindings
-(bind-key "<f6>" 'replace-regexp)
+    ;; keybindings
+    (bind-key "<f6>" 'replace-regexp)
 
-(bind-key "C-v" 'my-isearch-forward-to-beginning isearch-mode-map)
-(bind-key "C-r" 'my-isearch-backward             isearch-mode-map)
-(bind-key "C-s" 'my-isearch-forward              isearch-mode-map)
-(bind-key "C-2" 'my-isearch-kill-match           isearch-mode-map)
-(bind-key "C-3" 'my-isearch-exit-other-end       isearch-mode-map)
-(bind-key "C-w" 'my-isearch-yank-symbol          isearch-mode-map)
-(bind-key "C-M-w" 'isearch-yank-word-or-char     isearch-mode-map)
-(bind-key "M-z" 'my-isearch-zap-to-match         isearch-mode-map)
-(bind-key "<f2>" 'isearch-occur                  isearch-mode-map)
-(bind-key "\r" 'my-isearch-exit                  isearch-mode-map)
+    (bind-key "C-v" 'my-isearch-forward-to-beginning isearch-mode-map)
+    (bind-key "C-r" 'my-isearch-backward             isearch-mode-map)
+    (bind-key "C-s" 'my-isearch-forward              isearch-mode-map)
+    (bind-key "C-2" 'my-isearch-kill-match           isearch-mode-map)
+    (bind-key "C-3" 'my-isearch-exit-other-end       isearch-mode-map)
+    (bind-key "C-w" 'my-isearch-yank-symbol          isearch-mode-map)
+    (bind-key "C-M-w" 'isearch-yank-word-or-char     isearch-mode-map)
+    (bind-key "M-z" 'my-isearch-zap-to-match         isearch-mode-map)
+    (bind-key "<f2>" 'isearch-occur                  isearch-mode-map)
+    (bind-key "\r" 'my-isearch-exit                  isearch-mode-map)
 
-(bind-key "C-S-s" 'flex-isearch-forward)
-(bind-key "C-S-r" 'flex-isearch-backward)
+    (bind-key "C-S-s" 'flex-isearch-forward)
+    (bind-key "C-S-r" 'flex-isearch-backward)))
-;;; ispell - Interactive spellchecker
-
-(autoload 'ispell-word "ispell" nil t)
-(bind-key "<f10>" 'ispell-word)
-(bind-key "C-<f10>" 'flyspell-mode)
+(use-package ispell
+  :bind (("<f10>" . ispell-word)
+         ("C-<f10>" . flyspell-mode)))
 (bind-key "C-c w" 'browse-url)
 
 ;; Find stuff
-(bind-key "M-<f2>" 'my-find-dired)
 (bind-key "<f2>" 'occur)
 (bind-key "n" 'occur-next occur-mode-map)
 (bind-key "p" 'occur-prev occur-mode-map)
 (bind-key "C-'" 'repeat)
 
 ;; refresh-like
-(bind-key "C-<f5>" 'revbufs)
 (bind-key "<f5>" '(lambda () (interactive) (load-file (buffer-file-name))))
 
 ;; Indenting and alignment
 (bind-key "C-<f8>" 'indent-buffer)
 (bind-key "C-<tab>" 'indent-defun)
 
-(bind-key "M-o" 'elwm-activate-window)
-(bind-key "M-O" 'elwm-transpose-window)
-(bind-key "C-M-o" 'elwm-rotate-window)
-(bind-key "C-x C-2" 'elwm-split-window)
-(unbind-key "C-x o")
-
-(add-hook 'dired-mode-hook (lambda () (bind-key "M-o" 'elwm-activate-window dired-mode-map)))
-(add-hook 'ibuffer-mode-hook (lambda () (bind-key "M-o" 'elwm-activate-window ibuffer-mode-map)))
-
 (defvar f1-prefix-map)
 (define-prefix-command 'f1-prefix-map)
 (bind-key "<f1>" 'f1-prefix-map)
-(bind-key "<f1> <f1>" 'ibuffer)
-(bind-key "<f1> <f2>" (lambda () (interactive) (bookmark-jump "init.el")))
-(bind-key "<f1> <f3>" (lambda () (interactive) (bookmark-jump "*Messages*")))
-(bind-key "<f1> b" 'bs-show)
+(bind-key "<f1> <f2>" (lambda () (interactive) (find-file "~/.emacs.d/init.el")))
+(bind-key "<f1> <f3>" 'view-echo-area-messages)
 
 ;; ibuffer > list-buffers
 (bind-key "C-x C-b" 'ibuffer)
 (bind-key "M-K" (lambda () (interactive) (kill-buffer (window-buffer (next-window)))))
 
 ;; imenu
-(bind-key "M-." 'ido-goto-symbol) ;; was Find tag
 (bind-key "M-," 'find-function)
 
 ;; sexp settings
 (bind-key "C-p" 'previous-history-element minibuffer-local-map)
 (bind-key "C-n" 'next-history-element minibuffer-local-map)
 
+(bind-key "C-c V" 'view-clipboard)
+(bind-key "C-c =" 'count-matches)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; navigation
 
 (bind-key "C-M-p" 'backward-list)
 (bind-key "C-c f" (lambda () (interactive) (sp-beginning-of-sexp 2)))
 (bind-key "C-c b" (lambda () (interactive) (sp-beginning-of-sexp -2)))
-;; binary search
-(bind-key "H-b" 'chop-move-up)
-(bind-key "H-f" 'chop-move-down)
-(bind-key "H-a" 'chop-move-up)
-(bind-key "H-d" 'chop-move-down)
 
-(bind-key "C-s" 'isearch-forward-regexp)
-(bind-key "C-r" 'isearch-backward-regexp)
+(bind-key "C-c q s" 'query-replace)
+(bind-key "C-c q r" 'query-replace-regexp)
 
 ;; # move to (beg/end)
 ;; line
 (bind-key "M-p" 'beginning-of-defun)
 (bind-key "M-n" 'end-of-defun)
 ;; active region
-(bind-key "C-c a" 'beginning-of-region)
-(bind-key "C-c e" 'end-of-region)
+(bind-key "M-g a" 'beginning-of-region)
+(bind-key "M-g e" 'end-of-region)
 
 ;; # move into
 (bind-key "C-M-d" 'down-list)
             (interactive)
             (join-line -1)))
 
-;;; scrollers
-(bind-key "C-c n" 'my-scroll-up)
-(bind-key "C-c p" 'my-scroll-down)
-
 ;; deleting stuff
 (bind-key "C-<i-key>" 'backward-kill-word)
 (bind-key "C-<backspace>" 'my-kill-whitespace)
+(bind-key "C-c d" 'my-kill-entire-line)
 
 ;; up/downcase
 (bind-key "M-l" 'my-smart-downcase-word)
 (defvar lisp-find-map)
 (define-prefix-command 'lisp-find-map)
 (bind-key "C-h e" 'lisp-find-map)
+(bind-key "C-h e d" 'info-lookup-symbol)
+(bind-key "C-h e f" 'find-function)
 (bind-key "C-h e F" 'find-face-definition)
+(bind-key "C-h e i" 'info-apropos)
 (bind-key "C-h e k" 'find-function-on-key)
 (bind-key "C-h e l" 'find-library)
 (bind-key "C-h e v" 'find-variable)
+(bind-key "C-h e V" 'apropos-value)
 (bind-key "C-h D" 'describe-personal-keybindings)
 
 (defvar ctl-dot-prefix-map)
 (bind-key "C-. i g" (lambda () (interactive) (set-input-method "german")))
 (bind-key "C-. i t" (lambda () (interactive) (set-input-method "TeX")))
 
-
-(defvar ctl-c-r-map)
-(define-prefix-command 'ctl-c-r-map)
-(bind-key "C-c r" 'ctl-c-r-map)
-(bind-key "C-c r f" 'recentf-open-files)
-(bind-key "C-c r c" 'recentf-cleanup)
-
-(bind-key "C-x C-r" 'recentf-open-files)
-
 (bind-key "H-u" 'universal-argument)
 (bind-key "H-u" 'universal-argument-more universal-argument-map)
 (dotimes (i 10)
 (defvar ctl-c-m-map)
 (define-prefix-command 'ctl-c-m-map)
 (bind-key "C-c m" 'ctl-c-m-map)
+(bind-key "C-c m b" 'magit-key-mode-popup-branching)
+(bind-key "C-c m c" 'magit-key-mode-popup-committing)
+(bind-key "C-c m d" 'magit-key-mode-popup-dispatch)
+(bind-key "C-c m f" 'magit-key-mode-popup-fetching)
+(bind-key "C-c m i" 'magit-key-mode-popup-diff-options)
+(bind-key "C-c m l" 'magit-key-mode-popup-logging)
+(bind-key "C-c m m" 'magit-key-mode-popup-merging)
+(bind-key "C-c m p" 'magit-key-mode-popup-pushing)
+
 (bind-key "C-c m s" 'magit-status)
-(bind-key "C-c m l" 'magit-key-mode-popup-logging)
-(bind-key "C-c m b" 'magit-key-mode-popup-branching)
-(bind-key "C-c m d" 'magit-key-mode-popup-dispatch)
-(bind-key "C-c m c" 'magit-checkout)
 
 ;; zapping
 (bind-key "M-z" 'zap-up-to-char)
 
 (bind-key "C-z" 'my-quoted-insert-and-backward)
 
+;; M-s map
 (bind-key "M-s RET" 'skeleton-easy-regexp-display-abbrev)
+(bind-key "M-s c" 'calendar)
+
+;; M-g map
 (bind-key "M-g RET" 'skeleton-display-abbrev)
 
 ;; input methods

files/latex-mode-config.el

+(use-package tex-site
+  :load-path "site-lisp/auctex/"
+  :mode ("\\.tex\\'" . TeX-latex-mode)
+  :commands (TeX-latex-mode
+             TeX-mode
+             tex-mode
+             LaTeX-mode
+             latex-mode)
+  :config
+  (progn
+    (use-package latex
+      :defer t
+      :config
+      (progn
+        ;; fix the "bug" in SP regexp wrap that treats ' as "word"
+        (modify-syntax-entry ?' ".")
+
+        (require 'smartparens-latex)
+        (sp-local-pair 'latex-mode "\\begin" "\\end")
+        (sp-local-tag 'latex-mode "\\ba" "\\begin{align*}" "\\end{align*}")
+
+        (use-package preview)
+        (use-package font-latex)
+        (fset 'tex-font-lock-suscript 'ignore)
+
+        (sp-with-modes '(tex-mode plain-tex-mode latex-mode)
+          (sp-local-pair "\\[" nil :post-handlers '(my-latex-math-block-indent)))
+
+        (defun my-latex-math-block-indent (a action c)
+          (when (eq action 'insert)
+            (newline-and-indent)
+            (save-excursion (newline))))
+
+        (defun my-latex-compile ()
+          (interactive)
+          (save-buffer)
+          (TeX-command "LaTeX" 'TeX-master-file nil))
+        (bind-key "C-M-x" 'my-latex-compile LaTeX-mode-map)
+
+        (defvar my-latex-wrap-choices '("emph"
+                                        "textsc"))
+        (defvar my-latex-wrap-history nil)
+
+        (defun my-latex-wrap (macro-name)
+          (interactive (list (ido-completing-read
+                              "Macro> "
+                              my-latex-wrap-choices
+                              nil 'confirm nil my-latex-wrap-history)))
+          (when (use-region-p)
+            (let ((b (region-beginning))
+                  (e (region-end)))
+              (goto-char e)
+              (insert "}")
+              (goto-char b)
+              (insert "\\" macro-name "{"))))
+        (bind-key "C-c w" 'my-latex-wrap LaTeX-mode-map)
+
+        (defun my-end-of-environment ()
+          (interactive)
+          (LaTeX-mark-environment)
+          (end-of-region))
+
+        (defun my-beginning-of-environment ()
+          (interactive)
+          (LaTeX-mark-environment)
+          (beginning-of-region)
+          (deactivate-mark))
+
+        (bind-key "M-n" 'my-end-of-environment LaTeX-mode-map)
+        (bind-key "M-p" 'my-beginning-of-environment LaTeX-mode-map)
+
+        ;; fix italian quote highlight
+        (push '("\"<" "\">") font-latex-quote-list)
+
+        (defun my-latex-remove-command ()
+          "Unwrap the expression that point is in or before, also
+removing the command name.  By command we understand a symbol
+starting with \\ and followed by a block of text enclosed in {}."
+          (interactive)
+          (let ((ok (sp-get-enclosing-sexp)))
+            (cond
+             ;; we're inside the { } block
+             (ok
+              (progn
+                (save-excursion
+                  (goto-char (sp-get ok :beg))
+                  (zap-to-char -1 ?\\ ))
+                (sp-splice-sexp)))
+             ;; test if we are in looking at the command fromt he front
+             ((looking-at "\\\\")
+              (zap-up-to-char 1 ?{)
+              (sp-unwrap-sexp))
+             ;; otherwise we're inside the command name
+             (t
+              (zap-to-char -1 ?\\ )
+              (zap-up-to-char 1 ?{)
+              (sp-unwrap-sexp)))))
+        (bind-key "C-c d" 'my-latex-remove-command LaTeX-mode-map)
+        (bind-key "M-RET" 'LaTeX-insert-item LaTeX-mode-map)
+
+        (defun my-LaTeX-preview-math ()
+          (interactive)
+          (let ((b (save-excursion (while (texmathp) (backward-char 1)) (1- (point))))
+                (e (save-excursion (while (texmathp) (forward-char 1)) (point))))
+            (preview-region b e)))
+        (bind-key "C-<m-key>" 'my-LaTeX-preview-math preview-map)
+
+        (defun my-LaTeX-mode-init ()
+          (setq TeX-auto-save t)
+          (setq TeX-parse-self t)
+          (TeX-PDF-mode t)
+          (setq reftex-plug-into-AUCTeX t)
+          (setq TeX-source-correlate-mode t)
+          (setq TeX-source-correlate-method 'synctex)
+          (reftex-mode t)
+          (TeX-fold-mode t)
+
+          (keyadvice-mode t)
+
+          (LaTeX-add-environments
+           '("derivation" LaTeX-env-label))
+          (TeX-add-symbols '("emph" 1))
+
+          (setq fill-column 100000)
+
+          (message "LaTeX mode init complete."))
+        ;; ACUTeX replaces latex-mode-hook with LaTeX-mode-hook
+        (add-hook 'LaTeX-mode-hook 'my-LaTeX-mode-init)
+
+        (keyadvice-add-advice (kbd "`")
+          (if (and (eq major-mode 'latex-mode) (texmathp))
+              (let* ((events (let ((overriding-local-map LaTeX-math-keymap))
+                               (read-key-sequence "math: ")))
+                     (binding (lookup-key LaTeX-math-keymap events)))
+                (call-interactively binding))
+            keyadvice-do-it))))))

files/multi-web-mode-config.el

+(use-package multi-web-mode
+  :config
+  (progn
+    (setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
+                      (javascript-mode "<script +\\(type=\"text/javascript\"\\|language=\"javascript\"\\)[^>]*>" "</script>")
+                      (css-mode "<style +type=\"text/css\"[^>]*>" "</style>")))
+    (setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5"))))
+
+(use-package sgml-mode
+  :config
+  (progn
+    (defun my-html-mode-setup ()
+      (multi-web-mode 1)
+      (emmet-mode 1)
+      (with-map-bind-keys html-mode-map
+        ("C-c C-f" 'sp-html-next-tag)
+        ("C-c C-b" 'sp-html-previous-tag)))
+    (add-hook 'html-mode-hook 'my-html-mode-setup)))

files/org-clock.el

 Skips capture tasks, projects, and subprojects.
 Switch projects and subprojects from NEXT back to TODO"
   (when (not (and (boundp 'org-capture-mode) org-capture-mode))
-	(cond
-	 ((and (member (org-get-todo-state) (list "TODO"))
-		   (bh/is-task-p))
-	  "NEXT")
-	 ((and (member (org-get-todo-state) (list "NEXT"))
-		   (bh/is-project-p))
-	  "TODO"))))
+    (cond
+     ((and (member (org-get-todo-state) (list "TODO"))
+           (bh/is-task-p)
+           (not (org-is-habit-p)))
+      "NEXT")
+     ((and (member (org-get-todo-state) (list "NEXT"))
+           (bh/is-project-p))
+      "TODO"))))
 
 (defun bh/find-project-task ()
   "Move point to the parent (project) task if any"
   (save-restriction
-	(widen)
-	(let ((parent-task (save-excursion (org-back-to-heading 'invisible-ok) (point))))
-	  (while (org-up-heading-safe)
-		(when (member (nth 2 (org-heading-components)) org-todo-keywords-1)
-		  (setq parent-task (point))))
-	  (goto-char parent-task)
-	  parent-task)))
+    (widen)
+    (let ((parent-task (save-excursion (org-back-to-heading 'invisible-ok) (point))))
+      (while (org-up-heading-safe)
+        (when (member (nth 2 (org-heading-components)) org-todo-keywords-1)
+          (setq parent-task (point))))
+      (goto-char parent-task)
+      parent-task)))
 
 (defun bh/punch-in (arg)
   "Start continuous clocking and set the default task to the
   (interactive "p")
   (setq bh/keep-clock-running t)
   (if (equal major-mode 'org-agenda-mode)
-	  ;;
-	  ;; We're in the agenda
-	  ;;
-	  (let* ((marker (org-get-at-bol 'org-hd-marker))
-			 (tags (org-with-point-at marker (org-get-tags-at))))
-		(if (and (eq arg 4) tags)
-			(org-agenda-clock-in '(16))
-		  (bh/clock-in-organization-task-as-default)))
-	;;
-	;; We are not in the agenda
-	;;
-	(save-restriction
-	  (widen)
-	  ; Find the tags on the current task
-	  (if (and (equal major-mode 'org-mode) (not (org-before-first-heading-p)) (eq arg 4))
-		  (org-clock-in '(16))
-		(bh/clock-in-organization-task-as-default)))))
+      ;;
+      ;; We're in the agenda
+      ;;
+      (let* ((marker (org-get-at-bol 'org-hd-marker))
+             (tags (org-with-point-at marker (org-get-tags-at))))
+        (if (and (eq arg 4) tags)
+            (org-agenda-clock-in '(16))
+          (bh/clock-in-organization-task-as-default)))
+    ;;
+    ;; We are not in the agenda
+    ;;
+    (save-restriction
+      (widen)
+      ; Find the tags on the current task
+      (if (and (equal major-mode 'org-mode) (not (org-before-first-heading-p)) (eq arg 4))
+          (org-clock-in '(16))
+        (bh/clock-in-organization-task-as-default)))))
 
 (defun bh/punch-out ()
   (interactive)
   (setq bh/keep-clock-running nil)
   (when (org-clock-is-active)
-	(org-clock-out))
+    (org-clock-out))
   (org-agenda-remove-restriction-lock))
 
 (defun bh/clock-in-default-task ()
   (save-excursion
-	(org-with-point-at org-clock-default-task
-	  (org-clock-in))))
+    (org-with-point-at org-clock-default-task
+      (org-clock-in))))
 
 (defun bh/clock-in-parent-task ()
   "Move point to the parent (project) task if any and clock in"
   (let ((parent-task))
-	(save-excursion
-	  (save-restriction
-		(widen)
-		(while (and (not parent-task) (org-up-heading-safe))
-		  (when (member (nth 2 (org-heading-components)) org-todo-keywords-1)
-			(setq parent-task (point))))
-		(if parent-task
-			(org-with-point-at parent-task
-			  (org-clock-in))
-		  (when bh/keep-clock-running
-			(bh/clock-in-default-task)))))))
+    (save-excursion
+      (save-restriction
+        (widen)
+        (while (and (not parent-task) (org-up-heading-safe))
+          (when (member (nth 2 (org-heading-components)) org-todo-keywords-1)
+            (setq parent-task (point))))
+        (if parent-task
+            (org-with-point-at parent-task
+              (org-clock-in))
+          (when bh/keep-clock-running
+            (bh/clock-in-default-task)))))))
 
 (defvar bh/organization-task-id "eb155a82-92b2-4f25-a3c6-0304591af2f9")
 
 (defun bh/clock-in-organization-task-as-default ()
   (interactive)
   (org-with-point-at (org-id-find bh/organization-task-id 'marker)
-	(org-clock-in '(16))))
+    (org-clock-in '(16))))
 
 (defun bh/clock-out-maybe ()
   (when (and bh/keep-clock-running
-			 (not org-clock-clocking-in)
-			 (marker-buffer org-clock-default-task)
-			 (not org-clock-resolving-clocks-due-to-idleness))
-	(bh/clock-in-parent-task)))
+             (not org-clock-clocking-in)
+             (marker-buffer org-clock-default-task)
+             (not org-clock-resolving-clocks-due-to-idleness))
+    (bh/clock-in-parent-task)))
 
 (add-hook 'org-clock-out-hook 'bh/clock-out-maybe 'append)

files/org-mode.el

   ;; The following lines are always needed.  Choose your own keys.
   :bind  (("C-c l" . org-store-link)
           ("<f12>" . org-agenda)
-          ("C-c b" . org-iswitchb))
+          ("C-c C-x C-o" . org-clock-out))
   :config
   (progn
-    (setq org-modules (quote (org-habit)))
-
     (bind-key "TAB" 'smart-tab org-mode-map)
     (bind-key "C-e" 'my-end-of-code-or-line org-mode-map)
     (bind-key "C-a" 'my-back-to-indentation-or-beginning org-mode-map)
+    (bind-key "C-c C-x r" 'org-clock-remove-overlays org-mode-map)
+
+    (require 'org-table)
+    ;; org/orgtbl bindings
+    (defvar my-org-table-map)
+    (define-prefix-command 'my-org-table-map)
+    (bind-key "C-c t" 'my-org-table-map org-mode-map)
+    (bind-key "C-c t" 'my-org-table-map orgtbl-mode-map)
+    (defvar my-org-table-insert-map)
+    (define-prefix-command 'my-org-table-insert-map)
+    (bind-key "C-c t i" 'my-org-table-insert-map org-mode-map)
+    (bind-key "C-c t i" 'my-org-table-insert-map orgtbl-mode-map)
+    (bind-key "C-c t i i" 'orgtbl-insert-radio-table orgtbl-mode-map)
+    (defvar my-org-table-delete-map)
+    (define-prefix-command 'my-org-table-delete-map)
+    (bind-key "C-c t d" 'my-org-table-delete-map org-mode-map)
+    (bind-key "C-c t d" 'my-org-table-delete-map orgtbl-mode-map)
+
+    (let ((bindings '(("C-c t i c" org-table-insert-column)
+                      ("C-c t i r" org-table-insert-row)
+                      ("C-c t d c" org-table-delete-column)
+                      ("C-c t d r" org-table-kill-row)))
+          (n 1000))
+      (dolist (b bindings)
+        (define-key org-mode-map (kbd (car b)) (cadr b))
+        (org-defkey orgtbl-mode-map (kbd (car b)) (orgtbl-make-binding (cadr b) n (kbd (car b))))
+        (setq n (1+ n))))
 
     (defun my-org-select-cell ()
       "Select the cell in org table the point is in."
         (goto-char e)))
     (bind-key "C-c t" 'my-org-select-cell org-mode-map)
 
+    (defun my-markdown-to-org-link (b e)
+      (interactive "r")
+      (goto-char b)
+      (sp-down-sexp)
+      (let ((desc (sp-get (sp--next-thing-selection 0)
+                    (buffer-substring-no-properties :beg :end)))
+            (link (progn
+                    (sp-beginning-of-sexp 2)
+                    (sp-get (sp--next-thing-selection 0)
+                      (buffer-substring-no-properties :beg :end)))))
+        (delete-region b e)
+        (insert (format "[[%s][%s]]" link desc))))
+
     (load "files/org-clock")
     (load "files/org-project")
 
                               org-wl
                               org-w3m)))
 
-                                        ; position the habit graph on the agenda to the right of the default
+    ;; position the habit graph on the agenda to the right of the default
     (setq org-habit-graph-column 50)
 
 ;;;;;;;;;;;;;;;;;;;;; CAPTURE
     (add-hook 'org-clock-out-hook 'bh/remove-empty-drawer-on-clock-out 'append)
 
 ;;;;;;;;;;;;;;;;; REFILING
-                                        ; Targets include this file and any file contributing to the agenda - up to 9 levels deep
+    ;; Targets include this file and any file contributing to the agenda - up to 9 levels deep
     (setq org-refile-targets (quote ((nil :maxlevel . 9)
                                      (org-agenda-files :maxlevel . 9))))
 
-                                        ; Use full outline paths for refile targets - we file directly with IDO
+    ;; Use full outline paths for refile targets - we file directly with IDO
     (setq org-refile-use-outline-path t)
 
-                                        ; Targets complete directly with IDO
+    ;; Targets complete directly with IDO
     (setq org-outline-path-complete-in-steps nil)
 
-                                        ; Allow refile to create parent tasks with confirmation
+    ;; Allow refile to create parent tasks with confirmation
     (setq org-refile-allow-creating-parent-nodes (quote confirm))
 
-                                        ; Use IDO for both buffer and file completion and ido-everywhere to t
+    ;; Use IDO for both buffer and file completion and ido-everywhere to t
     (setq org-completion-use-ido t)
-    (setq ido-everywhere t)
-    (setq ido-max-directory-size 100000)
-    (ido-mode (quote both))
 
 ;;;; Refile settings
-                                        ; Exclude DONE state tasks from refile targets
+    ;; Exclude DONE state tasks from refile targets
     (defun bh/verify-refile-target ()
       "Exclude todo keywords with a done state from refile targets"
       (not (member (nth 2 (org-heading-components)) org-done-keywords)))
                                 ("READING" . ?r)
                                 ("LATIN" . ?l))))
 
-                                        ; Allow setting single tags without the menu
+    ;; Allow setting single tags without the menu
     (setq org-fast-tag-selection-single-key (quote expert))
 
     ;; Archiving settings

files/recentf-config.el

+(use-package recentf
+  :bind (("C-c r f" . recentf-open-files)
+         ("C-x C-r" . recentf-open-files)
+         ("C-c r c" . recentf-cleanup))
+  :config
+  (progn
+    (defun my-recentf-setup ()
+      (bind-key "n" 'my-recentf-next-file recentf-dialog-mode-map)
+      (bind-key "p" 'my-recentf-previous-file recentf-dialog-mode-map)
+      (bind-key "C-s" 'my-recentf-isearch-forward recentf-dialog-mode-map))
+
+    (add-hook 'recentf-dialog-mode-hook 'my-recentf-setup)
+
+    (defun my-recentf-next-file (&optional arg)
+      (interactive "p")
+      (forward-line arg)
+      (re-search-forward ".*/\\(.*?\\)$" nil t)
+      (goto-char (match-beginning 1)))
+
+    (defun my-recentf-previous-file (&optional arg)
+      (interactive "p")
+      (forward-line (- arg))
+      (re-search-forward ".*/\\(.*?\\)$" nil t)
+      (goto-char (match-beginning 1)))
+
+    (defvar recentf-isearch-filter-predicate-orig nil)
+    (defvar recentf-isearch-filenames nil)
+
+    (defun recentf-isearch-filenames-setup ()
+      "Set up isearch to search in recentf file names.
+Intended to be added to `isearch-mode-hook'."
+      (when recentf-isearch-filenames
+        (setq isearch-message-prefix-add "filename ")
+        (setq recentf-isearch-filter-predicate-orig
+              (default-value 'isearch-filter-predicate))
+        (setq-default isearch-filter-predicate 'recentf-isearch-filter-filenames)
+        (add-hook 'isearch-mode-end-hook 'recentf-isearch-filenames-end nil t)))
+
+    (add-hook 'isearch-mode-hook 'recentf-isearch-filenames-setup)
+
+    (defun recentf-isearch-filenames-end ()
+      "Clean up the Recentf file name search after terminating isearch."
+      (setq isearch-message-prefix-add nil)
+      (setq-default isearch-filter-predicate recentf-isearch-filter-predicate-orig)
+      (setq recentf-isearch-filenames nil)
+      (remove-hook 'isearch-mode-end-hook 'recentf-isearch-filenames-end t))
+
+    (defun recentf-isearch-filter-filenames (beg end)
+      "Test whether the current search hit is a visible file name.
+Return non-nil if the text from BEG to END is part of a file
+name (has the text property `recentf-filename') and is visible."
+      (and (isearch-filter-visible beg end)
+           (if recentf-isearch-filenames
+               (text-property-not-all (min beg end) (max beg end)
+                                      'recentf-filename nil)
+             t)))
+
+    (defun my-recentf-isearch-forward ()
+      (interactive)
+      (setq recentf-isearch-filenames t)
+      (isearch-forward nil t))
+
+    ;; redefine from recentf.el to add the property to filename, so we can
+    ;; search filter
+    (defun recentf-open-files-item (menu-element)
+      "Return a widget to display MENU-ELEMENT in a dialog buffer."
+      (if (consp (cdr menu-element))
+          ;; Represent a sub-menu with a tree widget
+          `(tree-widget
+            :open t
+            :match ignore
+            :node (item :tag ,(car menu-element)
+                        :sample-face bold
+                        :format "%{%t%}:\n")
+            ,@(mapcar 'recentf-open-files-item
+                      (cdr menu-element)))
+        ;; Represent a single file with a link widget
+        (let ((str (car menu-element)))
+          ;; add the text property to help the search fitler
+          (string-match ".*/\\(.*?\\)$" str)
+          (put-text-property (match-beginning 1) (match-end 1)
+                             'recentf-filename t str)
+          (message "%s" str)
+          `(link :tag ,str
+                 :button-prefix ""
+                 :button-suffix ""
+                 :button-face default
+                 :format "%[%t\n%]"
+                 :help-echo ,(concat "Open " (cdr menu-element))
+                 :action recentf-open-files-action
+                 ,(cdr menu-element)))))))

files/smartparens.el

 ;;;;;;;;;
 ;; global
 (require 'smartparens-config)
-(smartparens-global-mode t)
-(smartparens-global-strict-mode t)
-
-;; highlights matching pairs
-(show-smartparens-global-mode t)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;
 ;; keybinding management
-
 (define-key sp-keymap (kbd "C-M-f") 'sp-forward-sexp)
 (define-key sp-keymap (kbd "C-M-b") 'sp-backward-sexp)
 
 (bind-key "H-s x a" 'sp-extract-after-sexp sp-keymap)
 (bind-key "H-s x s" 'sp-swap-enclosing-sexp sp-keymap)
 
+(bind-key "C-x C-t" 'sp-transpose-hybrid-sexp sp-keymap)
+(bind-key "<up>" 'sp-indent-adjust-sexp sp-keymap)
+(bind-key "<down>" 'sp-dedent-adjust-sexp sp-keymap)
+(bind-key "<right>" 'sp-slurp-hybrid-sexp sp-keymap)
+
 ;;;;;;;;;;;;;;;;;;
 ;; pair management
 
 
 ;;; markdown-mode
 (sp-with-modes '(markdown-mode gfm-mode rst-mode)
-  (sp-local-pair "*" "*" :bind "C-*" :skip-match 'sp--gfm-skip-asterisk)
-  (sp-local-pair "_" "_" :bind "C-_")
+  (sp-local-pair "*" "*" :wrap "C-*" :skip-match 'sp--gfm-skip-asterisk)
+  (sp-local-pair "_" "_" :wrap "C-_")
   (sp-local-tag "2" "**" "**")
   (sp-local-tag "s" "```scheme" "```")
   (sp-local-tag "<"  "<_>" "</_>" :transform 'sp-match-sgml-tags))
 (defun sp--gfm-skip-asterisk (ms mb me)
   (save-excursion
     (goto-char mb)
-    (save-match-data (looking-at "^* "))))
+    (save-match-data (looking-at "^\\* "))))
+
+;;; org-mode
+(sp-with-modes 'org-mode
+  (sp-local-pair "*" "*" :unless '(sp-point-after-word-p sp-point-at-bol-p) :wrap "C-*" :skip-match 'sp--org-skip-asterisk)
+  (sp-local-pair "_" "_" :unless '(sp-point-after-word-p) :wrap "C-_" :skip-match 'sp--org-skip-markup)
+  (sp-local-pair "/" "/" :unless '(sp-point-after-word-p) :skip-match 'sp--org-skip-markup)
+  (sp-local-pair "=" "=" :unless '(sp-point-after-word-p) :skip-match 'sp--org-skip-code))
+
+(defun sp--org-skip-markup (ms mb me)
+  (save-excursion
+    (and (progn
+           (goto-char mb)
+           (save-match-data (looking-back "\\sw\\|\\s_\\|\\s.")))
+         (progn
+           (goto-char me)
+           (save-match-data (looking-at "\\sw\\|\\s_\\|\\s."))))))
+
+(defun sp--org-skip-asterisk (ms mb me)
+  (or (save-excursion
+        (goto-char (line-beginning-position))
+        (save-match-data (looking-at "^\\*+")))
+      (sp--org-skip-markup ms mb me)))
+
+(defun sp--org-skip-code (ms mb me)
+  (or (sp--org-skip-markup ms mb me)
+      (save-excursion
+        (and (progn
+               (goto-char mb)
+               (save-match-data (looking-back "\\s-")))
+             (progn
+               (goto-char me)
+               (save-match-data (looking-at "\\s-")))))))
 
 ;;; tex-mode latex-mode
 (sp-with-modes '(tex-mode plain-tex-mode latex-mode)
 
 ;;; lisp modes
 (sp-with-modes (append '(inferior-emacs-lisp-mode) sp--lisp-modes)
-  (sp-local-pair "(" nil :bind "C-("))
+  (sp-local-pair "(" nil :wrap "C-("))
 
 (sp-local-pair 'c++-mode "{" nil :post-handlers '((my-create-newline-and-enter-sexp "RET")))
 (defun my-create-newline-and-enter-sexp (&rest _ignored)
   (indent-according-to-mode))
 
 ;;; haskell mode
-(sp-local-pair 'haskell-mode "'" nil :unless '(my-after-symbol-p))
+(sp-with-modes '(haskell-mode)
+  (sp-local-pair "'" nil :unless '(my-after-symbol-p))
+  (sp-local-pair "\\\(" nil :actions :rem))
 
 (defun my-after-symbol-p (_id action _context)
   (when (eq action 'insert)
       (backward-char 1)
       (looking-back "\\sw\\|\\s_\\|\\s'"))))
 
-(sp-local-pair 'emacs-lisp-mode "(" nil :post-handlers '(my-add-space-after-sexp-insertion))
+(sp-local-pair 'emacs-lisp-mode "(" nil
+               :pre-handlers '(my-add-space-before-sexp-insertion)
+               :post-handlers '(my-add-space-after-sexp-insertion))
 
 (defun my-add-space-after-sexp-insertion (id action _context)
   (when (eq action 'insert)
     (save-excursion
-      (forward-char (length (plist-get (sp-get-pair id) :close)))
+      (forward-char (sp-get-pair id :cl-l))
       (when (or (eq (char-syntax (following-char)) ?w)
                 (looking-at (sp--get-opening-regexp)))
         (insert " ")))))
+
+(defun my-add-space-before-sexp-insertion (id action _context)
+  (when (eq action 'insert)
+    (save-excursion
+      (backward-char (length id))
+      (when (or (eq (char-syntax (preceding-char)) ?w)
+                (looking-at (sp--get-closing-regexp)))
+        (insert " ")))))
 ;; http://www.emacswiki.org/emacs/TabCompletion
 ;; TODO: Take a look at https://github.com/genehack/smart-tab
 
-(defvar smart-tab-using-hippie-expand t
-  "turn this on if you want to use hippie-expand completion.")
-
 (defun smart-tab (prefix)
   "Needs `transient-mark-mode' to be on. This smart tab is
   minibuffer compliant: it acts as usual in the minibuffer.
                                     (looking-at "\\_>"))))
     (cond
      ((and (eq major-mode 'org-mode)
+           (not (smart-tab-must-expand prefix))
            (org-cycle)))
      ((cond
        ((minibufferp)
         (minibuffer-complete))
        ((smart-tab-must-expand prefix)
-        (if smart-tab-using-hippie-expand
-            (hippie-expand prefix)
-          (dabbrev-expand prefix)))
+        (hippie-expand prefix))
        ((smart-indent)))))))
 
 (defun smart-indent ()
+(use-package ace-jump-mode
+  :bind (("C-\\" . ace-jump-mode))
+  :config
+  (progn
+    (setq ace-jump-mode-scope 'window)))
+
+(use-package achievements-mode
+  :commands achievements-mode)
+
+(use-package clippy
+  :commands clippy-describe-function)
+
+(use-package elwm
+  :bind (("M-o" . elwm-activate-window)
+         ("M-O" . elwm-transpose-window)
+         ("C-M-o" . elwm-rotate-window)
+         ("C-x C-2" . elwm-split-window))
+  :init
+  (progn
+    (add-hook 'dired-mode-hook (lambda () (bind-key "M-o" 'elwm-activate-window dired-mode-map))))
+  :config
+  (progn
+    (unbind-key "C-x o")))
+
+(use-package expand-region
+  :bind ("s-'" . er/expand-region))
+
+(use-package google-maps
+  :commands google-maps)
+
+(use-package jump-char
+  :bind (("M-m" . jump-char-forward)))
+
+(use-package keyadvice
+  :commands keyadvice-mode)
+
+(use-package keyfreq
+  :bind ("C-. C-k" . keyfreq-show)
+  :config
+  (progn
+    ;; hack to make nicer format in keyfreq-show
+    (defun keyfreq-format-list (list &optional func)
+      "Returns formatted string with command usage statistics.
+
+The LIST is the `keyfreq-table' converted to a list using the `keyfreq-list'.
+
+If FUNC is nil each line contains number of times command was
+called and the command; if it is t percentage usage is added in
+the middle; if it is 'raw each line will contain number an
+command separated by single line (with no formatting) otherwise
+FUNC must be a function returning a string which will be called
+for each entry with three arguments: number of times command was
+called, percentage usage and the command."
+      (let* ((sum (car list)))
+        (mapconcat
+         (cond
+          ((not func) (lambda (e) (format "%7d  %s\n" (cdr e) (car e))))
+          ((equal func t)
+           (lambda (e) (format "%7d  %6.2f%% %10s %s\n"
+                               (cdr e) (/ (* 1e2 (cdr e)) sum) (key-description (where-is-internal (car e) nil t)) (car e))))
+          ((equal func 'raw) (lambda (e) (format "%d %s\n" (cdr e) (car e))))
+          (t (lambda (e) (funcall func (cdr e) (/ (* 1e2 (cdr e)) sum) (car e)))))
+         (cdr list) "")))))
+
+(use-package letcheck
+  :commands letcheck-mode)
+
+(use-package revbufs
+  :bind ("C-<f5>" . revbufs))
+
+(use-package smartparens
+  :init
+  (progn
+    (load "~/.emacs.d/files/smartparens")))
+
+(use-package smex
+  :init
+  (progn
+    (bind-key "M-x" 'beautify-smex)
+    (bind-key "M-X" 'smex-major-mode-commands)
+    ;; This is your old M-x.
+    (bind-key "C-c C-c M-x" 'execute-extended-command)
+
+    (defun beautify-smex ()
+      (interactive)
+      (unwind-protect
+          (progn
+            (setq ido-decorations
+                  '("{" "}" " | " " | ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]"))
+            (smex))
+        (setq ido-decorations
+              '("\n-> " "" "\n   " "\n   ..." "[" "]" " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))))
+  :config
+  (progn
+    (defun smex-update-after-load (unused)
+      (when (boundp 'smex-cache)
+        (smex-update)))
+    (add-hook 'after-load-functions 'smex-update-after-load)
+
+    (defun smex-prepare-ido-bindings ()
+      (define-key ido-completion-map (kbd "C-h f") 'smex-describe-function)
+      (define-key ido-completion-map (kbd "C-h w") 'smex-where-is)
+      (define-key ido-completion-map (kbd "M-.") 'smex-find-function)
+      (define-key ido-completion-map (kbd "C-a") 'move-beginning-of-line)
+      (define-key ido-completion-map (kbd "=") "-"))))
+
+(use-package wc-mode
+  :commands wc-mode)
+
+(use-package "world-time-mode"
+  :bind ("C-. t" . world-time-list))
+
+(use-package yasnippet
+  :diminish yas-minor-mode
+  :commands (yas-minor-mode yas-expand)
+  :config
+  (progn
+    (require 'dropdown-list)
+
+    (yas-global-mode 1)
+
+    (setq yas-snippet-dirs '("~/.emacs.d/vendor/yasnippet/snippets"))
+
+    (setq yas-prompt-functions '(yas-ido-prompt))
+
+    (defun my-yas-startup ()
+      ;; stupid yasnippet :/ we define <tab> behaviour elsewhere
+      (define-key yas-minor-mode-map [(tab)] nil)
+      (define-key yas-minor-mode-map (kbd "TAB") nil))
+
+    ;; Replace yasnippets's TAB
+    (add-hook 'yas-minor-mode-hook 'my-yas-startup) ; was yas/expand
+    ))
 ;; add load paths
 (add-to-list 'load-path "~/.emacs.d")
 (add-to-list 'load-path "~/.emacs.d/vendor")
+(add-to-list 'load-path "~/.emacs.d/site-lisp")
+(mapc (apply-partially 'add-to-list 'load-path) (f-directories "~/.emacs.d/vendor"))
 
 ;; add repos
 (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                          ("marmalade" . "http://marmalade-repo.org/packages/")
                          ("melpa" . "http://melpa.milkbox.net/packages/")))
+(require 'autoinstall)
 (package-initialize)
-(require 'autoinstall)
+
+(require 'use-package)
 (require 'parenface)
-(projectile-global-mode t)
-
-(load "files/defuns") ;; for vendor
-(vendor 'use-package)
-(recentf-mode t)
-
-(vendor 'keyadvice)
+(require 'uniquify)
+(require 'dash)
+(require 'f)
+(require 's)
 
 ;; autoloads
 (autoload 'calc-same-interface "calc" nil t)
 (autoload 'zap-up-to-char "misc"
   "Kill up to, but not including ARGth occurrence of CHAR." t)
 
+;; load site lisp
+(mapc 'load (f-files "~/.emacs.d/site-lisp/"))
+
+;; load settings
+(load "files/global")
+(load "files/layouts")
+(load "files/mode-line")
+(load "files/tabs")
+(load "files/windows")
+
 ;; load config files
-(load "files/layouts")
-(load "files/org-mode")
-(load "files/global")
-(load "files/defuns-edit")
-(load "files/defuns-buffer")
-(load "files/defuns-macros")
-(load "files/advices")
-(load "files/macros")
-(load "files/keys")
-(load "files/isearch")
-(load "files/tabs")
-(load "files/ido")
-(load "files/ispell")
-(load "files/dired-setup")
-(load "files/markdown")
-(load "files/tramp")
-(load "files/ibuffer")
-(load "files/undo-tree")
-(load "files/expand-region")
-(load "files/emacs-lisp-mode")
-(load "files/multi-web-mode")
-(load "files/latex-mode")
-(load "files/mode-line")
-(load "files/smex")
 (load "files/ack")
 (load "files/allout")