Major update + cleanup
This commit is contained in:
parent
51589eb7a1
commit
bea393083c
29 changed files with 388 additions and 358 deletions
7
Cask
7
Cask
|
@ -87,8 +87,9 @@
|
||||||
(depends-on "ido-ubiquitous")
|
(depends-on "ido-ubiquitous")
|
||||||
(depends-on "ido-vertical-mode")
|
(depends-on "ido-vertical-mode")
|
||||||
(depends-on "flx-ido")
|
(depends-on "flx-ido")
|
||||||
(depends-on "perspective")
|
(depends-on "workgroups2")
|
||||||
(depends-on "persp-projectile")
|
;;(depends-on "persp-mode")
|
||||||
|
;;(depends-on "persp-projectile")
|
||||||
(depends-on "xcscope")
|
(depends-on "xcscope")
|
||||||
;;(depends-on "grizzl")
|
;;(depends-on "grizzl")
|
||||||
|
|
||||||
|
@ -111,6 +112,7 @@
|
||||||
(depends-on "swift-mode")
|
(depends-on "swift-mode")
|
||||||
;; (depends-on "haxe-mode")
|
;; (depends-on "haxe-mode")
|
||||||
;; (depends-on "go-mode" :git "https://github.com/dominikh/go-mode.el")
|
;; (depends-on "go-mode" :git "https://github.com/dominikh/go-mode.el")
|
||||||
|
(depends-on "go-mode")
|
||||||
|
|
||||||
(depends-on "php-mode")
|
(depends-on "php-mode")
|
||||||
(depends-on "php-refactor-mode")
|
(depends-on "php-refactor-mode")
|
||||||
|
@ -146,3 +148,4 @@
|
||||||
|
|
||||||
(depends-on "rust-mode")
|
(depends-on "rust-mode")
|
||||||
(depends-on "d-mode")
|
(depends-on "d-mode")
|
||||||
|
(depends-on "android-mode")
|
||||||
|
|
|
@ -30,8 +30,15 @@
|
||||||
(sp-with-modes '(json-mode js2-mode ruby-mode enh-ruby-mode python-mode)
|
(sp-with-modes '(json-mode js2-mode ruby-mode enh-ruby-mode python-mode)
|
||||||
(sp-local-pair "[" nil :post-handlers '(("||\n[i]" "RET"))))
|
(sp-local-pair "[" nil :post-handlers '(("||\n[i]" "RET"))))
|
||||||
|
|
||||||
(sp-with-modes '(java-mode c++-mode c-mode)
|
(sp-with-modes '(c-mode c++-mode objc-mode java-mode scss-mode css-mode php-mode)
|
||||||
(sp-local-pair "/**" "*/" :post-handlers '(("* ||\n[i]" "RET"))))
|
(sp-local-pair "/* " " */" :post-handlers '(("||\n[i]" "RET")))
|
||||||
|
(sp-local-pair "/**" "*/" :post-handlers '(("||\n[i]" "RET"))))
|
||||||
|
|
||||||
|
(sp-with-modes '(objc-mode scss-mode css-mode)
|
||||||
|
(sp-local-pair "/*\n" "\n */" :post-handlers '(("||[i]" "RET"))))
|
||||||
|
|
||||||
|
(sp-with-modes '(c-mode c++-mode php-mode java-mode)
|
||||||
|
(sp-local-pair "/*" "" :post-handlers '((" ||\n[i]*/" "RET"))))
|
||||||
|
|
||||||
(after "yasnippet"
|
(after "yasnippet"
|
||||||
(defadvice yas-expand (before advice-for-yas-expand activate)
|
(defadvice yas-expand (before advice-for-yas-expand activate)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq evil-want-visual-char-semi-exclusive t
|
(setq evil-want-visual-char-semi-exclusive t
|
||||||
evil-search-module 'evil-search
|
evil-search-module 'isearch
|
||||||
evil-search-wrap nil
|
evil-search-wrap nil
|
||||||
evil-magic 'magic
|
evil-magic 'magic
|
||||||
evil-want-C-u-scroll t ; enable C-u for scrolling
|
evil-want-C-u-scroll t ; enable C-u for scrolling
|
||||||
|
@ -83,15 +83,21 @@
|
||||||
(setq evil-snipe-override-evil t)
|
(setq evil-snipe-override-evil t)
|
||||||
(setq evil-snipe-scope 'visible)
|
(setq evil-snipe-scope 'visible)
|
||||||
(setq evil-snipe-repeat-scope 'buffer)
|
(setq evil-snipe-repeat-scope 'buffer)
|
||||||
|
(setq evil-snipe-override-evil-repeat-keys nil)
|
||||||
(setq-default evil-snipe-symbol-groups
|
(setq-default evil-snipe-symbol-groups
|
||||||
'((?\[ "[[{(]")
|
'((?\[ "[[{(]")
|
||||||
(?\] "[]})]")))
|
(?\] "[]})]")))
|
||||||
|
|
||||||
(bind 'visual "z" 'evil-snipe-s)
|
(bind 'motion
|
||||||
(bind 'visual "Z" 'evil-snipe-S)))
|
"C-;" 'evil-snipe-repeat
|
||||||
|
"C-," 'evil-snipe-repeat-reverse
|
||||||
|
|
||||||
(use-package evil-visualstar))
|
'visual
|
||||||
|
"z" 'evil-snipe-s
|
||||||
|
"Z" 'evil-snipe-S)))
|
||||||
|
|
||||||
|
(use-package evil-visualstar
|
||||||
|
:config (global-evil-visualstar-mode 1)))
|
||||||
|
|
||||||
(bind evil-ex-completion-map
|
(bind evil-ex-completion-map
|
||||||
"C-r" #'evil-ex-paste-from-register ; registers in ex-mode
|
"C-r" #'evil-ex-paste-from-register ; registers in ex-mode
|
||||||
|
@ -178,24 +184,6 @@
|
||||||
file-name))
|
file-name))
|
||||||
|
|
||||||
(progn ; ex-commands
|
(progn ; ex-commands
|
||||||
(evil-ex-define-cmd "full[scr]" 'toggle-frame-fullscreen)
|
|
||||||
(evil-ex-define-cmd "k[ill]" 'kill-this-buffer) ; Kill current buffer
|
|
||||||
(evil-ex-define-cmd "k[ill]o" 'my-cleanup-buffers) ; Kill current project buffers
|
|
||||||
(evil-ex-define-cmd "k[ill]all" 'my:kill-buffers) ; Kill all buffers (bang = project buffers only)
|
|
||||||
(evil-ex-define-cmd "k[ill]buried" 'my:kill-buried-buffers) ; Kill all buffers (bang = project buffers only)
|
|
||||||
(evil-ex-define-cmd "ini" 'my:init-files)
|
|
||||||
(evil-ex-define-cmd "n[otes]" 'my:notes)
|
|
||||||
(evil-ex-define-cmd "recompile" 'my:byte-compile)
|
|
||||||
(evil-ex-define-cmd "cd" 'my:cd)
|
|
||||||
(evil-ex-define-cmd "en[ew]" 'my:create-file)
|
|
||||||
(evil-ex-define-cmd "ren[ame]" 'my:rename-this-file) ; Rename file . Bang: Delete old one
|
|
||||||
(evil-ex-define-cmd "al[ign]" 'my:align)
|
|
||||||
(evil-ex-define-cmd "retab" 'my:retab)
|
|
||||||
(evil-ex-define-cmd "sq[uint]" 'my:narrow-indirect) ; Narrow buffer to selection
|
|
||||||
(evil-ex-define-cmd "x" 'my:scratch-buffer)
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(evil-define-command my:kill-buffers (&optional bang)
|
(evil-define-command my:kill-buffers (&optional bang)
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<!>")
|
(interactive "<!>")
|
||||||
|
@ -278,7 +266,7 @@ provided."
|
||||||
(message "File '%s' successfully renamed to '%s'"
|
(message "File '%s' successfully renamed to '%s'"
|
||||||
name (file-name-nondirectory new-name)))))))
|
name (file-name-nondirectory new-name)))))))
|
||||||
|
|
||||||
(evil-define-operator my:scratch-buffer (beg end &optional bang)
|
(evil-define-operator my:scratch-buffer (&optional beg end bang)
|
||||||
"Send a selection to the scratch buffer. If BANG, then send it to org-capture
|
"Send a selection to the scratch buffer. If BANG, then send it to org-capture
|
||||||
instead."
|
instead."
|
||||||
:move-point nil
|
:move-point nil
|
||||||
|
|
|
@ -11,13 +11,6 @@
|
||||||
(setq mac-command-modifier 'meta)
|
(setq mac-command-modifier 'meta)
|
||||||
(setq mac-option-modifier 'alt)
|
(setq mac-option-modifier 'alt)
|
||||||
|
|
||||||
;; Restore text nav keys
|
|
||||||
(bind (kbd "<A-left>") 'backward-word
|
|
||||||
(kbd "<A-right>") 'forward-word
|
|
||||||
(kbd "M-a") 'mark-whole-buffer
|
|
||||||
(kbd "M-v") 'evil-paste-after
|
|
||||||
(kbd "M-s") 'save-buffer)
|
|
||||||
|
|
||||||
;; fix emacs PATH on OSX (GUI only)
|
;; fix emacs PATH on OSX (GUI only)
|
||||||
(use-package exec-path-from-shell
|
(use-package exec-path-from-shell
|
||||||
:if (memq window-system '(mac ns))
|
:if (memq window-system '(mac ns))
|
||||||
|
|
|
@ -37,7 +37,11 @@
|
||||||
(when (functionp 'menu-bar-mode) (menu-bar-mode -1)) ; no menubar
|
(when (functionp 'menu-bar-mode) (menu-bar-mode -1)) ; no menubar
|
||||||
(when (fboundp 'fringe-mode) (fringe-mode '(5 . 10))) ; no nonsense
|
(when (fboundp 'fringe-mode) (fringe-mode '(5 . 10))) ; no nonsense
|
||||||
|
|
||||||
(when window-system (setq frame-title-format '(buffer-file-name "%f" ("%b"))))
|
(when window-system
|
||||||
|
(setq frame-title-format '(buffer-file-name "%f" ("%b")))
|
||||||
|
(if (string-equal (system-name) "io")
|
||||||
|
(set-frame-size (selected-frame) 326 119)))
|
||||||
|
|
||||||
|
|
||||||
;;;; Modeline ;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;; Modeline ;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(use-package uniquify
|
(use-package uniquify
|
||||||
|
@ -51,16 +55,18 @@
|
||||||
(mapconcat 'identity
|
(mapconcat 'identity
|
||||||
'(" SP"
|
'(" SP"
|
||||||
" Fill"
|
" Fill"
|
||||||
" yas"
|
|
||||||
" Fly"
|
|
||||||
" EvilOrg"
|
" EvilOrg"
|
||||||
" Abbrev"
|
" Abbrev"
|
||||||
|
" snipe"
|
||||||
|
" company"
|
||||||
|
" Anaconda"
|
||||||
" WS"
|
" WS"
|
||||||
" GitGutter"
|
" GitGutter"
|
||||||
" Undo-Tree"
|
" Undo-Tree"
|
||||||
" Projectile\\[.+\\]"
|
" Projectile\\[.+\\]"
|
||||||
" hs"
|
" hs"
|
||||||
" ElDoc"
|
" ElDoc"
|
||||||
|
" wg"
|
||||||
) "\\|"))
|
) "\\|"))
|
||||||
:init
|
:init
|
||||||
(progn
|
(progn
|
||||||
|
|
34
core/core.el
34
core/core.el
|
@ -1,5 +1,7 @@
|
||||||
(defconst is-mac (eq system-type 'darwin))
|
(defconst is-mac (eq system-type 'darwin))
|
||||||
(defconst is-linux (eq system-type 'gnu/linux))
|
(defconst is-linux (eq system-type 'gnu/linux))
|
||||||
|
(defconst is-windows (or (eq system-type 'ms-dos)
|
||||||
|
(eq system-type 'windows-nt)))
|
||||||
|
|
||||||
(when is-linux (add-to-list 'load-path "~/.cask"))
|
(when is-linux (add-to-list 'load-path "~/.cask"))
|
||||||
(setq use-package-verbose DEBUG-MODE)
|
(setq use-package-verbose DEBUG-MODE)
|
||||||
|
@ -153,19 +155,16 @@
|
||||||
(setq delete-trailing-lines nil)
|
(setq delete-trailing-lines nil)
|
||||||
(add-hook 'makefile-mode-hook 'indent-tabs-mode) ; Use normal tabs in makefiles
|
(add-hook 'makefile-mode-hook 'indent-tabs-mode) ; Use normal tabs in makefiles
|
||||||
;; Make sure scratch buffer is always "in a project"
|
;; Make sure scratch buffer is always "in a project"
|
||||||
(add-hook 'find-file-hook
|
(defun set-project-scratch-buffer ()
|
||||||
(lambda()
|
(let ((buffer (get-buffer "*scratch*"))
|
||||||
(let ((buffer (get-buffer "*scratch*"))
|
(pwd (my--project-root)))
|
||||||
(pwd (my--project-root)))
|
(when (buffer-live-p buffer)
|
||||||
(when (buffer-live-p buffer)
|
(save-window-excursion
|
||||||
(save-window-excursion
|
(switch-to-buffer buffer)
|
||||||
(switch-to-buffer buffer)
|
(unless (eq (my--project-root) pwd)
|
||||||
(unless (eq (my--project-root) pwd)
|
(cd pwd)
|
||||||
(cd pwd)
|
(rename-buffer (format "*scratch* (%s)" (file-name-nondirectory (directory-file-name pwd)))))))))
|
||||||
(rename-buffer (format "*scratch* (%s)" (file-name-base (directory-file-name pwd))))))))))
|
(add-hook 'find-file-hook 'set-project-scratch-buffer)
|
||||||
|
|
||||||
;; My own minor mode!
|
|
||||||
(define-minor-mode my-mode :global t :keymap (make-sparse-keymap))
|
|
||||||
|
|
||||||
|
|
||||||
;;;; Behavior adjustments ;;;;;;;;;;;;;;;;
|
;;;; Behavior adjustments ;;;;;;;;;;;;;;;;
|
||||||
|
@ -235,10 +234,7 @@
|
||||||
;;;; Start the party ;;;;;;;;;;;;;;;;;;;
|
;;;; Start the party ;;;;;;;;;;;;;;;;;;;
|
||||||
(if is-mac (require 'core-osx))
|
(if is-mac (require 'core-osx))
|
||||||
;; (if is-linux (require 'core-linux))
|
;; (if is-linux (require 'core-linux))
|
||||||
|
;; (if is-windows (require 'core-windows))
|
||||||
(require 'core-ui)
|
|
||||||
(require 'core-evil)
|
|
||||||
(require 'core-editor)
|
|
||||||
|
|
||||||
(use-package server
|
(use-package server
|
||||||
:config
|
:config
|
||||||
|
|
|
@ -117,7 +117,11 @@ spaces on either side of the point if so. Resorts to
|
||||||
((sp-point-in-comment)
|
((sp-point-in-comment)
|
||||||
(cond ((eq major-mode 'js2-mode)
|
(cond ((eq major-mode 'js2-mode)
|
||||||
(js2-line-break))
|
(js2-line-break))
|
||||||
((-contains? '(c-mode c++-mode objc-mode java-mode) major-mode)
|
((-contains? '(java-mode php-mode) major-mode)
|
||||||
(c-indent-new-comment-line))
|
(c-indent-new-comment-line))
|
||||||
|
((-contains? '(c-mode c++-mode objc-mode css-mode scss-mode) major-mode)
|
||||||
|
(newline-and-indent)
|
||||||
|
(insert "* ")
|
||||||
|
(indent-according-to-mode))
|
||||||
(t (indent-new-comment-line))))
|
(t (indent-new-comment-line))))
|
||||||
(t (newline-and-indent))))
|
(t (newline-and-indent))))
|
||||||
|
|
|
@ -61,34 +61,31 @@ the checking happens for all pairs in auto-minor-mode-alist"
|
||||||
|
|
||||||
|
|
||||||
;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defun bind (state &rest keys)
|
(defun bind (&rest keys)
|
||||||
(let ((state-list state)
|
(let (state-list keymap key def)
|
||||||
(is-global (or (stringp state)
|
|
||||||
(vectorp state)))
|
|
||||||
keymap)
|
|
||||||
(if is-global
|
|
||||||
(setq keys (-insert-at 0 state keys))
|
|
||||||
(progn
|
|
||||||
(if (keymapp (car keys))
|
|
||||||
(setq keymap (pop keys)))
|
|
||||||
(if (or (keymapp state)
|
|
||||||
(not (listp state)))
|
|
||||||
(setq state-list (list state)))))
|
|
||||||
(while keys
|
(while keys
|
||||||
(let ((-key (pop keys))
|
(setq key (pop keys))
|
||||||
(-def (pop keys)))
|
(cond ((keymapp key)
|
||||||
(if (stringp -key)
|
(setq keymap key))
|
||||||
(setq -key (kbd -key)))
|
((or (evil-state-p key)
|
||||||
(if is-global
|
(and (listp key) (evil-state-p (car key))))
|
||||||
(global-set-key -key -def)
|
(setq state-list key))
|
||||||
(dolist (-state state-list)
|
(t
|
||||||
(cond ((evil-state-p -state)
|
(if (stringp key)
|
||||||
(define-key
|
(setq key (kbd key)))
|
||||||
(if keymap
|
(setq def (pop keys))
|
||||||
(evil-get-auxiliary-keymap keymap -state t)
|
(when (null def)
|
||||||
(evil-state-property -state :keymap t)) -key -def))
|
(user-error "No definition for '%s' keybinding" key))
|
||||||
((keymapp -state)
|
(if (null state-list)
|
||||||
(define-key -state -key -def)))))))))
|
(if (null keymap)
|
||||||
|
(global-set-key key def)
|
||||||
|
(define-key keymap key def))
|
||||||
|
(unless (listp state-list)
|
||||||
|
(setq state-list (list state-list)))
|
||||||
|
(dolist (state state-list)
|
||||||
|
(define-key (if keymap
|
||||||
|
(evil-get-auxiliary-keymap keymap state t)
|
||||||
|
(evil-state-property state :keymap t)) key def))))))))
|
||||||
|
|
||||||
(after "evil"
|
(after "evil"
|
||||||
(evil-define-command my--maybe-exit-insert-mode ()
|
(evil-define-command my--maybe-exit-insert-mode ()
|
||||||
|
|
|
@ -60,19 +60,9 @@ This is used by `global-hl-todo-mode'."
|
||||||
(defvar hl-todo-keywords nil)
|
(defvar hl-todo-keywords nil)
|
||||||
|
|
||||||
(defcustom hl-todo-keyword-faces
|
(defcustom hl-todo-keyword-faces
|
||||||
'(("HOLD" . "#d0bf8f")
|
'(("\\(\\bTODO\\((.*)\\)?:?\\)" . "#cc9393")
|
||||||
("TODO" . "#cc9393")
|
("\\(\\bNOTE\\((.*)\\)?:?\\)" . "#d0bf8f")
|
||||||
("NEXT" . "#dca3a3")
|
("\\(\\bFIXME\\((.*)\\)?:?\\)" . "#cc9393"))
|
||||||
("THEM" . "#dc8cc3")
|
|
||||||
("PROG" . "#7cb8bb")
|
|
||||||
("OKAY" . "#7cb8bb")
|
|
||||||
("DONT" . "#5f7f5f")
|
|
||||||
("FAIL" . "#8c5353")
|
|
||||||
("DONE" . "#afd8af")
|
|
||||||
("FIXME" . "#cc9393")
|
|
||||||
("XXX" . "#cc9393")
|
|
||||||
("XXXX" . "#cc9393")
|
|
||||||
("???" . "#cc9393"))
|
|
||||||
"Faces used to highlight specific TODO keywords."
|
"Faces used to highlight specific TODO keywords."
|
||||||
:group 'hl-todo
|
:group 'hl-todo
|
||||||
:type '(repeat (cons (string :tag "Keyword")
|
:type '(repeat (cons (string :tag "Keyword")
|
||||||
|
|
10
init.el
10
init.el
|
@ -50,6 +50,9 @@
|
||||||
(mapc 'require
|
(mapc 'require
|
||||||
;; ls init/{init,my}* | xargs basename | sed -e 's/\..*$//'
|
;; ls init/{init,my}* | xargs basename | sed -e 's/\..*$//'
|
||||||
'(core
|
'(core
|
||||||
|
core-ui ; aesthetics
|
||||||
|
core-evil ; evil-mode and its plugins
|
||||||
|
core-editor ; expand-region, rotate-text, smartparens
|
||||||
|
|
||||||
;; init-auto-complete
|
;; init-auto-complete
|
||||||
init-auto-insert ; for the lazy typis
|
init-auto-insert ; for the lazy typis
|
||||||
|
@ -74,7 +77,7 @@
|
||||||
init-java ; the poster child for carpal tunnel syndome
|
init-java ; the poster child for carpal tunnel syndome
|
||||||
init-js ; alert("not java, javascript!")
|
init-js ; alert("not java, javascript!")
|
||||||
init-lua ; zero-based indices? Zero-based indices.
|
init-lua ; zero-based indices? Zero-based indices.
|
||||||
;; init-org ; for fearless leader (who is organized)
|
;; init-org ; for fearless [organized] leader
|
||||||
init-php ; making php less painful to work with
|
init-php ; making php less painful to work with
|
||||||
init-python ; beautiful is better than ugly
|
init-python ; beautiful is better than ugly
|
||||||
init-regex ; /^[^\s](meaning)[^\n]*/
|
init-regex ; /^[^\s](meaning)[^\n]*/
|
||||||
|
@ -92,9 +95,10 @@
|
||||||
init-yasnippet ; type for me
|
init-yasnippet ; type for me
|
||||||
init-youtube ; tools for youtube vids
|
init-youtube ; tools for youtube vids
|
||||||
|
|
||||||
my-bindings
|
|
||||||
my-settings
|
|
||||||
my-defuns
|
my-defuns
|
||||||
|
my-bindings
|
||||||
|
my-commands
|
||||||
|
my-settings
|
||||||
))
|
))
|
||||||
|
|
||||||
;; I've created a monster!
|
;; I've created a monster!
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
;; (template "\\.lua$" "%%" 'lua-mode)
|
;; (template "\\.lua$" "%%" 'lua-mode)
|
||||||
|
|
||||||
;; ;; Java
|
;; ;; Java
|
||||||
;; (template "/src/.+/.+\\.java$ "%%" 'java-mode)
|
(template "/src/.+/.+\\.java$" "%%" 'java-mode)
|
||||||
;; (template "\\.gradle$" "%%" 'groovy-mode)
|
;; (template "\\.gradle$" "%%" 'groovy-mode)
|
||||||
|
|
||||||
;; ;; Elisp
|
;; ;; Elisp
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
(c-set-offset 'inclass 'my-c-lineup-inclass)
|
(c-set-offset 'inclass 'my-c-lineup-inclass)
|
||||||
|
|
||||||
;; DEL mapping interferes with smartparens and my.deflate-maybe
|
;; DEL mapping interferes with smartparens and my.deflate-maybe
|
||||||
(bind c-mode-map (kbd "DEL") nil))
|
(define-key c-mode-map (kbd "DEL") nil))
|
||||||
|
|
||||||
(add-hook 'c-mode-hook 'my-c/c++-settings)
|
(add-hook 'c-mode-hook 'my-c/c++-settings)
|
||||||
(add-hook 'c++-mode-hook 'my-c/c++-settings)
|
(add-hook 'c++-mode-hook 'my-c/c++-settings)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
(use-package company
|
(use-package company
|
||||||
:init
|
|
||||||
(global-company-mode 1)
|
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
|
(global-company-mode 1)
|
||||||
|
|
||||||
(setq company-idle-delay nil)
|
(setq company-idle-delay nil)
|
||||||
(setq company-minimum-prefix-length 1)
|
(setq company-minimum-prefix-length 1)
|
||||||
(setq company-show-numbers nil)
|
(setq company-show-numbers nil)
|
||||||
|
@ -101,8 +101,8 @@
|
||||||
(call-interactively 'company-dabbrev-code)
|
(call-interactively 'company-dabbrev-code)
|
||||||
(company-select-previous-or-abort))))
|
(company-select-previous-or-abort))))
|
||||||
|
|
||||||
|
(define-key company-active-map "C-w" nil)
|
||||||
(bind company-active-map
|
(bind company-active-map
|
||||||
"C-w" nil
|
|
||||||
"C-o" 'company-search-kill-others
|
"C-o" 'company-search-kill-others
|
||||||
"C-n" 'company-select-next-or-abort
|
"C-n" 'company-select-next-or-abort
|
||||||
"C-p" 'company-select-previous-or-abort
|
"C-p" 'company-select-previous-or-abort
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
(use-package hl-todo
|
||||||
|
:defer t
|
||||||
|
:init (add-hook 'after-change-major-mode-hook 'hl-todo-mode))
|
||||||
|
|
||||||
(use-package dash-at-point
|
(use-package dash-at-point
|
||||||
:if is-mac
|
:if is-mac
|
||||||
:commands (dash-at-point dash-at-point-with-docset))
|
:commands (dash-at-point dash-at-point-with-docset))
|
||||||
|
@ -23,26 +27,18 @@
|
||||||
|
|
||||||
(use-package emr
|
(use-package emr
|
||||||
:commands (emr-initialize emr-show-refactor-menu)
|
:commands (emr-initialize emr-show-refactor-menu)
|
||||||
:init (add-hook 'prog-mode-hook 'emr-initialize)
|
:init (add-hook 'prog-mode-hook 'emr-initialize)
|
||||||
:config
|
:config (bind popup-menu-keymap [escape] 'keyboard-quit))
|
||||||
(progn
|
|
||||||
(bind 'normal "gR" 'emr-show-refactor-menu)
|
|
||||||
(bind popup-menu-keymap [escape] 'keyboard-quit)
|
|
||||||
|
|
||||||
(after "evil" (evil-ex-define-cmd "ref[actor]" 'emr-show-refactor-menu))))
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Code building
|
;; Code building
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(bind my-mode-map "M-b" 'my:build)
|
|
||||||
|
|
||||||
(defvar my-build-command "make %s")
|
(defvar my-build-command "make %s")
|
||||||
(make-variable-buffer-local 'my-build-command)
|
(make-variable-buffer-local 'my-build-command)
|
||||||
(add-hook! 'enh-ruby-mode-hook (setq my-build-command "rake %s"))
|
(add-hook! 'enh-ruby-mode-hook (setq my-build-command "rake %s"))
|
||||||
|
|
||||||
(evil-ex-define-cmd "ma[ke]" 'my:build)
|
|
||||||
(evil-define-command my:build (arg)
|
(evil-define-command my:build (arg)
|
||||||
"Call a build command in the current directory.
|
"Call a build command in the current directory.
|
||||||
If ARG is nil this function calls `recompile', otherwise it calls
|
If ARG is nil this function calls `recompile', otherwise it calls
|
||||||
|
@ -65,20 +61,21 @@ If ARG is nil this function calls `recompile', otherwise it calls
|
||||||
:keep-visual t
|
:keep-visual t
|
||||||
:move-point nil
|
:move-point nil
|
||||||
(interactive "<r>")
|
(interactive "<r>")
|
||||||
(let ((interp (-my-get-interpreter)))
|
(cond ((eq major-mode 'emacs-lisp-mode)
|
||||||
(when interp (shell-command-on-region beg end interp))))
|
(eval-region beg end))
|
||||||
|
(t
|
||||||
|
(let ((interp (my--get-interpreter)))
|
||||||
|
(when interp (shell-command-on-region beg end interp))))))
|
||||||
|
|
||||||
(evil-define-command my:eval-buffer ()
|
(evil-define-command my:eval-buffer ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((interp (-my-get-interpreter)))
|
(cond ((eq major-mode 'emacs-lisp-mode)
|
||||||
(when interp (shell-command-on-region (point-min) (point-max) interp))))
|
(eval-buffer))
|
||||||
|
(t
|
||||||
|
(let ((interp (my--get-interpreter)))
|
||||||
|
(when interp (shell-command-on-region (point-min) (point-max) interp))))))
|
||||||
|
|
||||||
(bind 'motion "gr" 'my:eval-region
|
(defun my--get-interpreter ()
|
||||||
"M-r" 'my:eval-region)
|
|
||||||
(bind 'normal "gR" 'my:eval-buffer
|
|
||||||
"M-R" 'my:eval-buffer)
|
|
||||||
|
|
||||||
(defun -my-get-interpreter ()
|
|
||||||
(car (--first (eq (cdr it) major-mode) interpreter-mode-alist)))
|
(car (--first (eq (cdr it) major-mode) interpreter-mode-alist)))
|
||||||
|
|
||||||
(provide 'init-dev)
|
(provide 'init-dev)
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:defer t
|
|
||||||
:init
|
:init
|
||||||
(progn
|
(setq-default flycheck-indication-mode 'right-fringe
|
||||||
(setq-default flycheck-indication-mode 'right-fringe
|
;; Removed checks on idle/change for snappiness
|
||||||
;; Removed checks on idle/change for snappiness
|
flycheck-check-syntax-automatically '(save mode-enabled idle-change)
|
||||||
flycheck-check-syntax-automatically '(save mode-enabled)
|
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
|
||||||
flycheck-disabled-checkers '(emacs-lisp-checkdoc make))
|
:config
|
||||||
|
(progn ; flycheck settings
|
||||||
(dolist (hook '(ruby-mode-hook
|
(dolist (hook '(ruby-mode-hook
|
||||||
python-mode-hook
|
python-mode-hook
|
||||||
php-mode-hook
|
php-mode-hook
|
||||||
|
@ -15,9 +15,8 @@
|
||||||
c++-mode-hook
|
c++-mode-hook
|
||||||
c-mode-hook
|
c-mode-hook
|
||||||
))
|
))
|
||||||
(add-hook hook 'flycheck-mode)))
|
(add-hook hook 'flycheck-mode))
|
||||||
:config
|
|
||||||
(progn ; flycheck settings
|
|
||||||
(my--cleanup-buffers-add "^\\*Flycheck.*\\*$")
|
(my--cleanup-buffers-add "^\\*Flycheck.*\\*$")
|
||||||
|
|
||||||
(bind 'normal flycheck-error-list-mode-map
|
(bind 'normal flycheck-error-list-mode-map
|
||||||
|
@ -26,8 +25,6 @@
|
||||||
|
|
||||||
(evil-initial-state 'flycheck-error-list-mode 'emacs)
|
(evil-initial-state 'flycheck-error-list-mode 'emacs)
|
||||||
|
|
||||||
(evil-ex-define-cmd "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors)))
|
|
||||||
|
|
||||||
(defun my--evil-flycheck-buffer ()
|
(defun my--evil-flycheck-buffer ()
|
||||||
(if (and (featurep 'flycheck) flycheck-mode)
|
(if (and (featurep 'flycheck) flycheck-mode)
|
||||||
(flycheck-buffer)))
|
(flycheck-buffer)))
|
||||||
|
|
|
@ -27,10 +27,6 @@
|
||||||
(defadvice git-gutter+-process-diff (before git-gutter+-process-diff-advice activate)
|
(defadvice git-gutter+-process-diff (before git-gutter+-process-diff-advice activate)
|
||||||
(ad-set-arg 0 (file-truename (ad-get-arg 0))))
|
(ad-set-arg 0 (file-truename (ad-get-arg 0))))
|
||||||
|
|
||||||
(evil-ex-define-cmd "gstage" 'git-gutter+-stage-hunks)
|
|
||||||
(evil-ex-define-cmd "grevert" 'git-gutter+-revert-hunks)
|
|
||||||
(evil-ex-define-cmd "gdiff" 'git-gutter+-show-hunk)
|
|
||||||
|
|
||||||
(fringe-helper-define 'git-gutter-fr+-added nil
|
(fringe-helper-define 'git-gutter-fr+-added nil
|
||||||
"XX......"
|
"XX......"
|
||||||
"XX......"
|
"XX......"
|
||||||
|
|
|
@ -12,14 +12,6 @@
|
||||||
|
|
||||||
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
(my--cleanup-buffers-add "^\\*[Hh]elm.*\\*$")
|
||||||
|
|
||||||
(evil-ex-define-cmd "a" 'helm-projectile-find-other-file)
|
|
||||||
(evil-ex-define-cmd "proj[ect]" 'helm-projectile-switch-project)
|
|
||||||
(evil-ex-define-cmd "ag" 'my:helm-ag-search)
|
|
||||||
(evil-ex-define-cmd "agr" 'my:helm-ag-regex-search)
|
|
||||||
(evil-ex-define-cmd "ag[cw]d" 'my:helm-ag-search-cwd)
|
|
||||||
(evil-ex-define-cmd "agr[cw]d" 'my:helm-ag-regex-search-cwd)
|
|
||||||
(evil-ex-define-cmd "sw[oop]" 'my:helm-swoop)
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(use-package helm-ag
|
(use-package helm-ag
|
||||||
|
@ -192,7 +184,6 @@
|
||||||
|
|
||||||
;; Ex-mode interface for `helm-recentf' and `helm-projectile-recentf'. If
|
;; Ex-mode interface for `helm-recentf' and `helm-projectile-recentf'. If
|
||||||
;; `bang', then `search' is interpreted as regexp
|
;; `bang', then `search' is interpreted as regexp
|
||||||
(evil-ex-define-cmd "rec[ent]" 'my:helm-recentf)
|
|
||||||
(evil-define-command my:helm-recentf (&optional bang)
|
(evil-define-command my:helm-recentf (&optional bang)
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<!>")
|
(interactive "<!>")
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
(defun my-java-project-package ()
|
||||||
|
(if (eq major-mode 'java-mode)
|
||||||
|
(s-chop-suffix "." (s-replace "/" "." (f-dirname (f-relative (buffer-file-name)
|
||||||
|
(concat (my--project-root) "src/")))))
|
||||||
|
""))
|
||||||
|
|
||||||
|
(defun my-java-class-name ()
|
||||||
|
(if (eq major-mode 'java-mode)
|
||||||
|
(f-no-ext (f-base (buffer-file-name)))
|
||||||
|
""))
|
||||||
|
|
||||||
(use-package eclim
|
(use-package eclim
|
||||||
:commands (eclim-mode global-eclim-mode)
|
:commands (eclim-mode global-eclim-mode)
|
||||||
:config
|
:config
|
||||||
|
@ -18,18 +29,17 @@
|
||||||
|
|
||||||
(after "company"
|
(after "company"
|
||||||
(use-package company-emacs-eclim
|
(use-package company-emacs-eclim
|
||||||
:init (company-emacs-eclim-setup)))
|
:config (company-emacs-eclim-setup)))
|
||||||
|
|
||||||
(after "auto-complete"
|
|
||||||
(add-hook! 'java-mode-hook
|
|
||||||
(setq ac-sources '(ac-source-emacs-eclim
|
|
||||||
ac-source-yasnippet
|
|
||||||
ac-source-abbrev
|
|
||||||
ac-source-dictionary
|
|
||||||
ac-source-words-in-same-mode-buffers))))
|
|
||||||
|
|
||||||
(bind 'motion java-mode-map "gd" 'eclim-java-find-declaration)))
|
(bind 'motion java-mode-map "gd" 'eclim-java-find-declaration)))
|
||||||
|
|
||||||
|
(use-package android-mode
|
||||||
|
:defer t
|
||||||
|
:init
|
||||||
|
(add-hook! 'java-mode-hook
|
||||||
|
(when (f-exists? (concat (my--project-root) "AndroidManifest.xml"))
|
||||||
|
(android-mode +1))))
|
||||||
|
|
||||||
(use-package groovy-mode
|
(use-package groovy-mode
|
||||||
:mode "\\.gradle$"
|
:mode "\\.gradle$"
|
||||||
:config (after "auto-complete" (add-to-list 'ac-modes 'groovy-mode)))
|
:config (after "auto-complete" (add-to-list 'ac-modes 'groovy-mode)))
|
||||||
|
|
|
@ -1,21 +1,6 @@
|
||||||
;; Elisp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; Elisp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defun remove-elc-on-save ()
|
|
||||||
"If you're saving an elisp file, likely the .elc is no longer valid."
|
|
||||||
(make-local-variable 'after-save-hook)
|
|
||||||
(add-hook! 'after-save-hook
|
|
||||||
(if (file-exists-p (concat buffer-file-name "c"))
|
|
||||||
(delete-file (concat buffer-file-name "c")))))
|
|
||||||
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'remove-elc-on-save)
|
|
||||||
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
|
||||||
|
|
||||||
(evil-define-operator my:elisp-eval (beg end)
|
|
||||||
:move-point nil
|
|
||||||
(interactive "<r>")
|
|
||||||
(cond ((and beg end)
|
|
||||||
(eval-region beg end))
|
|
||||||
(t (eval-buffer))))
|
|
||||||
|
|
||||||
;; Real go-to-definition for elisp
|
;; Real go-to-definition for elisp
|
||||||
(bind 'motion emacs-lisp-mode-map "gd"
|
(bind 'motion emacs-lisp-mode-map "gd"
|
||||||
(λ (let ((func (function-called-at-point)))
|
(λ (let ((func (function-called-at-point)))
|
||||||
|
@ -26,8 +11,6 @@
|
||||||
(λ (let ((func (function-called-at-point)))
|
(λ (let ((func (function-called-at-point)))
|
||||||
(if func (find-function-other-window func)))))
|
(if func (find-function-other-window func)))))
|
||||||
|
|
||||||
(bind 'motion emacs-lisp-mode-map "gr" 'my:elisp-eval)
|
|
||||||
|
|
||||||
;; TODO Add clojure support
|
;; TODO Add clojure support
|
||||||
;; TODO Add scheme support
|
;; TODO Add scheme support
|
||||||
|
|
||||||
|
|
|
@ -275,16 +275,6 @@
|
||||||
(org-todo 'done))))
|
(org-todo 'done))))
|
||||||
[tab] 'org-cycle))
|
[tab] 'org-cycle))
|
||||||
|
|
||||||
(evil-ex-define-cmd "o[rg]edit" 'org-edit-special)
|
|
||||||
(evil-ex-define-cmd "o[rg]refile" 'org-refile)
|
|
||||||
(evil-ex-define-cmd "o[rg]archive" 'org-archive-subtree)
|
|
||||||
(evil-ex-define-cmd "o[rg]agenda" 'org-agenda)
|
|
||||||
(evil-ex-define-cmd "o[rg]todo" 'org-show-todo-tree)
|
|
||||||
(evil-ex-define-cmd "o[rg]link" 'org-link)
|
|
||||||
(evil-ex-define-cmd "o[rg]align" 'org-align-all-tags)
|
|
||||||
|
|
||||||
(evil-ex-define-cmd "o[rg]image" 'my:org-insert-image)
|
|
||||||
|
|
||||||
(evil-define-command my:org-insert-image-url (&optional image-url)
|
(evil-define-command my:org-insert-image-url (&optional image-url)
|
||||||
:repeat nil
|
:repeat nil
|
||||||
(interactive "<f><!>")
|
(interactive "<f><!>")
|
||||||
|
|
|
@ -20,11 +20,7 @@
|
||||||
(add-hook 'find-file-hook
|
(add-hook 'find-file-hook
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(when (string-match-p ,project-name (projectile-project-name))
|
(when (string-match-p ,project-name (projectile-project-name))
|
||||||
,@body)))))
|
,@body)))))))
|
||||||
|
|
||||||
(after "perspective"
|
|
||||||
(defvar persp-modestring-dividers '("" " |" ","))
|
|
||||||
(use-package persp-projectile))))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'init-projectile)
|
(provide 'init-projectile)
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
(use-package python
|
(use-package python
|
||||||
:mode ("\\.py\\'" . python-mode)
|
:mode ("\\.py\\'" . python-mode)
|
||||||
:interpreter ("python" . python-mode)
|
:interpreter ("python" . python-mode)
|
||||||
:init (setq python-indent-offset 4)
|
:init (add-hook 'python-mode-hook 'enable-tab-width-4)
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
|
(setq python-indent-offset 4)
|
||||||
(setq python-environment-directory my-tmp-dir)
|
(setq python-environment-directory my-tmp-dir)
|
||||||
(setq python-shell-interpreter "ipython")
|
(setq python-shell-interpreter "ipython")
|
||||||
|
|
||||||
;; Interferes with smartparens
|
;; interferes with smartparens
|
||||||
(bind python-mode-map (kbd "DEL") nil)
|
(define-key python-mode-map (kbd "DEL") nil)
|
||||||
|
|
||||||
(use-package anaconda-mode
|
(use-package anaconda-mode
|
||||||
:init
|
:init
|
||||||
|
@ -64,16 +65,6 @@
|
||||||
(use-package company-anaconda
|
(use-package company-anaconda
|
||||||
:config (company--backend-on 'python-mode-hook 'company-anaconda)))))
|
:config (company--backend-on 'python-mode-hook 'company-anaconda)))))
|
||||||
|
|
||||||
(use-package jedi
|
|
||||||
:disabled t
|
|
||||||
:config
|
|
||||||
(progn
|
|
||||||
(unless (file-directory-p python-environment-directory)
|
|
||||||
(jedi:install-server))
|
|
||||||
(add-hook 'python-mode-hook 'jedi:ac-setup)
|
|
||||||
|
|
||||||
(bind 'motion python-mode-map "gd" 'jedi:goto-definition)))
|
|
||||||
|
|
||||||
(use-package nose
|
(use-package nose
|
||||||
:commands nose-mode
|
:commands nose-mode
|
||||||
:init
|
:init
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
(after "evil"
|
(after "evil"
|
||||||
(evil-set-initial-state 'reb-mode 'insert)
|
(evil-set-initial-state 'reb-mode 'insert)
|
||||||
(evil-ex-define-cmd "re[gex]" 'my:regex)
|
|
||||||
;; Either a) converts selected (or entered-in) pcre regex into elisp
|
;; Either a) converts selected (or entered-in) pcre regex into elisp
|
||||||
;; regex, OR b) opens up re-builder.
|
;; regex, OR b) opens up re-builder.
|
||||||
(evil-define-operator my:regex (beg end type &optional regexstr bang)
|
(evil-define-operator my:regex (beg end type &optional regexstr bang)
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
:ex-arg shell
|
:ex-arg shell
|
||||||
(list (when (evil-ex-p) (evil-ex-file-arg))))
|
(list (when (evil-ex-p) (evil-ex-file-arg))))
|
||||||
|
|
||||||
(evil-ex-define-cmd "t" 'ex:tmux-run)
|
(evil-define-command my:tmux-run (&optional command bang)
|
||||||
(evil-define-command ex:tmux-run (&optional command bang)
|
|
||||||
"Sends input to tmux. Use `bang' to append to tmux"
|
"Sends input to tmux. Use `bang' to append to tmux"
|
||||||
(interactive "<tmux><!>")
|
(interactive "<tmux><!>")
|
||||||
(my--tmux-send (format (if bang "C-u %s Enter" "%s")
|
(my--tmux-send (format (if bang "C-u %s Enter" "%s")
|
||||||
|
@ -18,8 +17,7 @@
|
||||||
(when (evil-ex-p)
|
(when (evil-ex-p)
|
||||||
(message "[Tmux] %s" command)))
|
(message "[Tmux] %s" command)))
|
||||||
|
|
||||||
(evil-ex-define-cmd "tcd" 'ex:tmux-chdir)
|
(evil-define-command my:tmux-chdir (&optional path bang)
|
||||||
(evil-define-command ex:tmux-chdir (&optional path bang)
|
|
||||||
"CDs in tmux using `my--project-root'"
|
"CDs in tmux using `my--project-root'"
|
||||||
(interactive "<f><!>")
|
(interactive "<f><!>")
|
||||||
(let ((dir (shell-quote-argument
|
(let ((dir (shell-quote-argument
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq wg-session-file "~/.emacs.d/workgroups/.default")
|
(setq wg-session-file "~/.emacs.d/workgroups/.default")
|
||||||
|
(setq wg-workgroup-directory "~/.emacs.d/workgroups/")
|
||||||
|
(setq wg-first-wg-name "main")
|
||||||
|
|
||||||
(setq wg-session-load-on-start t)
|
(setq wg-session-load-on-start t)
|
||||||
|
|
||||||
|
@ -9,40 +11,42 @@
|
||||||
(setq wg-emacs-exit-save-behavior 'save) ; Options: 'save 'ask nil
|
(setq wg-emacs-exit-save-behavior 'save) ; Options: 'save 'ask nil
|
||||||
(setq wg-workgroups-mode-exit-save-behavior 'save) ; Options: 'save 'ask nil
|
(setq wg-workgroups-mode-exit-save-behavior 'save) ; Options: 'save 'ask nil
|
||||||
|
|
||||||
(setq wg-mode-line-display-on nil) ; Default: (not (featurep 'powerline))
|
|
||||||
(setq wg-flag-modified t) ; Display modified flags as well
|
|
||||||
(setq wg-mode-line-decor-left-brace "["
|
|
||||||
wg-mode-line-decor-right-brace "]" ; how to surround it
|
|
||||||
wg-mode-line-decor-divider ":")
|
|
||||||
(setq wg-mode-line-only-name t)
|
|
||||||
|
|
||||||
(evil-define-command my:save-session (&optional bang session-name)
|
(evil-define-command my:save-session (&optional bang session-name)
|
||||||
(interactive "<!><a>")
|
(interactive "<!><a>")
|
||||||
(if session-name
|
(if session-name
|
||||||
(wg-save-session-as (concat (file-name-directory wg-session-file) session-name) (not bang))
|
(wg-save-session-as (concat wg-workgroup-directory session-name) (not bang))
|
||||||
(wg-save-session)))
|
(wg-save-session)))
|
||||||
|
|
||||||
(evil-define-command my:load-session (&optional bang session-name)
|
(evil-define-command my:load-session (&optional bang session-name)
|
||||||
(interactive "<!><a>")
|
(interactive "<!><a>")
|
||||||
(wg-open-session (if session-name
|
(wg-open-session (if session-name
|
||||||
(concat (file-name-directory wg-session-file) session-name)
|
(concat wg-workgroup-directory session-name)
|
||||||
wg-session-file)))
|
wg-session-file)))
|
||||||
|
|
||||||
|
(evil-define-command my:new-workgroup (bang name)
|
||||||
|
(interactive "<!><a>")
|
||||||
|
(unless name
|
||||||
|
(user-error "No name specified for new workgroup"))
|
||||||
|
(if bang
|
||||||
|
(wg-clone-workgroup (wg-current-workgroup) name)
|
||||||
|
(wg-create-workgroup name t)))
|
||||||
|
|
||||||
(evil-define-command my:rename-workgroup (new-name)
|
(evil-define-command my:rename-workgroup (new-name)
|
||||||
(interactive "<a>")
|
(interactive "<a>")
|
||||||
(wg-rename-workgroup new-name))
|
(wg-rename-workgroup new-name))
|
||||||
|
|
||||||
(evil-ex-define-cmd "l[oad]" 'my:load-session)
|
(after "helm"
|
||||||
(evil-ex-define-cmd "s[ave]" 'my:save-session)
|
(defun my-wg-switch-to-workgroup (name)
|
||||||
(evil-ex-define-cmd "wn[ext]" 'wg-switch-to-workgroup-right)
|
(wg-switch-to-workgroup (wg-get-workgroup name)))
|
||||||
(evil-ex-define-cmd "wp[rev]" 'wg-switch-to-workgroup-left)
|
|
||||||
(evil-ex-define-cmd "wre[name]" 'my:rename-workgroup)
|
(defun helm-wg ()
|
||||||
(evil-ex-define-cmd "k[ill]w" 'wg-kill-workgroup-and-buffers)
|
(interactive)
|
||||||
(evil-ex-define-cmd "k[ill]ow" (λ
|
(helm :sources '(helm-source-wg)))
|
||||||
(let (workgroup (wg-get-workgroup))
|
|
||||||
(dolist (w (wg-workgroup-list-or-error))
|
(defvar helm-source-wg
|
||||||
(unless (eq w workgroup)
|
'((name . "Workgroups")
|
||||||
(wg-kill-workgroup-and-buffers w))))))
|
(candidates . wg-workgroup-names)
|
||||||
|
(action . my-wg-switch-to-workgroup))))
|
||||||
|
|
||||||
;; Turns projectile switch-project interface (or helm's interface to it)
|
;; Turns projectile switch-project interface (or helm's interface to it)
|
||||||
;; create a new workgroup for the new project.
|
;; create a new workgroup for the new project.
|
||||||
|
|
|
@ -14,13 +14,14 @@
|
||||||
(add-hook 'snippet-mode-hook 'yas-minor-mode)
|
(add-hook 'snippet-mode-hook 'yas-minor-mode)
|
||||||
(add-hook 'text-mode-hook 'yas-minor-mode)
|
(add-hook 'text-mode-hook 'yas-minor-mode)
|
||||||
(add-hook 'prog-mode-hook 'yas-minor-mode)
|
(add-hook 'prog-mode-hook 'yas-minor-mode)
|
||||||
|
(add-hook 'emacs-lisp-mode-hook 'yas-minor-mode)
|
||||||
;; (add-hook 'markdown-mode-hook 'yas-minor-mode)
|
;; (add-hook 'markdown-mode-hook 'yas-minor-mode)
|
||||||
(add-hook 'org-mode-hook 'yas-minor-mode))
|
(add-hook 'org-mode-hook 'yas-minor-mode))
|
||||||
:config
|
:config
|
||||||
(progn
|
(progn
|
||||||
(setq yas-verbosity 0)
|
(setq yas-verbosity 0)
|
||||||
(setq yas-indent-line 'auto)
|
(setq yas-indent-line 'auto)
|
||||||
(setq yas-also-auto-indent-first-line t)
|
(setq yas-also-auto-indent-first-line nil)
|
||||||
(setq yas-wrap-around-region nil)
|
(setq yas-wrap-around-region nil)
|
||||||
;; Only load personal snippets
|
;; Only load personal snippets
|
||||||
(setq yas-snippet-dirs `(,my-snippets-dir))
|
(setq yas-snippet-dirs `(,my-snippets-dir))
|
||||||
|
@ -61,7 +62,6 @@
|
||||||
(add-hook! 'yas-after-exit-snippet-hook
|
(add-hook! 'yas-after-exit-snippet-hook
|
||||||
(setq-local yas-selected-text nil))
|
(setq-local yas-selected-text nil))
|
||||||
|
|
||||||
(evil-ex-define-cmd "snip[pets]" 'ex:snippets)
|
|
||||||
(evil-define-operator ex:snippets (beg end &optional name)
|
(evil-define-operator ex:snippets (beg end &optional name)
|
||||||
:motion nil
|
:motion nil
|
||||||
:move-point nil
|
:move-point nil
|
||||||
|
|
|
@ -2,113 +2,104 @@
|
||||||
;; Global keymaps ;;
|
;; Global keymaps ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(bind (kbd "A-x") 'smex
|
(bind "A-x" 'smex
|
||||||
(kbd "A-X") 'smex-major-mode-commands
|
"A-X" 'smex-major-mode-commands
|
||||||
(kbd "C-;") 'eval-expression
|
"A-;" 'eval-expression
|
||||||
(kbd "C-`") 'popwin:toggle-popup-window
|
"C-`" 'popwin:toggle-popup-window
|
||||||
|
"M-=" 'text-scale-increase
|
||||||
|
"M--" 'text-scale-decrease
|
||||||
|
"M-w" 'evil-window-delete
|
||||||
|
"M-/" 'evilnc-comment-or-uncomment-lines
|
||||||
|
"M-b" 'my:build)
|
||||||
|
|
||||||
(kbd "M-=") 'text-scale-increase
|
(bind 'motion
|
||||||
(kbd "M--") 'text-scale-decrease
|
;; Faster scrolling
|
||||||
(kbd "M-w") 'evil-window-delete
|
"M-j" "6j"
|
||||||
(kbd "M-/") 'evilnc-comment-or-uncomment-lines)
|
"M-k" "6k"
|
||||||
|
"M-r" 'my:eval-region
|
||||||
|
|
||||||
;; Faster scrolling
|
'normal
|
||||||
(bind 'motion my-mode-map
|
"M-o" 'ido-find-file
|
||||||
(kbd "M-j") "6j"
|
"M-d" 'dash-at-point
|
||||||
(kbd "M-k") "6k")
|
"M-R" 'my:eval-buffer)
|
||||||
|
|
||||||
(bind 'normal my-mode-map
|
|
||||||
(kbd "M-o") 'ido-find-file
|
|
||||||
(kbd "M-d") 'dash-at-point)
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Local keymaps ;;
|
;; Local keymaps ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(bind '(normal visual) my-mode-map
|
(define-prefix-command 'my-leader-map)
|
||||||
";" 'evil-ex
|
(define-prefix-command 'my-localleader-map)
|
||||||
"X" 'evil-exchange
|
|
||||||
|
|
||||||
"g l" (λ (linum-mode 1) (evil-ex "") (linum-mode -1))
|
(bind '(normal motion visual) ";" 'evil-ex)
|
||||||
|
|
||||||
"] e" 'next-error
|
;; <leader>
|
||||||
"[ e" 'previous-error
|
(bind my-leader-map
|
||||||
"] g" 'git-gutter+-next-hunk
|
"," 'helm-projectile-switch-to-buffer
|
||||||
"[ g" 'git-gutter+-previous-hunk
|
"." 'helm-resume
|
||||||
|
"/" 'helm-projectile-find-file
|
||||||
|
";" 'helm-semantic-or-imenu
|
||||||
|
"<" 'helm-mini
|
||||||
|
"E" 'my:init-files
|
||||||
|
"M" 'helm-projectile-recentf ; recent PROJECT files
|
||||||
|
"]" 'helm-etags-select
|
||||||
|
"a" 'helm-projectile-find-other-file
|
||||||
|
"e" 'ido-find-file
|
||||||
|
"g" 'git-gutter+-show-hunk
|
||||||
|
"h" 'helm-apropos
|
||||||
|
"m" 'helm-recentf
|
||||||
|
"p" 'helm-projectile-switch-project
|
||||||
|
"y" 'helm-show-kill-ring
|
||||||
|
"r" 'emr-show-refactor-menu) ; init-dev.el
|
||||||
|
|
||||||
"] \\" 'er/expand-region
|
;; <localleader>
|
||||||
"[ \\" 'er/contract-region)
|
(bind my-localleader-map
|
||||||
|
"\\" 'neotree-toggle
|
||||||
|
";" 'linum-mode
|
||||||
|
"=" 'toggle-transparency
|
||||||
|
"E" 'evil-emacs-state
|
||||||
|
|
||||||
(bind 'normal my-mode-map
|
"of" (λ (my-send-dir-to-finder default-directory))
|
||||||
;; <leader>
|
"oF" 'my-send-dir-to-finder
|
||||||
", ," 'helm-projectile-switch-to-buffer
|
"ou" (λ (my-send-to-transmit buffer-file-name))
|
||||||
", ." 'helm-resume
|
"oU" 'my-send-to-transmit
|
||||||
", /" 'helm-projectile-find-file
|
"ol" (λ (my-send-to-launchbar buffer-file-name))
|
||||||
", ;" 'helm-semantic-or-imenu
|
"oL" 'my-send-to-launchbar
|
||||||
", <" 'helm-mini
|
|
||||||
", E" 'my:init-files
|
|
||||||
", M" 'helm-projectile-recentf ; recent PROJECT files
|
|
||||||
", ]" 'helm-etags-select
|
|
||||||
", a" 'helm-projectile-find-other-file
|
|
||||||
", e" 'ido-find-file
|
|
||||||
", f" 'helm-projectile-find-file-dwim
|
|
||||||
", g" 'git-gutter+-show-hunk
|
|
||||||
", h" 'helm-apropos
|
|
||||||
", m" 'helm-recentf
|
|
||||||
", p" 'helm-projectile-switch-project
|
|
||||||
", y" 'helm-show-kill-ring
|
|
||||||
|
|
||||||
;; <localleader>
|
|
||||||
"\\ \\" 'neotree-toggle
|
|
||||||
"\\ ;" 'linum-mode
|
|
||||||
"\\ =" 'toggle-transparency
|
|
||||||
"\\ e" 'evil-emacs-state
|
|
||||||
|
|
||||||
"\\ ]" 'next-buffer
|
|
||||||
"\\ [" 'previous-buffer
|
|
||||||
|
|
||||||
"\\ o f" (λ (my-send-dir-to-finder default-directory))
|
|
||||||
"\\ o F" 'my-send-dir-to-finder
|
|
||||||
"\\ o u" (λ (my-send-to-transmit buffer-file-name))
|
|
||||||
"\\ o U" 'my-send-to-transmit
|
|
||||||
"\\ o l" (λ (my-send-to-launchbar buffer-file-name))
|
|
||||||
"\\ o L" 'my-send-to-launchbar
|
|
||||||
|
|
||||||
;; tmux: cd (default-directory)
|
;; tmux: cd (default-directory)
|
||||||
"\\ o t" (λ (ex:tmux-chdir nil t))
|
"ot" (λ (ex:tmux-chdir nil t))
|
||||||
;; tmux: cd [project root]
|
;; tmux: cd [project root]
|
||||||
"\\ o T" 'ex:tmux-chdir
|
"oT" 'ex:tmux-chdir
|
||||||
|
|
||||||
|
"]" 'next-buffer
|
||||||
|
"[" 'previous-buffer
|
||||||
|
|
||||||
|
"g" 'git-gutter+-show-hunk
|
||||||
|
"e" (λ (flycheck-buffer) (flycheck-list-errors))
|
||||||
|
"p" 'helm-show-kill-ring
|
||||||
|
"b" 'helm-projectile-switch-to-buffer
|
||||||
|
"w" 'helm-wg)
|
||||||
|
|
||||||
|
|
||||||
|
(bind 'normal
|
||||||
|
"," 'my-leader-map
|
||||||
|
"\\" 'my-localleader-map
|
||||||
|
|
||||||
;; behave like D and C; yank to end of line
|
;; behave like D and C; yank to end of line
|
||||||
"Y" (λ (evil-yank (point) (point-at-eol)))
|
"Y" (λ (evil-yank (point) (point-at-eol)))
|
||||||
|
"zx" 'kill-this-buffer
|
||||||
"z x" 'kill-this-buffer
|
"ZX" 'bury-buffer
|
||||||
"Z X" 'bury-buffer
|
"]b" 'next-buffer
|
||||||
|
"[b" 'previous-buffer
|
||||||
"] b" 'next-buffer
|
"]w" 'wg-switch-to-workgroup-right
|
||||||
"[ b" 'previous-buffer
|
"[w" 'wg-switch-to-workgroup-left
|
||||||
"] p" 'persp-next
|
|
||||||
"[ p" 'persp-prev
|
|
||||||
|
|
||||||
;; winner-mode: window layout undo/redo (see init-core.el)
|
|
||||||
"C-w u" 'winner-undo
|
|
||||||
"C-w C-u" 'winner-undo
|
|
||||||
"C-w C-r" 'winner-redo
|
|
||||||
|
|
||||||
;; buffer navigation
|
|
||||||
;; "C-h" 'evil-window-left
|
|
||||||
;; "C-j" 'evil-window-down
|
|
||||||
;; "C-k" 'evil-window-up
|
|
||||||
;; "C-l" 'evil-window-right
|
|
||||||
;; restore help key
|
|
||||||
;; "M-h" 'help-command
|
|
||||||
|
|
||||||
;; Increment/decrement number under cursor
|
;; Increment/decrement number under cursor
|
||||||
"C-=" 'evil-numbers/inc-at-pt
|
"g=" 'evil-numbers/inc-at-pt
|
||||||
"C--" 'evil-numbers/dec-at-pt)
|
"g-" 'evil-numbers/dec-at-pt
|
||||||
|
"gR" 'my:eval-buffer ; init-dev.el
|
||||||
|
|
||||||
(bind 'visual my-mode-map
|
'visual
|
||||||
", =" 'align-regexp
|
", =" 'align-regexp
|
||||||
|
|
||||||
;; vnoremap < <gv
|
;; vnoremap < <gv
|
||||||
|
@ -118,11 +109,25 @@
|
||||||
;; vnoremap > >gv
|
;; vnoremap > >gv
|
||||||
">" (λ (evil-shift-right (region-beginning) (region-end))
|
">" (λ (evil-shift-right (region-beginning) (region-end))
|
||||||
(evil-normal-state)
|
(evil-normal-state)
|
||||||
(evil-visual-restore)))
|
(evil-visual-restore))
|
||||||
|
|
||||||
(bind 'emacs [escape] 'evil-normal-state)
|
'motion
|
||||||
|
"X" 'evil-exchange
|
||||||
|
|
||||||
(bind 'insert my-mode-map
|
"]g" 'git-gutter+-next-hunk
|
||||||
|
"[g" 'git-gutter+-previous-hunk
|
||||||
|
|
||||||
|
"]e" 'next-error
|
||||||
|
"[e" 'previous-error
|
||||||
|
|
||||||
|
"]\\" 'er/expand-region
|
||||||
|
"[\\" 'er/contract-region
|
||||||
|
|
||||||
|
"gl" (λ (linum-mode 1) (evil-ex "") (linum-mode -1))
|
||||||
|
"gx" 'my-scratch-buffer ; send to scratch buffer
|
||||||
|
"gr" 'my:eval-region ; init-dev.el
|
||||||
|
|
||||||
|
'insert
|
||||||
"<A-backspace>" 'evil-delete-backward-word
|
"<A-backspace>" 'evil-delete-backward-word
|
||||||
"<A-delete>" (λ (evil-forward-word) (evil-delete-backward-word))
|
"<A-delete>" (λ (evil-forward-word) (evil-delete-backward-word))
|
||||||
|
|
||||||
|
@ -134,40 +139,36 @@
|
||||||
;; Textmate-esque indent shift left/right
|
;; Textmate-esque indent shift left/right
|
||||||
"M-[" (kbd "C-o m l C-o I DEL C-o ` l")
|
"M-[" (kbd "C-o m l C-o I DEL C-o ` l")
|
||||||
"M-]" (λ (evil-shift-right (point-at-bol) (point-at-eol)))
|
"M-]" (λ (evil-shift-right (point-at-bol) (point-at-eol)))
|
||||||
"<backtab>" (kbd "M-["))
|
"<backtab>" (kbd "M-[")
|
||||||
|
|
||||||
|
;; Easy escape from insert mode (more responsive than using key-chord-define)
|
||||||
|
"j" 'my--maybe-exit-insert-mode
|
||||||
|
"C-g" 'evil-normal-state
|
||||||
|
|
||||||
|
;; Rotate-text (see elisp/rotate-text.el)
|
||||||
|
'normal "!" 'rotate-word-at-point
|
||||||
|
'visual "!" 'rotate-region
|
||||||
|
|
||||||
|
'emacs
|
||||||
|
[escape] 'evil-normal-state)
|
||||||
|
|
||||||
;; Enable TAB to do matchit
|
;; Enable TAB to do matchit
|
||||||
(bind '(normal visual) evil-matchit-mode-map [tab] 'evilmi-jump-items)
|
(bind 'motion evil-matchit-mode-map [tab] 'evilmi-jump-items)
|
||||||
|
|
||||||
;; Rotate-text (see elisp/rotate-text.el)
|
(bind evil-window-map
|
||||||
(bind 'normal my-mode-map "!" 'rotate-word-at-point)
|
;; winner-mode: window layout undo/redo (see init-core.el)
|
||||||
(bind 'visual my-mode-map "!" 'rotate-region)
|
"u" 'winner-undo
|
||||||
|
"C-u" 'winner-undo
|
||||||
;; Additional operators
|
"C-r" 'winner-redo)
|
||||||
(bind 'motion my-mode-map "g x" 'my-scratch-buffer) ; send to scratch buffer
|
|
||||||
|
|
||||||
;; Easy escape from insert mode (more responsive than using key-chord-define)
|
|
||||||
(bind 'insert "j" 'my--maybe-exit-insert-mode)
|
|
||||||
|
|
||||||
(bind 'insert "C-g" 'evil-normal-state)
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
;; Plugin/mode keymaps ;;
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
;; Peek at file from dired
|
;; Peek at file from dired
|
||||||
(bind dired-mode-map "o" (λ (popwin:find-file (dired-get-file-for-visit))))
|
(bind dired-mode-map "o" (λ (popwin:find-file (dired-get-file-for-visit))))
|
||||||
|
|
||||||
;; Evil registers ;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(after "help-mode"
|
(after "help-mode"
|
||||||
(bind 'normal help-mode-map
|
(bind 'normal help-mode-map
|
||||||
"]]" 'help-go-forward
|
"]]" 'help-go-forward
|
||||||
"[[" 'help-go-back))
|
"[[" 'help-go-back))
|
||||||
|
|
||||||
(evil-make-overriding-map my-mode-map nil)
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Keymap fixes ;;
|
;; Keymap fixes ;;
|
||||||
|
@ -209,17 +210,26 @@
|
||||||
(kbd "<M-return>") 'evil-open-below
|
(kbd "<M-return>") 'evil-open-below
|
||||||
(kbd "<S-M-return>") 'evil-open-above)
|
(kbd "<S-M-return>") 'evil-open-above)
|
||||||
|
|
||||||
|
(when is-mac
|
||||||
|
;; Restore text nav keys
|
||||||
|
(bind (kbd "<A-left>") 'backward-word
|
||||||
|
(kbd "<A-right>") 'forward-word
|
||||||
|
(kbd "<M-backspace>") 'my.backward-kill-to-bol-and-indent
|
||||||
|
(kbd "M-a") 'mark-whole-buffer
|
||||||
|
(kbd "M-c") 'evil-yank
|
||||||
|
(kbd "M-v") 'evil-paste-after
|
||||||
|
(kbd "M-s") 'save-buffer))
|
||||||
|
|
||||||
;; Fix osx keymappings and then some
|
;; Fix osx keymappings and then some
|
||||||
(use-package smart-forward
|
(use-package smart-forward
|
||||||
:config
|
:config
|
||||||
(bind 'insert
|
(bind 'insert
|
||||||
(kbd "<M-left>") 'my.move-to-bol
|
"<M-left>" 'my.move-to-bol
|
||||||
(kbd "<M-right>") 'my.move-to-eol
|
"<M-right>" 'my.move-to-eol
|
||||||
(kbd "<M-backspace>") 'my.backward-kill-to-bol-and-indent
|
"<M-up>" 'beginning-of-buffer
|
||||||
;; (kbd "<M-up>") 'beginning-of-buffer
|
"<M-down>" 'end-of-buffer
|
||||||
(kbd "<M-up>") 'smart-up
|
"<A-up>" 'smart-up
|
||||||
(kbd "<M-down>") 'smart-down))
|
"<A-down>" 'smart-down))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'my-bindings)
|
(provide 'my-bindings)
|
||||||
|
|
79
init/my-commands.el
Normal file
79
init/my-commands.el
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
(defalias 'exmap 'evil-ex-define-cmd)
|
||||||
|
|
||||||
|
(exmap "full[scr]" 'toggle-frame-fullscreen)
|
||||||
|
(exmap "ini" 'my:init-files)
|
||||||
|
(exmap "n[otes]" 'my:notes)
|
||||||
|
(exmap "recompile" 'my:byte-compile)
|
||||||
|
(exmap "cd" 'my:cd)
|
||||||
|
(exmap "en[ew]" 'my:create-file)
|
||||||
|
(exmap "ren[ame]" 'my:rename-this-file) ; Rename file . Bang: Delete old one
|
||||||
|
(exmap "al[ign]" 'my:align)
|
||||||
|
(exmap "retab" 'my:retab)
|
||||||
|
(exmap "sq[uint]" 'my:narrow-indirect) ; Narrow buffer to selection
|
||||||
|
(exmap "x" 'my:scratch-buffer)
|
||||||
|
|
||||||
|
(exmap "k[ill]" 'kill-this-buffer) ; Kill current buffer
|
||||||
|
(exmap "k[ill]o" 'my-cleanup-buffers) ; Kill current project buffers
|
||||||
|
(exmap "k[ill]all" 'my:kill-buffers) ; Kill all buffers (bang = project buffers only)
|
||||||
|
(exmap "k[ill]buried" 'my:kill-buried-buffers) ; Kill all buffers (bang = project buffers only)
|
||||||
|
|
||||||
|
(exmap "ma[ke]" 'my:build)
|
||||||
|
|
||||||
|
(exmap "t" 'my:tmux-run)
|
||||||
|
(exmap "tcd" 'my:tmux-chdir)
|
||||||
|
|
||||||
|
(after "flycheck"
|
||||||
|
(exmap "er[rors]" (λ (flycheck-buffer) (flycheck-list-errors))))
|
||||||
|
|
||||||
|
(after "git-gutter-fringe+"
|
||||||
|
(exmap "gstage" 'git-gutter+-stage-hunks)
|
||||||
|
(exmap "grevert" 'git-gutter+-revert-hunks)
|
||||||
|
(exmap "gdiff" 'git-gutter+-show-hunk))
|
||||||
|
|
||||||
|
(after "helm"
|
||||||
|
(exmap "a" 'helm-projectile-find-other-file)
|
||||||
|
(exmap "proj[ect]" 'helm-projectile-switch-project)
|
||||||
|
(exmap "ag" 'my:helm-ag-search)
|
||||||
|
(exmap "agr" 'my:helm-ag-regex-search)
|
||||||
|
(exmap "ag[cw]d" 'my:helm-ag-search-cwd)
|
||||||
|
(exmap "agr[cw]d" 'my:helm-ag-regex-search-cwd)
|
||||||
|
(exmap "sw[oop]" 'my:helm-swoop)
|
||||||
|
(exmap "rec[ent]" 'my:helm-recentf))
|
||||||
|
|
||||||
|
(after "yasnippet"
|
||||||
|
(exmap "snip[pets]" 'ex:snippets))
|
||||||
|
|
||||||
|
(after "emr"
|
||||||
|
(exmap "ref[actor]" 'emr-show-refactor-menu))
|
||||||
|
|
||||||
|
(after "re-builder"
|
||||||
|
(exmap "re[gex]" 'my:regex))
|
||||||
|
|
||||||
|
(after "workgroups2"
|
||||||
|
(exmap "sl[oad]" 'my:load-session)
|
||||||
|
(exmap "ss[ave]" 'my:save-session)
|
||||||
|
(exmap "wg" (λ (message (wg-workgroup-list-display))))
|
||||||
|
(exmap "wnew" 'my:new-workgroup)
|
||||||
|
(exmap "wre[name]" 'my:rename-workgroup)
|
||||||
|
(exmap "wn[ext]" 'wg-switch-to-workgroup-right)
|
||||||
|
(exmap "wp[rev]" 'wg-switch-to-workgroup-left)
|
||||||
|
(exmap "wl[ast]" 'wg-switch-to-previous-workgroup)
|
||||||
|
(exmap "k[ill]w" 'wg-kill-workgroup)
|
||||||
|
(exmap "k[ill]ow" (λ (let (workgroup (wg-current-workgroup))
|
||||||
|
(dolist (w (wg-workgroup-list))
|
||||||
|
(unless (wg-current-workgroup-p w)
|
||||||
|
(wg-kill-workgroup w)))))))
|
||||||
|
|
||||||
|
(after "org"
|
||||||
|
(exmap "o[rg]edit" 'org-edit-special)
|
||||||
|
(exmap "o[rg]refile" 'org-refile)
|
||||||
|
(exmap "o[rg]archive" 'org-archive-subtree)
|
||||||
|
(exmap "o[rg]agenda" 'org-agenda)
|
||||||
|
(exmap "o[rg]todo" 'org-show-todo-tree)
|
||||||
|
(exmap "o[rg]link" 'org-link)
|
||||||
|
(exmap "o[rg]align" 'org-align-all-tags)
|
||||||
|
(exmap "o[rg]image" 'my:org-insert-image))
|
||||||
|
|
||||||
|
|
||||||
|
(provide 'my-commands)
|
||||||
|
;;; my-commands.el ends here
|
|
@ -44,18 +44,19 @@
|
||||||
|
|
||||||
;; Make ESC quit all the things
|
;; Make ESC quit all the things
|
||||||
;; (bind minibuffer-inactive-mode-map [escape] (λ (other-window 1)))
|
;; (bind minibuffer-inactive-mode-map [escape] (λ (other-window 1)))
|
||||||
(bind (list minibuffer-local-map
|
(dolist (map (list minibuffer-local-map
|
||||||
minibuffer-local-ns-map
|
minibuffer-local-ns-map
|
||||||
minibuffer-local-completion-map
|
minibuffer-local-completion-map
|
||||||
minibuffer-local-must-match-map
|
minibuffer-local-must-match-map
|
||||||
minibuffer-local-isearch-map)
|
minibuffer-local-isearch-map))
|
||||||
[escape] 'my--minibuffer-quit)
|
(bind map [escape] 'my--minibuffer-quit))
|
||||||
(bind 'emacs [escape] 'my--minibuffer-quit)
|
(bind 'emacs [escape] 'my--minibuffer-quit)
|
||||||
(bind 'normal evil-command-window-mode-map [escape] 'kill-buffer-and-window)
|
(bind 'normal evil-command-window-mode-map [escape] 'kill-buffer-and-window)
|
||||||
;; (bind evil-ex-map [escape] 'my--minibuffer-quit)
|
;; (bind evil-ex-map [escape] 'my--minibuffer-quit)
|
||||||
|
|
||||||
(bind (list evil-ex-search-keymap minibuffer-local-map)
|
(dolist (map (list evil-ex-search-keymap minibuffer-local-map))
|
||||||
"\C-w" 'evil-delete-backward-word)
|
(bind map "\C-w" 'evil-delete-backward-word))
|
||||||
|
|
||||||
(bind minibuffer-local-map
|
(bind minibuffer-local-map
|
||||||
"\C-u" 'evil-delete-whole-line)
|
"\C-u" 'evil-delete-whole-line)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue