Combine doom/open-scratch-buffer & doom/open-project-scratch-buffer

These two are now doom/open-scratch-buffer. If you're in a project,
a (persistent) scratch buffer is opened. Otherwise, a non-persistent,
transient scratch buffer is opened.

If ARG (universal argument) is non-nil, then use the current window
instead of a new window (or popup, if feature/popup is enabled).

Also, the ex command :x[!] is improved. The BANG = open in current
window.
This commit is contained in:
Henrik Lissner 2018-02-02 19:10:43 -05:00
parent d0fa95f9a0
commit bbb969fa59
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 32 additions and 25 deletions

View file

@ -2,10 +2,14 @@
(defalias 'ex! 'evil-ex-define-cmd)
(evil-define-command doom:cleanup-session (&optional bang)
(evil-define-command doom:cleanup-session (bang)
(interactive "<!>")
(doom/cleanup-session bang))
(evil-define-operator doom:open-scratch-buffer (bang)
(interactive "<!>")
(doom/open-scratch-buffer bang))
;;
;; Commands
@ -38,7 +42,7 @@
(ex! "sh[ell]" #'+eshell:run)
(ex! "t[mux]" #'+tmux:run) ; send to tmux
(ex! "tcd" #'+tmux:cd-here) ; cd to default-directory in tmux
(ex! "x" #'doom/open-project-scratch-buffer)
(ex! "x" #'doom:open-scratch-buffer)
;; GIT
(ex! "gist" #'+gist:send) ; send current buffer/region to gist
(ex! "gistl" #'+gist:list) ; list gists by user