Created
March 26, 2022 18:10
-
-
Save riicchhaarrd/d3ec3c36d5d4329a034b7a44a90a214a to your computer and use it in GitHub Desktop.
emacs CTRL-A select all and cursor keys
This file contains hidden or 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 custom-select-all () | |
| (interactive) | |
| ;; (message "test %s" (key-description (string (read-event nil nil 2)))) | |
| (mark-whole-buffer) | |
| (setq tmp (read-event nil nil 0.3)) | |
| (if tmp | |
| (progn | |
| (when (string= "left" tmp) | |
| (deactivate-mark) | |
| ) | |
| (when (string= "right" tmp) | |
| (goto-char (region-end)) | |
| (deactivate-mark) | |
| ) | |
| (when (string= "down" tmp) | |
| (deactivate-mark) | |
| (next-line) | |
| ) | |
| (when (string= "up" tmp) | |
| (deactivate-mark) | |
| (previous-line) | |
| ) | |
| ;; (message "event %s" tmp) | |
| ) | |
| ) | |
| ) | |
| (global-set-key [(control a)] 'custom-select-all) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment