2018-02-14 23:16:38 -05:00
|
|
|
;;; config/default/+evil-commands.el -*- lexical-binding: t; -*-
|
2017-12-30 00:56:54 -05:00
|
|
|
|
|
|
|
(defalias 'ex! 'evil-ex-define-cmd)
|
|
|
|
|
2018-02-02 19:10:43 -05:00
|
|
|
(evil-define-command doom:cleanup-session (bang)
|
2018-01-03 14:08:41 -05:00
|
|
|
(interactive "<!>")
|
|
|
|
(doom/cleanup-session bang))
|
|
|
|
|
2018-02-02 19:10:43 -05:00
|
|
|
(evil-define-operator doom:open-scratch-buffer (bang)
|
|
|
|
(interactive "<!>")
|
|
|
|
(doom/open-scratch-buffer bang))
|
|
|
|
|
2018-02-02 21:21:20 -05:00
|
|
|
(evil-define-command doom:pwd (bang)
|
|
|
|
(interactive "<!>")
|
|
|
|
(if (not bang)
|
|
|
|
(pwd)
|
|
|
|
(kill-new default-directory)
|
|
|
|
(message "Copied to clipboard")))
|
|
|
|
|
2018-01-03 14:08:41 -05:00
|
|
|
|
|
|
|
;;
|
|
|
|
;; Commands
|
|
|
|
;;
|
|
|
|
|
|
|
|
;;; Commands defined elsewhere
|
2017-12-30 00:56:54 -05:00
|
|
|
;;(ex! "al[ign]" #'+evil:align)
|
|
|
|
;;(ex! "g[lobal]" #'+evil:global)
|
|
|
|
|
2018-01-03 14:08:41 -05:00
|
|
|
;;; Custom commands
|
2017-12-30 00:56:54 -05:00
|
|
|
;; Editing
|
|
|
|
(ex! "@" #'+evil:macro-on-all-lines) ; TODO Test me
|
|
|
|
(ex! "al[ign]" #'+evil:align)
|
|
|
|
(ex! "enhtml" #'+web:encode-html-entities)
|
|
|
|
(ex! "dehtml" #'+web:decode-html-entities)
|
|
|
|
(ex! "mc" #'+evil:mc)
|
|
|
|
(ex! "iedit" #'evil-multiedit-ex-match)
|
|
|
|
(ex! "na[rrow]" #'+evil:narrow-buffer)
|
|
|
|
(ex! "retab" #'+evil:retab)
|
|
|
|
;; External resources
|
|
|
|
;; TODO (ex! "db" #'doom:db)
|
|
|
|
;; TODO (ex! "dbu[se]" #'doom:db-select)
|
|
|
|
;; TODO (ex! "go[ogle]" #'doom:google-search)
|
2018-01-04 17:05:37 -05:00
|
|
|
(ex! "lo[okup]" #'+lookup:online)
|
|
|
|
(ex! "dash" #'+lookup:dash)
|
|
|
|
(ex! "dd" #'+lookup:devdocs)
|
2017-12-30 00:56:54 -05:00
|
|
|
(ex! "http" #'httpd-start) ; start http server
|
|
|
|
(ex! "repl" #'+eval:repl) ; invoke or send to repl
|
|
|
|
;; TODO (ex! "rx" 'doom:regex) ; open re-builder
|
|
|
|
(ex! "sh[ell]" #'+eshell:run)
|
|
|
|
(ex! "t[mux]" #'+tmux:run) ; send to tmux
|
|
|
|
(ex! "tcd" #'+tmux:cd-here) ; cd to default-directory in tmux
|
2018-02-02 19:10:43 -05:00
|
|
|
(ex! "x" #'doom:open-scratch-buffer)
|
2017-12-30 00:56:54 -05:00
|
|
|
;; GIT
|
|
|
|
(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)
|
|
|
|
(ex! "gblame" #'magit-blame)
|
|
|
|
(ex! "grevert" #'git-gutter:revert-hunk)
|
|
|
|
;; Dealing with buffers
|
2018-01-03 14:08:41 -05:00
|
|
|
(ex! "clean[up]" #'doom:cleanup-session)
|
2017-12-30 00:56:54 -05:00
|
|
|
(ex! "k[ill]" #'doom/kill-this-buffer)
|
|
|
|
(ex! "k[ill]all" #'+default:kill-all-buffers)
|
|
|
|
(ex! "k[ill]m" #'+default: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-this-buffer)
|
|
|
|
;; Project navigation
|
|
|
|
(ex! "a" #'projectile-find-other-file)
|
|
|
|
(ex! "cd" #'+default:cd)
|
2018-02-02 21:21:20 -05:00
|
|
|
(ex! "pwd" #'doom:pwd)
|
2017-12-30 00:56:54 -05: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)
|
2018-02-19 03:11:28 -05:00
|
|
|
(ex! "grep" #'+ivy:grep)
|
|
|
|
(ex! "grepc[wd]" #'+ivy:grep-cwd)
|
2017-12-30 00:56:54 -05:00
|
|
|
(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)))
|
|
|
|
;; Project tools
|
|
|
|
(ex! "build" #'+eval/build)
|
|
|
|
(ex! "debug" #'+debug/run)
|
|
|
|
(ex! "er[rors]" #'flycheck-list-errors)
|
|
|
|
;; File operations
|
|
|
|
(ex! "cp" #'+evil:copy-this-file)
|
|
|
|
(ex! "mv" #'+evil:move-this-file)
|
|
|
|
(ex! "rm" #'+evil:delete-this-file)
|
|
|
|
;; Sessions/tabs
|
|
|
|
(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)
|
|
|
|
;; Org-mode
|
|
|
|
(ex! "cap" #'+org-capture/dwim)
|
|
|
|
|