2013-01-28 23:51:04 +00:00
|
|
|
;; Regular shortcuts ==========================================================
|
|
|
|
|
2013-01-03 20:35:26 +00:00
|
|
|
;; evil -----------------------------------------------------------------------
|
2013-05-07 00:59:13 +00:00
|
|
|
;; returns to normal mode
|
2013-05-09 01:30:02 +00:00
|
|
|
(define-key evil-insert-state-map "f" 'fd-to-normal-mode)
|
|
|
|
(define-key evil-visual-state-map "f" 'fd-to-normal-mode)
|
|
|
|
(define-key evil-emacs-state-map "f" 'fd-to-normal-mode)
|
|
|
|
(define-key evil-motion-state-map "f" 'fd-to-normal-mode)
|
|
|
|
(define-key evil-normal-state-map "f" 'evil-find-char)
|
|
|
|
(define-key evil-operator-state-map "f" 'evil-find-char)
|
2013-01-03 20:35:26 +00:00
|
|
|
;;Make evil-mode up/down operate in screen lines instead of logical lines
|
|
|
|
(define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
|
|
|
|
(define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
|
2013-01-17 19:17:38 +00:00
|
|
|
|
|
|
|
;; evil-leader shortcuts ======================================================
|
|
|
|
|
2013-01-24 05:20:25 +00:00
|
|
|
;; M-x ------------------------------------------------------------------------
|
2013-03-14 04:40:23 +00:00
|
|
|
(evil-leader/set-key ":" 'execute-extended-command)
|
2013-02-03 20:59:45 +00:00
|
|
|
;; switch window by number ----------------------------------------------------
|
|
|
|
(evil-leader/set-key "0" 'select-window-0)
|
|
|
|
(evil-leader/set-key "1" 'select-window-1)
|
|
|
|
(evil-leader/set-key "2" 'select-window-2)
|
|
|
|
(evil-leader/set-key "3" 'select-window-3)
|
|
|
|
(evil-leader/set-key "4" 'select-window-4)
|
|
|
|
(evil-leader/set-key "5" 'select-window-5)
|
|
|
|
(evil-leader/set-key "6" 'select-window-6)
|
|
|
|
(evil-leader/set-key "7" 'select-window-7)
|
|
|
|
(evil-leader/set-key "8" 'select-window-8)
|
|
|
|
(evil-leader/set-key "9" 'select-window-9)
|
2013-01-17 19:17:38 +00:00
|
|
|
;; applications ---------------------------------------------------------------
|
2013-03-14 04:40:23 +00:00
|
|
|
(evil-leader/set-key "ad" 'dired)
|
2013-01-17 19:17:38 +00:00
|
|
|
(evil-leader/set-key "ae" 'erc-start-or-switch)
|
2013-02-20 01:00:38 +00:00
|
|
|
(evil-leader/set-key "ag" 'magit-status)
|
2013-01-17 19:17:38 +00:00
|
|
|
(evil-leader/set-key "am" 'mu4e-up-to-date-status)
|
2013-05-05 01:54:04 +00:00
|
|
|
(evil-leader/set-key "ap" 'proced)
|
2013-04-23 18:05:30 +00:00
|
|
|
(evil-leader/set-key "ase" 'eshell)
|
|
|
|
(evil-leader/set-key "asi" 'shell)
|
|
|
|
(evil-leader/set-key "ast" 'multi-term)
|
2013-01-17 19:17:38 +00:00
|
|
|
(evil-leader/set-key "at" 'twit)
|
2013-02-20 01:00:38 +00:00
|
|
|
(evil-leader/set-key "au" 'undo-tree-visualize)
|
2013-03-14 04:40:23 +00:00
|
|
|
(evil-leader/set-key "ay" 'helm-c-yas-complete)
|
2013-01-17 19:17:38 +00:00
|
|
|
;; buffers --------------------------------------------------------------------
|
2013-01-31 13:07:31 +00:00
|
|
|
(evil-leader/set-key "bd" 'delete-current-buffer-file)
|
2013-01-17 19:17:38 +00:00
|
|
|
(evil-leader/set-key "bk" 'ido-kill-buffer)
|
2013-02-06 15:43:36 +00:00
|
|
|
(evil-leader/set-key "bK" 'kill-other-buffers)
|
2013-04-16 22:08:52 +00:00
|
|
|
(evil-leader/set-key "bmh" 'buf-move-left)
|
|
|
|
(evil-leader/set-key "bmj" 'buf-move-down)
|
|
|
|
(evil-leader/set-key "bmk" 'buf-move-up)
|
|
|
|
(evil-leader/set-key "bml" 'buf-move-right)
|
2013-01-17 19:17:38 +00:00
|
|
|
(evil-leader/set-key "bn" 'switch-to-next-buffer)
|
|
|
|
(evil-leader/set-key "bp" 'switch-to-prev-buffer)
|
|
|
|
(evil-leader/set-key "br" 'rename-current-buffer-file)
|
2013-03-14 04:40:23 +00:00
|
|
|
(evil-leader/set-key "bs" 'helm-mini)
|
2013-02-07 16:36:01 +00:00
|
|
|
;; errors ---------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "en" 'next-error)
|
|
|
|
(evil-leader/set-key "ep" 'previous-error)
|
2013-05-05 02:22:19 +00:00
|
|
|
;; editors --------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "eds" 'string-edit-at-point)
|
2013-02-19 23:10:55 +00:00
|
|
|
;; find -----------------------------------------------------------------------
|
2013-03-14 15:39:16 +00:00
|
|
|
(evil-leader/set-key "ff" 'ido-find-file)
|
2013-05-09 14:15:49 +00:00
|
|
|
(evil-leader/set-key "fS" 'evil-write-all)
|
|
|
|
(evil-leader/set-key "fs" 'evil-write)
|
2013-01-17 19:17:38 +00:00
|
|
|
;; git ------------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "gs" 'magit-status)
|
2013-01-25 19:18:14 +00:00
|
|
|
;; auto-highlight-symbol ------------------------------------------------------
|
|
|
|
(evil-leader/set-key "he" 'ahs-edit-mode)
|
|
|
|
(evil-leader/set-key "hh" 'auto-highlight-symbol-mode)
|
|
|
|
(evil-leader/set-key "hn" 'ahs-forward)
|
|
|
|
(evil-leader/set-key "hp" 'ahs-backward)
|
2013-05-07 00:59:13 +00:00
|
|
|
;; insert stuff ---------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "ij" 'evil-insert-line-below)
|
|
|
|
(evil-leader/set-key "ik" 'evil-insert-line-above)
|
2013-05-06 17:53:06 +00:00
|
|
|
;; jump -----------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "jk" 'evil-join)
|
2013-05-22 01:52:33 +00:00
|
|
|
(evil-leader/set-key "ji" (lambda () (interactive)
|
|
|
|
(join-line 1) (paredit-newline)))
|
2013-05-06 17:53:06 +00:00
|
|
|
(evil-leader/set-key "jj" 'paredit-newline)
|
2013-05-06 18:00:52 +00:00
|
|
|
(evil-leader/set-key "ju" 'ace-jump-mode)
|
2013-03-25 02:00:15 +00:00
|
|
|
;; Lisps ----------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "lB" 'paredit-backward-barf-sexp)
|
|
|
|
(evil-leader/set-key "lb" 'paredit-forward-barf-sexp)
|
|
|
|
(evil-leader/set-key "lc" 'paredit-convolute-sexp)
|
|
|
|
(evil-leader/set-key "ld" 'paredit-kill)
|
|
|
|
(evil-leader/set-key "lJ" 'paredit-join-sexps)
|
|
|
|
(evil-leader/set-key "l C-j" 'paredit-split-sexp)
|
|
|
|
(evil-leader/set-key "lj" 'paredit-splice-sexp-killing-forward)
|
|
|
|
(evil-leader/set-key "lk" 'paredit-splice-sexp-killing-backward)
|
|
|
|
(evil-leader/set-key "lr" 'paredit-raise-sexp)
|
|
|
|
(evil-leader/set-key "lS" 'paredit-backward-slurp-sexp)
|
|
|
|
(evil-leader/set-key "ls" 'paredit-forward-slurp-sexp)
|
|
|
|
(evil-leader/set-key "lw" 'paredit-wrap-round)
|
2013-02-19 23:10:55 +00:00
|
|
|
;; major modes ----------------------------------------------------------------
|
|
|
|
;; Erlang
|
2013-04-17 14:16:18 +00:00
|
|
|
(evil-leader/set-key "Mec" 'edts-who-calls)
|
|
|
|
(evil-leader/set-key "Med" 'edts-find-doc)
|
|
|
|
(evil-leader/set-key "Mef" 'edts-find-source-under-point)
|
|
|
|
(evil-leader/set-key "Meg" 'edts-find-global-function)
|
|
|
|
(evil-leader/set-key "Meh" 'edts-find-header-source)
|
|
|
|
(evil-leader/set-key "Mel" 'edts-find-local-function)
|
|
|
|
(evil-leader/set-key "Mem" 'edts-find-macro-source)
|
|
|
|
(evil-leader/set-key "Mer" 'edts-find-record-source)
|
|
|
|
(evil-leader/set-key "Mex" 'edts-refactor-extract-function)
|
2013-03-13 04:11:01 +00:00
|
|
|
;; Html
|
|
|
|
(evil-leader/set-key "C-<right>" 'tagedit-forward-slurp-tag)
|
|
|
|
(evil-leader/set-key "C-<left>" 'tagedit-forward-barf-tag)
|
|
|
|
(evil-leader/set-key "M-r" 'tagedit-raise-tag)
|
|
|
|
(evil-leader/set-key "C-k" 'tagedit-kill)
|
|
|
|
(evil-leader/set-key "s-k" 'tagedit-kill-attribute)
|
|
|
|
;; Python
|
2013-04-17 14:16:18 +00:00
|
|
|
(evil-leader/set-key "Mp1" 'nosetests-one)
|
|
|
|
(evil-leader/set-key "Mp!" 'nosetests-pdb-one)
|
|
|
|
(evil-leader/set-key "Mpa" 'nosetests-all)
|
|
|
|
(evil-leader/set-key "MpA" 'nosetests-pdb-all)
|
|
|
|
(evil-leader/set-key "Mpb" 'python-add-breakpoint)
|
2013-04-18 19:00:41 +00:00
|
|
|
(evil-leader/set-key "Mpd" 'pylookup-lookup)
|
2013-04-17 14:16:18 +00:00
|
|
|
(evil-leader/set-key "Mpf" 'jedi:goto-definition)
|
|
|
|
(evil-leader/set-key "Mpm" 'nosetests-module)
|
|
|
|
(evil-leader/set-key "MpM" 'nosetests-pdb-module)
|
2013-01-29 15:28:06 +00:00
|
|
|
;; narrow & widen -------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "nr" 'narrow-to-region)
|
|
|
|
(evil-leader/set-key "np" 'narrow-to-page)
|
|
|
|
(evil-leader/set-key "nf" 'narrow-to-defun)
|
|
|
|
(evil-leader/set-key "nw" 'widen)
|
2013-01-28 17:29:17 +00:00
|
|
|
;; projectile -----------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "pb" 'projectile-switch-to-buffer)
|
|
|
|
(evil-leader/set-key "pC" 'projectile-invalidate-cache)
|
|
|
|
(evil-leader/set-key "pd" 'projectile-dired)
|
2013-03-14 04:40:23 +00:00
|
|
|
(evil-leader/set-key "pf" 'helm-projectile)
|
2013-01-28 17:29:17 +00:00
|
|
|
(evil-leader/set-key "pF" 'projectile-find-file)
|
|
|
|
(evil-leader/set-key "pk" 'projectile-kill-buffers)
|
|
|
|
(evil-leader/set-key "pg" 'projectile-grep)
|
|
|
|
(evil-leader/set-key "po" 'projectile-multi-occur)
|
|
|
|
(evil-leader/set-key "pr" 'projectile-replace)
|
2013-03-14 17:57:39 +00:00
|
|
|
;; perforce -------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "p4a" 'p4-add)
|
|
|
|
(evil-leader/set-key "p4d" 'p4-delete)
|
|
|
|
(evil-leader/set-key "p4D" 'p4-describe)
|
|
|
|
(evil-leader/set-key "p4e" 'p4-edit)
|
|
|
|
(evil-leader/set-key "p4r" 'p4-revert)
|
2013-03-15 03:04:57 +00:00
|
|
|
;; quickrun -------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "qba" 'quickrun-arg)
|
|
|
|
(evil-leader/set-key "qbc" 'quickrun-compile-only)
|
|
|
|
(evil-leader/set-key "qbs" 'quickrun-shell)
|
|
|
|
(evil-leader/set-key "qbx" 'quickrun)
|
2013-03-20 02:43:17 +00:00
|
|
|
(evil-leader/set-key "qeb" 'eval-buffer)
|
|
|
|
(evil-leader/set-key "qex" 'eval-last-sexp)
|
|
|
|
(evil-leader/set-key "qh" 'helm-quickrun)
|
2013-03-15 03:04:57 +00:00
|
|
|
(evil-leader/set-key "qrr" 'quickrun-replace-region)
|
|
|
|
(evil-leader/set-key "qrx" 'quickrun-region)
|
2013-05-05 02:22:19 +00:00
|
|
|
;; replace --------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "rR" 'vr/query-replace)
|
|
|
|
(evil-leader/set-key "rr" 'vr/replace)
|
2013-01-31 15:05:57 +00:00
|
|
|
;; toggle ---------------------------------------------------------------------
|
2013-04-23 19:56:44 +00:00
|
|
|
(evil-leader/set-key "t8" 'toggle-fill-column-indicator)
|
|
|
|
(evil-leader/set-key "ta" 'auto-complete-mode)
|
|
|
|
(evil-leader/set-key "tf" 'fringe-mode)
|
|
|
|
(evil-leader/set-key "th" 'auto-highlight-symbol-mode)
|
|
|
|
(evil-leader/set-key "tn" 'global-linum-mode)
|
2013-04-15 15:12:39 +00:00
|
|
|
(evil-leader/set-key "ttd" 'load-theme-day)
|
|
|
|
(evil-leader/set-key "ttn" 'load-theme-night)
|
2013-02-13 21:23:13 +00:00
|
|
|
;; selection ------------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "v" 'er/expand-region)
|
2013-02-06 15:43:36 +00:00
|
|
|
;; window ---------------------------------------------------------------------
|
2013-01-28 03:12:24 +00:00
|
|
|
(evil-leader/set-key "wb" 'evenly-split-window-right)
|
2013-01-17 19:17:38 +00:00
|
|
|
(evil-leader/set-key "wc" 'delete-window)
|
|
|
|
(evil-leader/set-key "wd" 'toggle-current-window-dedication)
|
2013-03-20 18:40:30 +00:00
|
|
|
(evil-leader/set-key "wH" 'evil-window-move-far-left)
|
2013-04-25 15:20:51 +00:00
|
|
|
(evil-leader/set-key "wh" 'evil-window-left)
|
2013-03-20 18:40:30 +00:00
|
|
|
(evil-leader/set-key "wJ" 'evil-window-move-very-bottom)
|
2013-04-25 15:20:51 +00:00
|
|
|
(evil-leader/set-key "wj" 'evil-window-down)
|
2013-03-20 18:40:30 +00:00
|
|
|
(evil-leader/set-key "wK" 'evil-window-move-very-top)
|
2013-04-25 15:20:51 +00:00
|
|
|
(evil-leader/set-key "wk" 'evil-window-up)
|
2013-03-20 18:40:30 +00:00
|
|
|
(evil-leader/set-key "wL" 'evil-window-move-far-right)
|
2013-04-25 15:20:51 +00:00
|
|
|
(evil-leader/set-key "wl" 'evil-window-right)
|
2013-02-20 19:08:23 +00:00
|
|
|
(evil-leader/set-key "wm" 'toggle-maximize-buffer)
|
2013-01-17 19:17:38 +00:00
|
|
|
(evil-leader/set-key "wr" 'rotate-windows)
|
2013-02-19 23:10:55 +00:00
|
|
|
(evil-leader/set-key "wR" 'rotate-windows-backward)
|
2013-01-28 03:12:24 +00:00
|
|
|
(evil-leader/set-key "wv" 'evenly-split-window-below)
|
2013-04-25 15:20:51 +00:00
|
|
|
(evil-leader/set-key "wsh" 'shrink-window-horizontally)
|
|
|
|
(evil-leader/set-key "wsj" 'shrink-window)
|
|
|
|
(evil-leader/set-key "wsk" 'enlarge-window)
|
|
|
|
(evil-leader/set-key "wsl" 'enlarge-window-horizontally)
|
2013-06-02 01:57:28 +00:00
|
|
|
(evil-leader/set-key "wU" 'winner-redo)
|
|
|
|
(evil-leader/set-key "wu" 'winner-undo)
|
2013-01-28 23:51:04 +00:00
|
|
|
(evil-leader/set-key "ww" 'other-window)
|
2013-02-20 19:08:23 +00:00
|
|
|
;; window layout splitter -----------------------------------------------------
|
2013-04-25 15:33:05 +00:00
|
|
|
(evil-leader/set-key "wy0" 'select-window-0)
|
|
|
|
(evil-leader/set-key "wy1" 'select-window-1)
|
|
|
|
(evil-leader/set-key "wy2" 'select-window-2)
|
|
|
|
(evil-leader/set-key "wy3" 'select-window-3)
|
|
|
|
(evil-leader/set-key "wy4" 'select-window-4)
|
|
|
|
(evil-leader/set-key "wy5" 'select-window-5)
|
|
|
|
(evil-leader/set-key "wy6" 'select-window-6)
|
|
|
|
(evil-leader/set-key "wy7" 'select-window-7)
|
|
|
|
(evil-leader/set-key "wy8" 'select-window-8)
|
|
|
|
(evil-leader/set-key "wy9" 'select-window-9)
|
2013-02-20 19:08:23 +00:00
|
|
|
;; text -----------------------------------------------------------------------
|
2013-04-25 18:02:41 +00:00
|
|
|
(evil-leader/set-key "xdw" 'delete-trailing-whitespace)
|
2013-04-22 00:59:26 +00:00
|
|
|
(evil-leader/set-key "xgT" 'google-translate-query-translate)
|
|
|
|
(evil-leader/set-key "xgt" 'google-translate-at-point)
|
|
|
|
(evil-leader/set-key "xgR" 'google-translate-query-translate-reverse)
|
|
|
|
(evil-leader/set-key "xgr" 'google-translate-at-point-reverse)
|
2013-04-25 18:02:41 +00:00
|
|
|
(evil-leader/set-key "xmj" 'move-text-down)
|
|
|
|
(evil-leader/set-key "xmk" 'move-text-up)
|
2013-02-19 23:10:55 +00:00
|
|
|
(evil-leader/set-key "xtc" 'transpose-chars)
|
|
|
|
(evil-leader/set-key "xtl" 'transpose-lines)
|
|
|
|
(evil-leader/set-key "xtw" 'transpose-words)
|
2013-01-17 19:17:38 +00:00
|
|
|
;; centered cursor ------------------------------------------------------------
|
|
|
|
(evil-leader/set-key "zz" 'global-centered-cursor-mode)
|
2012-12-18 05:48:12 +00:00
|
|
|
|
2013-01-04 06:40:59 +00:00
|
|
|
(provide 'my-keybindings)
|