Groom the fallback scratch buffer + mode-line
This commit is contained in:
parent
10616a8939
commit
b1fd406105
1 changed files with 11 additions and 7 deletions
|
@ -248,14 +248,18 @@ Examples:
|
||||||
(define-key evil-motion-state-map (kbd "S-SPC") ',prev-func)))
|
(define-key evil-motion-state-map (kbd "S-SPC") ',prev-func)))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
(defun narf|update-scratch-buffer-cwd (&optional dir) ; see core-editor.el
|
(defun narf|update-scratch-buffer-cwd (&optional dir)
|
||||||
"Make sure scratch buffer is always 'in a project.'"
|
"Make sure scratch buffer is always 'in a project', and looks good."
|
||||||
(let ((dir (or dir (narf/project-root))))
|
(let ((dir (or dir (narf/project-root)))
|
||||||
(with-current-buffer (get-buffer-create "*scratch*")
|
(scratchbuf (get-buffer-create "*scratch*")))
|
||||||
|
(with-current-buffer scratchbuf
|
||||||
|
;; Darken the window if it's the only one left
|
||||||
|
(if (one-window-p t)
|
||||||
|
(kill-local-variable 'face-remapping-alist)
|
||||||
|
(set (make-local-variable 'face-remapping-alist)
|
||||||
|
'((default narf-default))))
|
||||||
(setq default-directory dir)
|
(setq default-directory dir)
|
||||||
(setq header-line-format
|
(setq mode-line-format '(:eval (spaceline-ml-scratch))))))
|
||||||
'(:eval
|
|
||||||
(concat " ∴ " (abbreviate-file-name default-directory)))))))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue