 (add-hook 'css-mode-hook  'set-custom-tab-behavior)
 
 ;; http://stackoverflow.com/questions/23692879/emacs24-backtab-is-undefined-how-to-define-this-shortcut-key
-(defun un-indent-by-removing-4-spaces ()
-  "remove 4 spaces from beginning of of line"
-  (interactive)
+(defun un-indent-by-removing-spaces (count)
+  "Remove COUNT spaces from beginning of line."
   (save-excursion
     (save-match-data
       (beginning-of-line)
       ;; get rid of tabs at beginning of line
       (when (looking-at "^\\s-+")
         (untabify (match-beginning 0) (match-end 0)))
-      (when (looking-at "^    ")
+      (when (looking-at (concat "^" (make-string count ?\s)))
         (replace-match "")))))
 
+(defun un-indent-by-removing-4-spaces ()
+  "Remove 4 spaces from beginning of line."
+  (interactive)
+  (un-indent-by-removing-spaces 4))
+
 (global-set-key (kbd "<backtab>") 'un-indent-by-removing-4-spaces)
+
+;; http://stackoverflow.com/questions/3417438/closing-all-other-buffers-in-emacs
+(defun kill-other-buffers ()
+  "Kill all other buffers."
+  (interactive)
+  (mapc 'kill-buffer
+        (delq (current-buffer)
+              (remove-if-not
+               '(lambda (x) (or (buffer-file-name x)
+                                (eq 'dired-mode (buffer-local-value 'major-mode x))))
+               (buffer-list)))))
+
+(global-set-key (kbd "C-c k") 'kill-other-buffers)
 
 ;; Folding
 (add-hook 'prog-mode-hook 'hs-minor-mode)

(require 'multiple-cursors)
(global-set-key (kbd "C-c <down>") 'mc/mmlte--down)
(global-set-key (kbd "C-c <up>")   'mc/mmlte--up)
(global-set-key (kbd "C-c l")      'mc/edit-lines)
(global-set-key (kbd "C-c d")      'mc/mark-next-like-this)
(global-set-key (kbd "C-c k")      'mc/skip-to-next-like-this)
(global-set-key (kbd "C-c u")      'mc/unmark-next-like-this)

(require 'whitespace)
(setq whitespace-style '(face empty lines-tail tabs tab-mark trailing))

(add-to-list 'command-switch-alist '("diff" . command-line-diff))

(defun command-line-merge (switch)
  "Add a SWITCH to invoke Emacs in merge mode."
  (let ((file1 (pop command-line-args-left))
        (file2 (pop command-line-args-left))
        (file3 (pop command-line-args-left))
