Make config more emacsclient-friendly
This commit is contained in:
parent
72bf9df905
commit
b47b951a41
5 changed files with 24 additions and 10 deletions
|
@ -48,12 +48,13 @@
|
|||
'("*Command Line*" :size 8))
|
||||
|
||||
;; Set cursor colors later, presumably once theme is loaded
|
||||
(add-hook! 'after-init-hook
|
||||
(defun +evil*init-cursors (&rest _)
|
||||
(setq evil-default-cursor (face-attribute 'cursor :background nil t)
|
||||
evil-normal-state-cursor 'box
|
||||
evil-emacs-state-cursor `(,(face-attribute 'warning :foreground nil nil) box)
|
||||
evil-insert-state-cursor 'bar
|
||||
evil-visual-state-cursor 'hollow))
|
||||
(advice-add #'load-theme :after #'+evil*init-cursors)
|
||||
|
||||
;; highlight matching delimiters where it's important
|
||||
(defun +evil|show-paren-mode-off () (show-paren-mode -1))
|
||||
|
|
|
@ -42,17 +42,24 @@ renamed.")
|
|||
;; auto-save on kill
|
||||
persp-auto-save-opt 1)
|
||||
|
||||
(add-hook! 'after-init-hook
|
||||
(persp-mode +1)
|
||||
(defun +workspaces|init (&rest _)
|
||||
(unless persp-mode
|
||||
(persp-mode +1))
|
||||
;; The default perspective persp-mode makes (defined by `persp-nil-name') is
|
||||
;; special and doesn't actually represent a real persp object, so buffers
|
||||
;; can't really be assigned to it, among other quirks. We create a *real*
|
||||
;; main workspace to fill this role.
|
||||
(persp-add-new +workspaces-main)
|
||||
;; Switch to it if we aren't auto-loading the last session
|
||||
(when (= persp-auto-resume-time -1)
|
||||
(when (or (= persp-auto-resume-time -1)
|
||||
(equal (safe-persp-name (get-current-persp)) persp-nil-name))
|
||||
(persp-frame-switch +workspaces-main)))
|
||||
|
||||
(add-hook! 'after-init-hook
|
||||
(if (display-graphic-p)
|
||||
(+workspaces|init)
|
||||
(add-hook 'after-make-frame-functions '+workspaces|init)))
|
||||
|
||||
(define-key persp-mode-map [remap delete-window] #'+workspace/close-window-or-workspace)
|
||||
|
||||
;; Per-frame perspectives
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue