feat(default): bind 'SPC b y' to yank whole buffer
Evil may not always be available in all buffers, and in line with the filepath yank commands on SPC f y/Y, I thought this command could be useful. However, I omitted a "replace buffer with paste" command because in any editing context, evil should be available, in which case it'd be redundant with `vigp` (or yig for yanking the buffer). Close: #5281 Co-authored-by: Alex Palaistras <deuill@users.noreply.github.com>
This commit is contained in:
parent
ec2062f517
commit
7ca50e0ce8
2 changed files with 7 additions and 0 deletions
|
@ -372,6 +372,7 @@
|
||||||
:desc "Save buffer as root" "u" #'doom/sudo-save-buffer
|
:desc "Save buffer as root" "u" #'doom/sudo-save-buffer
|
||||||
:desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer
|
:desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer
|
||||||
:desc "Switch to scratch buffer" "X" #'doom/switch-to-scratch-buffer
|
:desc "Switch to scratch buffer" "X" #'doom/switch-to-scratch-buffer
|
||||||
|
:desc "Yank buffer" "y" #'+default/yank-buffer-contents
|
||||||
:desc "Bury buffer" "z" #'bury-buffer
|
:desc "Bury buffer" "z" #'bury-buffer
|
||||||
:desc "Kill buried buffers" "Z" #'doom/kill-buried-buffers)
|
:desc "Kill buried buffers" "Z" #'doom/kill-buried-buffers)
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,12 @@
|
||||||
((fboundp 'helm-show-kill-ring) #'helm-show-kill-ring)
|
((fboundp 'helm-show-kill-ring) #'helm-show-kill-ring)
|
||||||
((error "No kill-ring search backend available. Enable ivy, helm or vertico!")))))
|
((error "No kill-ring search backend available. Enable ivy, helm or vertico!")))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +default/yank-buffer-contents ()
|
||||||
|
"Copy entire buffer into kill ring."
|
||||||
|
(interactive)
|
||||||
|
(clipboard-kill-ring-save (point-min) (point-max)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +default/yank-buffer-path (&optional root)
|
(defun +default/yank-buffer-path (&optional root)
|
||||||
"Copy the current buffer's path to the kill ring."
|
"Copy the current buffer's path to the kill ring."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue