Add `SPC c q` to close the compilation window

I found it annoying to have to re-navigate to the *compilation* window
and close it after every time I compile with `SPC p c`.

This patch adds a binding to make closing this window fast and easy.

Also a little bit of clean up.
This commit is contained in:
Joe Hillenbrand 2015-11-12 02:45:53 -08:00 committed by Eivind Fonn
parent 2a2505de49
commit 3b6fd59245
3 changed files with 12 additions and 2 deletions

View File

@ -2575,6 +2575,7 @@ Spacemacs binds a few commands to support compiling a project.
| ~SPC c c~ | use =helm-make= via projectile |
| ~SPC c C~ | compile |
| ~SPC c r~ | recompile |
| ~SPC c q~ | close compilation window |
** Modes
*** Major Mode leader key

View File

@ -905,3 +905,8 @@ is nonempty."
while (string-match regexp str start)
do (setq start (match-end 0))
finally return count))
(defun spacemacs/close-compilation-window ()
"Close the window containing the '*compilation*' buffer."
(interactive)
(delete-windows-on "*compilation*"))

View File

@ -159,9 +159,13 @@ Ensure that helm is required before calling FUNC."
(evil-leader/set-key
"jh" 'spacemacs/push-mark-and-goto-beginning-of-line
"jl" 'spacemacs/push-mark-and-goto-end-of-line)
;; Compilation ----------------------------------------------------------------
(evil-leader/set-key "cC" 'compile)
(evil-leader/set-key "cr" 'recompile)
(evil-leader/set-key
"cC" 'compile
"cr" 'recompile
"cq" 'spacemacs/close-compilation-window)
;; narrow & widen -------------------------------------------------------------
(evil-leader/set-key
"nr" 'narrow-to-region