Archived
1
0
Fork 0

improve scratch buffer handling / kbd shortcuts

This commit is contained in:
KemoNine 2024-07-27 09:39:11 -04:00
parent e8745cf990
commit 9025732e3b
2 changed files with 29 additions and 0 deletions

View file

@ -533,6 +533,8 @@
(use-package popwin (use-package popwin
:bind ( :map popwin:keymap :bind ( :map popwin:keymap
("h" . popwin:close-popup-window) ("h" . popwin:close-popup-window)
("r" . kmn/workspace-frame-scratch)
("R" . kmn/popwin-scratch)
("q" . kmn/popwin-quick-ref)) ("q" . kmn/popwin-quick-ref))
:config :config
(global-set-key (kbd "C-w") popwin:keymap) (global-set-key (kbd "C-w") popwin:keymap)

View file

@ -150,6 +150,33 @@
) )
) )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; open text-mode scratch in left side window
(defun kmn/scratch-prompt-on-left ()
(defvar parameters
'(window-parameters . ((no-other-window . t)
(no-delete-other-windows . t))))
(setq fit-window-to-buffer-horizontally t)
(setq window-resize-pixelwise t)
"Display `default-directory' in side window on left, hiding details."
(interactive)
(let ((buffer (scratch (let ((current-prefix-arg t)) (scratch--buffer-querymode)))))
(display-buffer-in-side-window
buffer `((side . left) (slot . -1)
(window-width . fit-window-to-buffer)
, parameters)
)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; text-mode scratch buffer as a pop up window
(defun kmn/popwin-scratch ()
(interactive)
(popwin:popup-buffer (scratch 'text-mode)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; quick reference notes as a pop up window ; quick reference notes as a pop up window
(defun kmn/popwin-quick-ref () (defun kmn/popwin-quick-ref ()