mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-06-14 04:11:18 +00:00
Shackle the plan
This commit is contained in:
parent
f71b0d1bbb
commit
3225fadb9a
1 changed files with 31 additions and 0 deletions
|
|
@ -848,3 +848,34 @@
|
|||
(use-package shell-command+
|
||||
:bind ("M-!" . shell-command+))
|
||||
#+end_src
|
||||
** shackle-mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package shackle)
|
||||
|
||||
(defun shackle--display-buffer-reuse (buffer alist)
|
||||
|
||||
(let ((window (display-buffer-reuse-window buffer
|
||||
;; Reuse frames
|
||||
(cons '(reusable-frames . t) alist))))
|
||||
(prog1 window
|
||||
(when (and window (window-live-p window)
|
||||
shackle-select-reused-windows)
|
||||
(select-window window)))))
|
||||
|
||||
(setq switch-to-buffer-obey-display-actions t
|
||||
shackle-select-reused-windows t)
|
||||
(setq shackle-rules '(("the_plan" :select t)))
|
||||
|
||||
(shackle-mode 1)
|
||||
|
||||
(defun get-the-plan ()
|
||||
(with-current-buffer (find-file-noselect "~/MEGA/org/agenda/plan.org")
|
||||
(rename-buffer "the_plan")
|
||||
(current-buffer)))
|
||||
|
||||
(defun the-plan ()
|
||||
(interactive)
|
||||
(switch-to-buffer (get-the-plan)))
|
||||
|
||||
(exwm-global-set-key (kbd "s-p") #'the-plan)
|
||||
#+end_src
|
||||
|
|
|
|||
Loading…
Reference in a new issue