allow scratch buffer switching
This commit is contained in:
parent
d711fc89c3
commit
323a93b081
1 changed files with 13 additions and 0 deletions
13
init.el
13
init.el
|
@ -174,6 +174,10 @@
|
||||||
"ar" 'ranger
|
"ar" 'ranger
|
||||||
"ad" 'dired
|
"ad" 'dired
|
||||||
|
|
||||||
|
;; Buffers
|
||||||
|
"b" '(:ignore t :which-key "Buffers")
|
||||||
|
"bs" 'switch-to-scratch-buffer
|
||||||
|
|
||||||
;; Files
|
;; Files
|
||||||
"ff" 'counsel-find-file
|
"ff" 'counsel-find-file
|
||||||
"fL" 'counsel-locate
|
"fL" 'counsel-locate
|
||||||
|
@ -261,6 +265,15 @@
|
||||||
(window-configuration-to-register ?_)
|
(window-configuration-to-register ?_)
|
||||||
(delete-other-windows)))))
|
(delete-other-windows)))))
|
||||||
|
|
||||||
|
(defun switch-to-scratch-buffer (&optional arg)
|
||||||
|
"Switch to the `*scratch*' buffer, creating it first if needed.
|
||||||
|
if prefix argument ARG is given, switch to it in an other, possibly new window."
|
||||||
|
(interactive "P")
|
||||||
|
(let ((exists (get-buffer "*scratch*")))
|
||||||
|
(if arg
|
||||||
|
(switch-to-buffer-other-window (get-buffer-create "*scratch*"))
|
||||||
|
(switch-to-buffer (get-buffer-create "*scratch*")))))
|
||||||
|
|
||||||
(defun switch-to-last-buffer ()
|
(defun switch-to-last-buffer ()
|
||||||
"Switch to the last buffer, allowes quick jumping between the last two."
|
"Switch to the last buffer, allowes quick jumping between the last two."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue