Created
March 3, 2020 10:49
-
-
Save RaminHAL9001/55fba2b05f9e9da584b58951de37b481 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun rename-current-buffer (new-bufname) | |
"Prompts for a new buffer name in the minibuffer using the | |
current buffer name as an initial value, renames the current | |
buffer to the value entered." | |
(interactive | |
(let ((curbufname (buffer-name))) | |
(list (read-string "New buffer name: " curbufname 'buffer-name-history curbufname t)))) | |
(rename-buffer new-bufname)) | |
(global-set-key (kbd "C-c r b") 'rename-current-buffer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment