Created
April 13, 2010 19:05
-
-
Save chrisschreiner/364954 to your computer and use it in GitHub Desktop.
Jump to recent file via Ctrl-#
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
(defvar shortcut-list '(1 2 3 4 5)) | |
(defun unset-numeric-shortcuts (list) | |
(mapcar | |
'(lambda (n) | |
(global-unset-key (read-kbd-macro (format "C-%d" n)))) | |
list)) | |
(unset-numeric-shortcuts shortcut-list) | |
(defun frm-2 (list) | |
(apply 'concat (mapcar '(lambda (n) | |
(format "C-%d %s " n (elt (buffer-list) (1- n))) | |
) | |
list))) | |
(defun switch-to (name-of-buffer list) | |
(switch-to-buffer name-of-buffer t) | |
(message (format "Switching to %s <= %s" name-of-buffer (frm-2 list)))) | |
(defun map-it (list) | |
(mapcar 'eval | |
(mapcar '(lambda (e) | |
`(global-set-key | |
(read-kbd-macro ,(format "C-%s" e)) | |
(lambda () (interactive) | |
(switch-to (buffer-name (elt (buffer-list) ,(1- e))) ',list)))) | |
list))) | |
(global-set-key (kbd "C-0") (lambda () (interactive) (message (frm-2 shortcut-list)))) | |
(map-it shortcut-list) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment