2017-06-08 11:47:56 +02:00
|
|
|
;;; private/hlissner/+commands.el -*- lexical-binding: t; -*-
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(defalias 'ex! 'evil-ex-define-cmd)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
2017-05-17 18:26:50 +02:00
|
|
|
;;; Commands defined elsewhere
|
|
|
|
;;(ex! "al[ign]" #'+evil:align)
|
|
|
|
;;(ex! "g[lobal]" #'+evil:global)
|
|
|
|
|
2017-02-20 00:18:54 -05:00
|
|
|
;;; Custom commands
|
|
|
|
;; Emacs utilities
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "bc[omp]" #'+hlissner:byte-compile)
|
|
|
|
(ex! "re[load]" #'doom/reload)
|
|
|
|
(ex! "re[load]au" #'doom/reload-autoloads)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; Editing
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "@" #'+evil:macro-on-all-lines) ; TODO Test me
|
2017-05-27 18:57:46 +02:00
|
|
|
(ex! "al[ign]" #'+evil:align)
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "enhtml" #'+web:encode-html-entities)
|
|
|
|
(ex! "dehtml" #'+web:decode-html-entities)
|
2017-05-26 23:08:53 +02:00
|
|
|
(ex! "mc" #'+evil:mc)
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "na[rrow]" #'+evil:narrow-buffer)
|
|
|
|
(ex! "retab" #'+evil:retab)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; External resources
|
2017-05-17 18:26:50 +02:00
|
|
|
;; TODO (ex! "db" #'doom:db)
|
|
|
|
;; TODO (ex! "dbu[se]" #'doom:db-select)
|
|
|
|
;; TODO (ex! "go[ogle]" #'doom:google-search)
|
2017-05-21 15:08:20 +02:00
|
|
|
(ex! "lo[okup]" #'+jump:online)
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "http" #'httpd-start) ; start http server
|
|
|
|
(ex! "repl" #'+eval:repl) ; invoke or send to repl
|
2017-02-23 00:06:12 -05:00
|
|
|
;; TODO (ex! "rx" 'doom:regex) ; open re-builder
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "sh[ell]" #'+eshell:run)
|
|
|
|
(ex! "t[mux]" #'+tmux:run) ; send to tmux
|
|
|
|
(ex! "tcd" #'+tmux:cd-here) ; cd to default-directory in tmux
|
2017-07-03 03:11:54 +02:00
|
|
|
|
|
|
|
(evil-set-command-properties #'doom/scratch-buffer :ex-bang t)
|
|
|
|
(ex! "x" #'doom/scratch-buffer)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; GIT
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "gist" #'+gist:send) ; send current buffer/region to gist
|
|
|
|
(ex! "gistl" #'+gist:list) ; list gists by user
|
|
|
|
(ex! "gbrowse" #'+vcs/git-browse) ; show file in github/gitlab
|
|
|
|
(ex! "gissues" #'+vcs/git-browse-issues) ; show github issues
|
|
|
|
(ex! "git" #'magit-status) ; open magit status window
|
|
|
|
(ex! "gstage" #'magit-stage)
|
|
|
|
(ex! "gunstage" #'magit-unstage)
|
2017-05-21 15:06:15 +02:00
|
|
|
(ex! "gblame" #'magit-blame)
|
|
|
|
(ex! "grevert" #'git-gutter:revert-hunk)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; Dealing with buffers
|
2017-06-27 23:18:32 +02:00
|
|
|
(evil-set-command-properties #'+workspace/cleanup :ex-bang t)
|
|
|
|
|
|
|
|
(ex! "clean[up]" #'+workspace/cleanup)
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "k[ill]" #'doom/kill-this-buffer)
|
|
|
|
(ex! "k[ill]all" #'+hlissner:kill-all-buffers)
|
|
|
|
(ex! "k[ill]m" #'+hlissner:kill-matching-buffers)
|
|
|
|
(ex! "k[ill]o" #'doom/kill-other-buffers)
|
|
|
|
(ex! "l[ast]" #'doom/popup-restore)
|
|
|
|
(ex! "m[sg]" #'view-echo-area-messages)
|
|
|
|
(ex! "pop[up]" #'doom/popup) ; open current buffer in popup
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; Project navigation
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "a" #'projectile-find-other-file)
|
|
|
|
(ex! "cd" #'+hlissner:cd)
|
2017-06-09 13:36:58 +02:00
|
|
|
(cond ((featurep! :completion ivy)
|
|
|
|
(ex! "ag" #'+ivy:ag)
|
|
|
|
(ex! "agc[wd]" #'+ivy:ag-cwd)
|
|
|
|
(ex! "rg" #'+ivy:rg)
|
|
|
|
(ex! "rgc[wd]" #'+ivy:rg-cwd)
|
|
|
|
(ex! "sw[iper]" #'+ivy:swiper)
|
|
|
|
(ex! "todo" #'+ivy:todo))
|
|
|
|
((featurep! :completion helm)
|
|
|
|
(ex! "ag" #'+helm:ag)
|
|
|
|
(ex! "agc[wd]" #'+helm:ag-cwd)
|
|
|
|
(ex! "rg" #'+helm:rg)
|
|
|
|
(ex! "rgc[wd]" #'+helm:rg-cwd)
|
|
|
|
(ex! "sw[oop]" #'+helm:swoop)
|
|
|
|
(ex! "todo" #'+helm:todo)))
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; Project tools
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "build" #'+eval/build)
|
|
|
|
(ex! "debug" #'+debug/run)
|
|
|
|
(ex! "er[rors]" #'flycheck-list-errors)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; File operations
|
2017-05-27 13:25:40 +02:00
|
|
|
(ex! "cp" #'+evil:copy-this-file)
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "mv" #'+evil:move-this-file)
|
|
|
|
(ex! "rm" #'+evil:delete-this-file)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; Sessions/tabs
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "sclear" #'+workspace/kill-session)
|
|
|
|
(ex! "sl[oad]" #'+workspace:load-session)
|
|
|
|
(ex! "ss[ave]" #'+workspace:save-session)
|
|
|
|
(ex! "tabc[lose]" #'+workspace:delete)
|
|
|
|
(ex! "tabclear" #'doom/kill-all-buffers)
|
|
|
|
(ex! "tabl[ast]" #'+workspace/switch-to-last)
|
|
|
|
(ex! "tabload" #'+workspace:load)
|
|
|
|
(ex! "tabn[ew]" #'+workspace:new)
|
|
|
|
(ex! "tabn[ext]" #'+workspace:switch-next)
|
|
|
|
(ex! "tabp[rev]" #'+workspace:switch-previous)
|
|
|
|
(ex! "tabr[ename]" #'+workspace:rename)
|
|
|
|
(ex! "tabs" #'+workspace/display)
|
|
|
|
(ex! "tabsave" #'+workspace:save)
|
2017-02-20 00:18:54 -05:00
|
|
|
|
|
|
|
;; Org-mode
|
2017-05-17 18:26:50 +02:00
|
|
|
(ex! "org" #'+org:capture)
|