config/default: new +default/compile command (bound to M-b)
This commit is contained in:
parent
9961df061e
commit
aeb030e391
2 changed files with 18 additions and 1 deletions
|
@ -53,7 +53,7 @@
|
|||
;; Other sensible, textmate-esque global bindings
|
||||
:ne "M-r" #'+eval/buffer
|
||||
:ne "M-R" #'+eval/region-and-replace
|
||||
:ne "M-b" #'compile
|
||||
:ne "M-b" #'+default/compile
|
||||
:ne "M-a" #'mark-whole-buffer
|
||||
:ne "M-c" #'evil-yank
|
||||
:ne "M-q" (if (daemonp) #'delete-frame #'evil-quit-all)
|
||||
|
|
|
@ -38,3 +38,20 @@
|
|||
(defun +default/browse-snippets ()
|
||||
(interactive) (doom-project-browse emacs-snippets-dir))
|
||||
;; NOTE No need for a browse-snippets variant, use `yas-visit-snippet-file'
|
||||
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/compile (arg)
|
||||
"Runs `compile' from the root of the current project.
|
||||
|
||||
If a compilation window is already open, recompile that instead.
|
||||
|
||||
If ARG (universal argument), runs `compile' from the current directory."
|
||||
(interactive "P")
|
||||
(if (and (bound-and-true-p compilation-in-progress)
|
||||
(buffer-live-p compilation-last-buffer))
|
||||
(recompile)
|
||||
(call-interactively
|
||||
(if arg
|
||||
#'projectile-compile-project
|
||||
#'compile))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue