Rename emacs stuff to make room for spacemacs
This commit is contained in:
parent
0c3a0642f6
commit
b52ede2d51
38 changed files with 0 additions and 0 deletions
89
.emacs.d.backup/ergoemacs-keybindings-5.1/_HISTORY.txt
Executable file
89
.emacs.d.backup/ergoemacs-keybindings-5.1/_HISTORY.txt
Executable file
|
|
@ -0,0 +1,89 @@
|
|||
-*- coding: utf-8 -*-
|
||||
|
||||
Note: When the context is about keys on the keyboard hardware, then QWERTY is used to indicate the key. For example, “Changed M+y to something”, that “y” means the key that is under the key 7. (which is Dvorak's “f”).
|
||||
|
||||
version 5, 2009-09-15 • A much improved version, by David Capello. This version is now a full featured minor mode. It supports 3 different keyboard layout: US QWERTY, US Dvorak, and “Spanish (Spain)” (aka “Spanish (International sort)”). Also supports a new command where-is-old-binding (with shortcut Ctrl+h o).
|
||||
|
||||
version 4.3.13, 2009-08-28 • improved shrink-whitespaces. Now, when called twice, it removes the remaining single space. Thanks to David Capello for the code.
|
||||
|
||||
version 4.3.12.2, 2009-08-15 • Fixed a bug where delete-selection-mode migth be turned off. Changed “(delete-selection-mode t)” to “(delete-selection-mode 1)”.
|
||||
|
||||
version 4.3.12.1, 2009-08-14 • A minor implementation improvement. In one place, changed the use of functionp to fboundp for checking the existing of a emacs 23 feature recenter-top-bottom. Was using functionp because i forgot about fboundp.
|
||||
|
||||
version 4.3.12, 2009-08-13 • Alt+p is now “recenter-top-bottom” for emacs 23 users. In emacs 22, it is “recenter”.
|
||||
|
||||
version 4.3.11, 2009-08-05 • Added a hook to fix message-mode.
|
||||
|
||||
version 4.3.10, 2009-06-14 • fixed a previous/next reversal for f11/f12 keys in rcirc-mode-hook. • diff-mode uses some bindings in M-‹key› space. Fixed by adding a diff-mode-hook. (thanks to lwarxx)
|
||||
|
||||
version 4.3.9, 2009-06-14 • unbind C-x 3 (use Alt+@ for split-window-horizontally) • unbind C-M-% (use Alt+% for query-replace-regexp). • unbind C-@ (use Alt+SPACE for set-mark-command). • unbind M-{ (use Alt+U for backward-paragraph). • unbind M-} (use Alt+O for forward-paragraph). Thanks to marciomazza
|
||||
|
||||
version 4.3.8, 2009-06-14 • added 【】 to select-text-in-quote.
|
||||
|
||||
version 4.3.7, 2009-05-27 • ibuffer's M-s changed in emacs 23, such that M-s is now a prefix. For Dvorak users, M-s should be isearch. This is reclaimed to be isearch. For qwerty users, M-s should be other-window. Fixed.
|
||||
|
||||
version 4.3.6, 2009-05-26 • dired's M-s changed in emacs 23, such that M-s is now a prefix. For Dvorak users, M-s should be isearch. This is reclaimed to be isearch. For qwerty users, M-s should be other-windox. Fixed.
|
||||
|
||||
version 4.3.5, 2009-05-10 • experimental modification to shrink-whitespaces.
|
||||
|
||||
version 4.3.4, 2009-04-19 • Added Alt+Shift+PageDown for forward-page (move cursor to the next ascii formfeed char (often displayed as ^L)). Same for PageDown key.
|
||||
|
||||
version 4.3.3, 2009-03-16 • Added Ctrl+Shift+n for opening a new window (make-frame-command). Removed “C-x 5 2”. Added Ctrl+Shift+w for closing window (delete-frame), removed “C-x 5 0”.
|
||||
|
||||
version 4.3.2, 2009-03-11 • Removed C-x o for other-window. (use Alt+s and Alt+Shift+s instead.)
|
||||
|
||||
version 4.3.1, 2009-03-04 • A better implementation for making M-t call M-TAB. So that, describe-key on M-t will show better documentation.
|
||||
|
||||
version 4.3.0, 2009-03-02 • Added Alt+Shift+x for cut-all and Alt+Shift+c for copy-all.
|
||||
|
||||
version 4.2.4, 2009-03-01 • Removed Ctrl+x Ctrl+w for write-file. Use Ctrl+Shift+s. • Fixed Ctrl+o for ibuffer to run find-file instead of ibuffer-visit-buffer-other-window-noselect.
|
||||
|
||||
version 4.2.3, 2009-03-01 • fixed a dired binding so that Ctrl+o runs find-file instead of dired-display-file
|
||||
|
||||
version 4.2.2, 2009-03-01 • Removed the default keybinding for split-window-vertically (Ctrl+x 2). Use Alt+2 instead. • The key “Ctrl+x Ctrl+b” is now ibuffer, instead of list-buffers. • “Ctrl+h m” now calls describe-major-mode.
|
||||
|
||||
version 4.2.1, 2009-02-28 Changed the keybinding for previous-user-buffer from Ctrl+← to Ctrl+PageUp. And previous-emacs-buffer from Ctrl+Shift+← to Ctrl+Shift+PageUp. Similar for the “next” versions. Rationale: The Ctrl+Arrow are standard editing shortcuts commond in Windows, Mac, Linux.
|
||||
|
||||
version 4.2.0, 2009-02-27 Added Alt+t for keyword completion. Rationale: The default M-TAB is used by Windows, Mac, Linux, to switch apps.
|
||||
|
||||
version 4.1.8, 2009-02-15 Corrected the keybinding for Save As (write-file)
|
||||
|
||||
version 4.1.7, 2008-12-10 Made compact-uncompact-block to work on text selection if there's one.
|
||||
|
||||
version 4.1.6, 2008-12-09. Added select-text-in-quote.
|
||||
|
||||
version 4.1.5, 2008-10-21. Added extend-selection by Nikolaj Schumacher.
|
||||
|
||||
version 4.1.4, 2008-10-20. Fixed close-current-buffer: sometimes when closing a buffer not associated with a file, it'll prompt whether to kill instead of whether to save.
|
||||
|
||||
version 4.1.3, 2008-10-18. Fixed minor bug in toggle-letter-case. It now works non-english letters such as éÉ and single letter word “a teapot” or words starting with a number “1st timer”. Thanks to Andreas Politz and Nikolaj Schumacher. • next-frame-command is renamed to switch-to-next-frame. Similar for previous-frame-command.
|
||||
|
||||
version 4.1.2, 2008-10-16. Removed C-x h for mark-whole-buffer. (use Ctrl+a instead) Improved compact-uncompact-block and shrink-whitespaces.
|
||||
|
||||
version 4.1.1, 2008-10-07. Removed unfill-paragraph and unfill-region because they are defined in ourcomments-util.el bundled with emacs 22, also because they are not used in this file now (compact-uncompact-block replaced most of their functionality).
|
||||
|
||||
version 4.1, 2008-10-06. Added keys for previous-user-buffer, next-user-buffer, next-frame-command, previous-frame-command, query-replace and query-replace-regexp, move-cursor-to-next-pane, move-cursor-to-previous-pane, split-window-horizontally, toggle-letter-case. Combined delete-blank-lines and just-one-space to shrink-whitespaces. Moved delete-window to be with delete-other-window.
|
||||
|
||||
version 4.0.1, 2008-09-23. Fixed C-o in dired mode.
|
||||
|
||||
version 4, 2008-09-21. Unbind almost all Meta-‹key› and Ctrl-‹key› space bindings. Added about 11 commands, such as next-user-buffer, close-current-buffer etc.
|
||||
|
||||
version 3.6, 2008-09-18. Reclaimed keybindings in text-mode.
|
||||
|
||||
version 3.5, 2008-09-16. Reclaimed keybindings in ibuffer.
|
||||
|
||||
version 3.4, 2008-09-06. Fixed key bindings in the Meta-‹key› space in about 10 modes.
|
||||
|
||||
version 3.3, 2008-09-05. Fixed cua-mode-hook by setting symbol property 'CUA to nil, so that a bunch of no-select-* functions kludge is no longer needed. Thanks to Lennart Borgman.
|
||||
|
||||
version 3.2, 2008-09-02. Moved cua fix functions to modern_operations.el. The functinos are: no-select-cua-scroll-down, no-select-cua-scroll-up, no-select-backward-paragraph, no-select-forward-paragraph, no-select-beginning-of-buffer, no-select-end-of-buffer, no-select-move-end-of-line.
|
||||
|
||||
version 3.1, 2008-09-02. Added just-one-space, delete-blank-lines. Added fill-paragraph, unfill-paragraph. Added comment-dwim.
|
||||
|
||||
version 3, 2008-08-31. Added isearch. Added redo, kill-line-backward, shell-command. Added bug fix for cua-mode. Now, commands with Shift keys won't go into a selection mode.
|
||||
|
||||
version 2, 2008-08-29. Somewhat major change. Positions for undo, cut, copy, paste, paste previous, has been moved. Added delete-char, delete-backward-char, kill-word, backward-kill-word. Removed the now redundant binding of kill-word and backward-kill-word using the backspace key. Removed the other-frame binding.
|
||||
|
||||
version 1.1, 2007-12-18. changed keycode to consistantly use kbd syntax. Fixed a scroll-up and scroll-down mixup.
|
||||
|
||||
version 1.0, 2007-08-01. first version, by Xah Lee
|
||||
64
.emacs.d.backup/ergoemacs-keybindings-5.1/_INSTALL.txt
Executable file
64
.emacs.d.backup/ergoemacs-keybindings-5.1/_INSTALL.txt
Executable file
|
|
@ -0,0 +1,64 @@
|
|||
-*- coding: utf-8 -*-
|
||||
|
||||
INSTALLATION INSTRUCTIONS
|
||||
|
||||
------------------------------
|
||||
1. Unzip the folder.
|
||||
|
||||
If you downloaded a file named “ergoemacs-keybindings_v123.zip”, unzip it.
|
||||
Now you should have a folder named “ergoemacs-keybindings_v123”.
|
||||
|
||||
------------------------------
|
||||
2. Place the folder somewhere in your home directory. For examples:
|
||||
|
||||
On Windows:
|
||||
C:\Users\mary\.emacs.d\ergoemacs-keybindings_v123
|
||||
|
||||
On Mac OS X or Linux:
|
||||
/Users/mary/.emacs.d/ergoemacs-keybindings_v123
|
||||
|
||||
------------------------------
|
||||
3. Specify your keyboard layout.
|
||||
|
||||
Place one of the following line in your emacs init file (~/.emacs):
|
||||
|
||||
(setenv "ERGOEMACS_KEYBOARD_LAYOUT" "us") ; US layout
|
||||
|
||||
(setenv "ERGOEMACS_KEYBOARD_LAYOUT" "dv") ; US Dvorak layout
|
||||
|
||||
(setenv "ERGOEMACS_KEYBOARD_LAYOUT" "sp") ; Spanish (Spain) (aka “Spanish (International sort)”)
|
||||
|
||||
(setenv "ERGOEMACS_KEYBOARD_LAYOUT" "it") ; Italian layout
|
||||
|
||||
(setenv "ERGOEMACS_KEYBOARD_LAYOUT" "colemak") ; Colemak layout
|
||||
|
||||
------------------------------
|
||||
4. Make Emacs load the file, and turn on the mode.
|
||||
|
||||
Place the following lines in your emacs init file. Make sure that the path points to your file is correct. You do not need to have the file path end in “.el”.
|
||||
|
||||
;; load ErgoEmacs keybinding
|
||||
(load "~/.emacs.d/ergoemacs-keybindings/ergoemacs-mode")
|
||||
|
||||
;; turn on minor mode ergoemacs-mode
|
||||
(ergoemacs-mode 1)
|
||||
|
||||
These lines should be placed below your keyboard layout in step 3.
|
||||
|
||||
------------------------------
|
||||
5. Restart emacs.
|
||||
|
||||
Now, your will be using the new keybinding. The shortcut for emacs's “M-x” is now “Alt+a”.
|
||||
|
||||
To turn off the mode, type “Alt+a” then “ergoemacs-mode”. After that, your keybinding is the same as GNU Emacs's default keybinding.
|
||||
|
||||
The command “ergoemacs-mode” toggles the minor mode.
|
||||
|
||||
--------------------------------------------------
|
||||
Byte Compile Elisp Files (Optional)
|
||||
|
||||
If you like, you can byte-compile the elisp files. To byte compile them, call the command byte-compile-file, then the elisp file name. Once you do that, emacs will create a file with “.elc” ending, and will automatically load byte compiled file if there is one.
|
||||
|
||||
Byte compiled files makes loading and running programs about 5 or more times faster, but for small elisp files, the speed increse is probably not noticeable.
|
||||
|
||||
You do not need to change any lines in the emacs initialization given above.
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
;; Shortcuts for ERGOEMACS_KEYBOARD_LAYOUT=colemak
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; CURSOR MOVEMENTS
|
||||
|
||||
;; Single char cursor movement
|
||||
(defconst ergoemacs-backward-char-key (kbd "M-n"))
|
||||
(defconst ergoemacs-forward-char-key (kbd "M-i"))
|
||||
(defconst ergoemacs-previous-line-key (kbd "M-u"))
|
||||
(defconst ergoemacs-next-line-key (kbd "M-e"))
|
||||
|
||||
;; Move by word
|
||||
(defconst ergoemacs-backward-word-key (kbd "M-l"))
|
||||
(defconst ergoemacs-forward-word-key (kbd "M-y"))
|
||||
|
||||
;; Move by paragraph
|
||||
(defconst ergoemacs-backward-paragraph-key (kbd "M-L"))
|
||||
(defconst ergoemacs-forward-paragraph-key (kbd "M-Y"))
|
||||
|
||||
;; Move to beginning/ending of line
|
||||
(defconst ergoemacs-move-beginning-of-line-key (kbd "M-h"))
|
||||
(defconst ergoemacs-move-end-of-line-key (kbd "M-H"))
|
||||
|
||||
;; Move by screen (page up/down)
|
||||
(defconst ergoemacs-scroll-down-key (kbd "M-U"))
|
||||
(defconst ergoemacs-scroll-up-key (kbd "M-E"))
|
||||
|
||||
;; Move to beginning/ending of file
|
||||
(defconst ergoemacs-beginning-of-buffer-key (kbd "M-N"))
|
||||
(defconst ergoemacs-end-of-buffer-key (kbd "M-I"))
|
||||
|
||||
;; isearch
|
||||
(defconst ergoemacs-isearch-forward-key (kbd "M-o"))
|
||||
(defconst ergoemacs-isearch-backward-key (kbd "M-O"))
|
||||
|
||||
(defconst ergoemacs-recenter-key (kbd "M-;"))
|
||||
|
||||
;;; MAJOR EDITING COMMANDS
|
||||
|
||||
;; Delete previous/next char.
|
||||
(defconst ergoemacs-delete-backward-char-key (kbd "M-s"))
|
||||
(defconst ergoemacs-delete-char-key (kbd "M-t"))
|
||||
|
||||
; Delete previous/next word.
|
||||
(defconst ergoemacs-backward-kill-word-key (kbd "M-f"))
|
||||
(defconst ergoemacs-kill-word-key (kbd "M-p"))
|
||||
|
||||
; Copy Cut Paste, Paste previous
|
||||
(defconst ergoemacs-kill-region-key (kbd "M-x"))
|
||||
(defconst ergoemacs-kill-ring-save-key (kbd "M-c"))
|
||||
(defconst ergoemacs-yank-key (kbd "M-v"))
|
||||
(defconst ergoemacs-yank-pop-key (kbd "M-V"))
|
||||
(defconst ergoemacs-copy-all-key (kbd "M-C"))
|
||||
(defconst ergoemacs-cut-all-key (kbd "M-X"))
|
||||
|
||||
;; undo and redo
|
||||
(defconst ergoemacs-redo-key (kbd "M-Z"))
|
||||
(defconst ergoemacs-undo-key (kbd "M-z"))
|
||||
|
||||
; Kill line
|
||||
(defconst ergoemacs-kill-line-key (kbd "M-d"))
|
||||
(defconst ergoemacs-kill-line-backward-key (kbd "M-D"))
|
||||
|
||||
;;; Textual Transformation
|
||||
|
||||
(defconst ergoemacs-mark-paragraph-key (kbd "M-S-SPC"))
|
||||
(defconst ergoemacs-shrink-whitespaces-key (kbd "M-w"))
|
||||
(defconst ergoemacs-comment-dwim-key (kbd "M-'"))
|
||||
(defconst ergoemacs-toggle-letter-case-key (kbd "M-/"))
|
||||
|
||||
; keyword completion, because Alt+Tab is used by OS
|
||||
(defconst ergoemacs-call-keyword-completion-key (kbd "M-g"))
|
||||
|
||||
; Hard-wrap/un-hard-wrap paragraph
|
||||
(defconst ergoemacs-compact-uncompact-block-key (kbd "M-q"))
|
||||
|
||||
;;; EMACS'S SPECIAL COMMANDS
|
||||
|
||||
; Mark point.
|
||||
(defconst ergoemacs-set-mark-command-key (kbd "M-SPC"))
|
||||
|
||||
(defconst ergoemacs-execute-extended-command-key (kbd "M-a"))
|
||||
(defconst ergoemacs-shell-command-key (kbd "M-A"))
|
||||
|
||||
;;; WINDOW SPLITING
|
||||
(defconst ergoemacs-move-cursor-next-pane-key (kbd "M-r"))
|
||||
(defconst ergoemacs-move-cursor-previous-pane-key (kbd "M-R"))
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; OTHER SHORTCUTS
|
||||
|
||||
(defconst ergoemacs-switch-to-previous-frame-key (kbd "M-~"))
|
||||
(defconst ergoemacs-switch-to-next-frame-key (kbd "M-`"))
|
||||
|
||||
(defconst ergoemacs-query-replace-key (kbd "M-5"))
|
||||
(defconst ergoemacs-query-replace-regexp-key (kbd "M-%"))
|
||||
|
||||
(defconst ergoemacs-delete-other-windows-key (kbd "M-1"))
|
||||
(defconst ergoemacs-delete-window-key (kbd "M-!"))
|
||||
|
||||
(defconst ergoemacs-split-window-vertically-key (kbd "M-2"))
|
||||
(defconst ergoemacs-split-window-horizontally-key (kbd "M-@"))
|
||||
|
||||
(defconst ergoemacs-extend-selection-key (kbd "M-8"))
|
||||
(defconst ergoemacs-select-text-in-quote-key (kbd "M-*"))
|
||||
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-dv.el
Executable file
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-dv.el
Executable file
|
|
@ -0,0 +1,106 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
;; Shortcuts for ERGOEMACS_KEYBOARD_LAYOUT=dv | us_dvorak
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; CURSOR MOVEMENTS
|
||||
|
||||
;; Single char cursor movement
|
||||
(defconst ergoemacs-backward-char-key (kbd "M-h"))
|
||||
(defconst ergoemacs-forward-char-key (kbd "M-n"))
|
||||
(defconst ergoemacs-previous-line-key (kbd "M-c"))
|
||||
(defconst ergoemacs-next-line-key (kbd "M-t"))
|
||||
|
||||
;; Move by word
|
||||
(defconst ergoemacs-backward-word-key (kbd "M-g"))
|
||||
(defconst ergoemacs-forward-word-key (kbd "M-r"))
|
||||
|
||||
;; Move by paragraph
|
||||
(defconst ergoemacs-backward-paragraph-key (kbd "M-G"))
|
||||
(defconst ergoemacs-forward-paragraph-key (kbd "M-R"))
|
||||
|
||||
;; Move to beginning/ending of line
|
||||
(defconst ergoemacs-move-beginning-of-line-key (kbd "M-d"))
|
||||
(defconst ergoemacs-move-end-of-line-key (kbd "M-D"))
|
||||
|
||||
;; Move by screen (page up/down)
|
||||
(defconst ergoemacs-scroll-down-key (kbd "M-C"))
|
||||
(defconst ergoemacs-scroll-up-key (kbd "M-T"))
|
||||
|
||||
;; Move to beginning/ending of file
|
||||
(defconst ergoemacs-beginning-of-buffer-key (kbd "M-H"))
|
||||
(defconst ergoemacs-end-of-buffer-key (kbd "M-N"))
|
||||
|
||||
;; isearch
|
||||
(defconst ergoemacs-isearch-forward-key (kbd "M-s"))
|
||||
(defconst ergoemacs-isearch-backward-key (kbd "M-S"))
|
||||
|
||||
(defconst ergoemacs-recenter-key (kbd "M-l"))
|
||||
|
||||
;;; MAJOR EDITING COMMANDS
|
||||
|
||||
;; Delete previous/next char.
|
||||
(defconst ergoemacs-delete-backward-char-key (kbd "M-e"))
|
||||
(defconst ergoemacs-delete-char-key (kbd "M-u"))
|
||||
|
||||
; Delete previous/next word.
|
||||
(defconst ergoemacs-backward-kill-word-key (kbd "M-."))
|
||||
(defconst ergoemacs-kill-word-key (kbd "M-p"))
|
||||
|
||||
; Copy Cut Paste, Paste previous
|
||||
(defconst ergoemacs-kill-region-key (kbd "M-q"))
|
||||
(defconst ergoemacs-kill-ring-save-key (kbd "M-j"))
|
||||
(defconst ergoemacs-yank-key (kbd "M-k"))
|
||||
(defconst ergoemacs-yank-pop-key (kbd "M-K"))
|
||||
(defconst ergoemacs-copy-all-key (kbd "M-J"))
|
||||
(defconst ergoemacs-cut-all-key (kbd "M-Q"))
|
||||
|
||||
;; undo and redo
|
||||
(defconst ergoemacs-redo-key (kbd "M-:"))
|
||||
(defconst ergoemacs-undo-key (kbd "M-;"))
|
||||
|
||||
; Kill line
|
||||
(defconst ergoemacs-kill-line-key (kbd "M-i"))
|
||||
(defconst ergoemacs-kill-line-backward-key (kbd "M-I"))
|
||||
|
||||
;;; Textual Transformation
|
||||
|
||||
(defconst ergoemacs-mark-paragraph-key (kbd "M-S-SPC"))
|
||||
(defconst ergoemacs-shrink-whitespaces-key (kbd "M-,"))
|
||||
(defconst ergoemacs-comment-dwim-key (kbd "M--"))
|
||||
(defconst ergoemacs-toggle-letter-case-key (kbd "M-z"))
|
||||
|
||||
; keyword completion, because Alt+Tab is used by OS
|
||||
(defconst ergoemacs-call-keyword-completion-key (kbd "M-y"))
|
||||
|
||||
; Hard-wrap/un-hard-wrap paragraph
|
||||
(defconst ergoemacs-compact-uncompact-block-key (kbd "M-'"))
|
||||
|
||||
;;; EMACS'S SPECIAL COMMANDS
|
||||
|
||||
; Mark point.
|
||||
(defconst ergoemacs-set-mark-command-key (kbd "M-SPC"))
|
||||
|
||||
(defconst ergoemacs-execute-extended-command-key (kbd "M-a"))
|
||||
(defconst ergoemacs-shell-command-key (kbd "M-A"))
|
||||
|
||||
;;; WINDOW SPLITING
|
||||
(defconst ergoemacs-move-cursor-next-pane-key (kbd "M-o"))
|
||||
(defconst ergoemacs-move-cursor-previous-pane-key (kbd "M-O"))
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; OTHER SHORTCUTS
|
||||
|
||||
(defconst ergoemacs-switch-to-previous-frame-key (kbd "M-~"))
|
||||
(defconst ergoemacs-switch-to-next-frame-key (kbd "M-`"))
|
||||
|
||||
(defconst ergoemacs-query-replace-key (kbd "M-5"))
|
||||
(defconst ergoemacs-query-replace-regexp-key (kbd "M-%"))
|
||||
|
||||
(defconst ergoemacs-delete-other-windows-key (kbd "M-1"))
|
||||
(defconst ergoemacs-delete-window-key (kbd "M-!"))
|
||||
|
||||
(defconst ergoemacs-split-window-vertically-key (kbd "M-2"))
|
||||
(defconst ergoemacs-split-window-horizontally-key (kbd "M-@"))
|
||||
|
||||
(defconst ergoemacs-extend-selection-key (kbd "M-8"))
|
||||
(defconst ergoemacs-select-text-in-quote-key (kbd "M-*"))
|
||||
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-it.el
Normal file
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-it.el
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
;; Shortcuts for ERGOEMACS_KEYBOARD_LAYOUT=it
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; CURSOR MOVEMENTS
|
||||
|
||||
;; Single char cursor movement
|
||||
(defconst ergoemacs-backward-char-key (kbd "M-j"))
|
||||
(defconst ergoemacs-forward-char-key (kbd "M-l"))
|
||||
(defconst ergoemacs-previous-line-key (kbd "M-i"))
|
||||
(defconst ergoemacs-next-line-key (kbd "M-k"))
|
||||
|
||||
;; Move by word
|
||||
(defconst ergoemacs-backward-word-key (kbd "M-u"))
|
||||
(defconst ergoemacs-forward-word-key (kbd "M-o"))
|
||||
|
||||
;; Move by paragraph
|
||||
(defconst ergoemacs-backward-paragraph-key (kbd "M-U"))
|
||||
(defconst ergoemacs-forward-paragraph-key (kbd "M-O"))
|
||||
|
||||
;; Move to beginning/ending of line
|
||||
(defconst ergoemacs-move-beginning-of-line-key (kbd "M-h"))
|
||||
(defconst ergoemacs-move-end-of-line-key (kbd "M-H"))
|
||||
|
||||
;; Move by screen (page up/down)
|
||||
(defconst ergoemacs-scroll-down-key (kbd "M-I"))
|
||||
(defconst ergoemacs-scroll-up-key (kbd "M-K"))
|
||||
|
||||
;; Move to beginning/ending of file
|
||||
(defconst ergoemacs-beginning-of-buffer-key (kbd "M-J"))
|
||||
(defconst ergoemacs-end-of-buffer-key (kbd "M-L"))
|
||||
|
||||
;; isearch
|
||||
(defconst ergoemacs-isearch-forward-key (kbd "M-ò"))
|
||||
(defconst ergoemacs-isearch-backward-key (kbd "M-ç"))
|
||||
|
||||
(defconst ergoemacs-recenter-key (kbd "M-p"))
|
||||
|
||||
;;; MAJOR EDITING COMMANDS
|
||||
|
||||
;; Delete previous/next char.
|
||||
(defconst ergoemacs-delete-backward-char-key (kbd "M-d"))
|
||||
(defconst ergoemacs-delete-char-key (kbd "M-f"))
|
||||
|
||||
; Delete previous/next word.
|
||||
(defconst ergoemacs-backward-kill-word-key (kbd "M-e"))
|
||||
(defconst ergoemacs-kill-word-key (kbd "M-r"))
|
||||
|
||||
; Copy Cut Paste, Paste previous
|
||||
(defconst ergoemacs-kill-region-key (kbd "M-x"))
|
||||
(defconst ergoemacs-kill-ring-save-key (kbd "M-c"))
|
||||
(defconst ergoemacs-yank-key (kbd "M-v"))
|
||||
(defconst ergoemacs-yank-pop-key (kbd "M-V"))
|
||||
(defconst ergoemacs-copy-all-key (kbd "M-C"))
|
||||
(defconst ergoemacs-cut-all-key (kbd "M-X"))
|
||||
|
||||
;; undo and redo
|
||||
(defconst ergoemacs-redo-key (kbd "M-Z"))
|
||||
(defconst ergoemacs-undo-key (kbd "M-z"))
|
||||
|
||||
; Kill line
|
||||
(defconst ergoemacs-kill-line-key (kbd "M-g"))
|
||||
(defconst ergoemacs-kill-line-backward-key (kbd "M-G"))
|
||||
|
||||
;;; Textual Transformation
|
||||
|
||||
(defconst ergoemacs-mark-paragraph-key (kbd "M-S-SPC"))
|
||||
(defconst ergoemacs-shrink-whitespaces-key (kbd "M-w"))
|
||||
(defconst ergoemacs-comment-dwim-key (kbd "M-à"))
|
||||
(defconst ergoemacs-toggle-letter-case-key (kbd "M--"))
|
||||
|
||||
; keyword completion, because Alt+Tab is used by OS
|
||||
(defconst ergoemacs-call-keyword-completion-key (kbd "M-t"))
|
||||
|
||||
; Hard-wrap/un-hard-wrap paragraph
|
||||
(defconst ergoemacs-compact-uncompact-block-key (kbd "M-q"))
|
||||
|
||||
;;; EMACS'S SPECIAL COMMANDS
|
||||
|
||||
; Mark point.
|
||||
(defconst ergoemacs-set-mark-command-key (kbd "M-SPC"))
|
||||
|
||||
(defconst ergoemacs-execute-extended-command-key (kbd "M-a"))
|
||||
(defconst ergoemacs-shell-command-key (kbd "M-A"))
|
||||
|
||||
;;; WINDOW SPLITING
|
||||
(defconst ergoemacs-move-cursor-next-pane-key (kbd "M-s"))
|
||||
(defconst ergoemacs-move-cursor-previous-pane-key (kbd "M-S"))
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; OTHER SHORTCUTS
|
||||
|
||||
(defconst ergoemacs-switch-to-previous-frame-key (kbd "M-|"))
|
||||
(defconst ergoemacs-switch-to-next-frame-key (kbd "M-\\"))
|
||||
|
||||
(defconst ergoemacs-query-replace-key (kbd "M-5"))
|
||||
(defconst ergoemacs-query-replace-regexp-key (kbd "M-%"))
|
||||
|
||||
(defconst ergoemacs-delete-other-windows-key (kbd "M-1"))
|
||||
(defconst ergoemacs-delete-window-key (kbd "M-!"))
|
||||
|
||||
(defconst ergoemacs-split-window-vertically-key (kbd "M-2"))
|
||||
(defconst ergoemacs-split-window-horizontally-key (kbd "M-\""))
|
||||
|
||||
(defconst ergoemacs-extend-selection-key (kbd "M-8"))
|
||||
(defconst ergoemacs-select-text-in-quote-key (kbd "M-("))
|
||||
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-sp.el
Normal file
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-sp.el
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
;; Shortcuts for ERGOEMACS_KEYBOARD_LAYOUT=sp
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; CURSOR MOVEMENTS
|
||||
|
||||
;; Single char cursor movement
|
||||
(defconst ergoemacs-backward-char-key (kbd "M-j"))
|
||||
(defconst ergoemacs-forward-char-key (kbd "M-l"))
|
||||
(defconst ergoemacs-previous-line-key (kbd "M-i"))
|
||||
(defconst ergoemacs-next-line-key (kbd "M-k"))
|
||||
|
||||
;; Move by word
|
||||
(defconst ergoemacs-backward-word-key (kbd "M-u"))
|
||||
(defconst ergoemacs-forward-word-key (kbd "M-o"))
|
||||
|
||||
;; Move by paragraph
|
||||
(defconst ergoemacs-backward-paragraph-key (kbd "M-U"))
|
||||
(defconst ergoemacs-forward-paragraph-key (kbd "M-O"))
|
||||
|
||||
;; Move to beginning/ending of line
|
||||
(defconst ergoemacs-move-beginning-of-line-key (kbd "M-h"))
|
||||
(defconst ergoemacs-move-end-of-line-key (kbd "M-H"))
|
||||
|
||||
;; Move by screen (page up/down)
|
||||
(defconst ergoemacs-scroll-down-key (kbd "M-I"))
|
||||
(defconst ergoemacs-scroll-up-key (kbd "M-K"))
|
||||
|
||||
;; Move to beginning/ending of file
|
||||
(defconst ergoemacs-beginning-of-buffer-key (kbd "M-J"))
|
||||
(defconst ergoemacs-end-of-buffer-key (kbd "M-L"))
|
||||
|
||||
;; isearch
|
||||
(defconst ergoemacs-isearch-forward-key (kbd "M-ñ"))
|
||||
(defconst ergoemacs-isearch-backward-key (kbd "M-Ñ"))
|
||||
|
||||
(defconst ergoemacs-recenter-key (kbd "M-p"))
|
||||
|
||||
;;; MAJOR EDITING COMMANDS
|
||||
|
||||
;; Delete previous/next char.
|
||||
(defconst ergoemacs-delete-backward-char-key (kbd "M-d"))
|
||||
(defconst ergoemacs-delete-char-key (kbd "M-f"))
|
||||
|
||||
; Delete previous/next word.
|
||||
(defconst ergoemacs-backward-kill-word-key (kbd "M-e"))
|
||||
(defconst ergoemacs-kill-word-key (kbd "M-r"))
|
||||
|
||||
; Copy Cut Paste, Paste previous
|
||||
(defconst ergoemacs-kill-region-key (kbd "M-x"))
|
||||
(defconst ergoemacs-kill-ring-save-key (kbd "M-c"))
|
||||
(defconst ergoemacs-yank-key (kbd "M-v"))
|
||||
(defconst ergoemacs-yank-pop-key (kbd "M-V"))
|
||||
(defconst ergoemacs-copy-all-key (kbd "M-C"))
|
||||
(defconst ergoemacs-cut-all-key (kbd "M-X"))
|
||||
|
||||
;; undo and redo
|
||||
(defconst ergoemacs-redo-key (kbd "M-Z"))
|
||||
(defconst ergoemacs-undo-key (kbd "M-z"))
|
||||
|
||||
; Kill line
|
||||
(defconst ergoemacs-kill-line-key (kbd "M-g"))
|
||||
(defconst ergoemacs-kill-line-backward-key (kbd "M-G"))
|
||||
|
||||
;;; Textual Transformation
|
||||
|
||||
(defconst ergoemacs-mark-paragraph-key (kbd "M-S-SPC"))
|
||||
(defconst ergoemacs-shrink-whitespaces-key (kbd "M-w"))
|
||||
(defconst ergoemacs-comment-dwim-key (kbd "M-´"))
|
||||
(defconst ergoemacs-toggle-letter-case-key (kbd "M--"))
|
||||
|
||||
; keyword completion, because Alt+Tab is used by OS
|
||||
(defconst ergoemacs-call-keyword-completion-key (kbd "M-t"))
|
||||
|
||||
; Hard-wrap/un-hard-wrap paragraph
|
||||
(defconst ergoemacs-compact-uncompact-block-key (kbd "M-q"))
|
||||
|
||||
;;; EMACS'S SPECIAL COMMANDS
|
||||
|
||||
; Mark point.
|
||||
(defconst ergoemacs-set-mark-command-key (kbd "M-SPC"))
|
||||
|
||||
(defconst ergoemacs-execute-extended-command-key (kbd "M-a"))
|
||||
(defconst ergoemacs-shell-command-key (kbd "M-A"))
|
||||
|
||||
;;; WINDOW SPLITING
|
||||
(defconst ergoemacs-move-cursor-next-pane-key (kbd "M-s"))
|
||||
(defconst ergoemacs-move-cursor-previous-pane-key (kbd "M-S"))
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; OTHER SHORTCUTS
|
||||
|
||||
(defconst ergoemacs-switch-to-previous-frame-key (kbd "M-ª"))
|
||||
(defconst ergoemacs-switch-to-next-frame-key (kbd "M-º"))
|
||||
|
||||
(defconst ergoemacs-query-replace-key (kbd "M-5"))
|
||||
(defconst ergoemacs-query-replace-regexp-key (kbd "M-%"))
|
||||
|
||||
(defconst ergoemacs-delete-other-windows-key (kbd "M-1"))
|
||||
(defconst ergoemacs-delete-window-key (kbd "M-!"))
|
||||
|
||||
(defconst ergoemacs-split-window-vertically-key (kbd "M-2"))
|
||||
(defconst ergoemacs-split-window-horizontally-key (kbd "M-\""))
|
||||
|
||||
(defconst ergoemacs-extend-selection-key (kbd "M-8"))
|
||||
(defconst ergoemacs-select-text-in-quote-key (kbd "M-("))
|
||||
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-us.el
Executable file
106
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-layout-us.el
Executable file
|
|
@ -0,0 +1,106 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
;; Shortcuts for ERGOEMACS_KEYBOARD_LAYOUT=us
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; CURSOR MOVEMENTS
|
||||
|
||||
;; Single char cursor movement
|
||||
(defconst ergoemacs-backward-char-key (kbd "M-j"))
|
||||
(defconst ergoemacs-forward-char-key (kbd "M-l"))
|
||||
(defconst ergoemacs-previous-line-key (kbd "M-i"))
|
||||
(defconst ergoemacs-next-line-key (kbd "M-k"))
|
||||
|
||||
;; Move by word
|
||||
(defconst ergoemacs-backward-word-key (kbd "M-u"))
|
||||
(defconst ergoemacs-forward-word-key (kbd "M-o"))
|
||||
|
||||
;; Move by paragraph
|
||||
(defconst ergoemacs-backward-paragraph-key (kbd "M-U"))
|
||||
(defconst ergoemacs-forward-paragraph-key (kbd "M-O"))
|
||||
|
||||
;; Move to beginning/ending of line
|
||||
(defconst ergoemacs-move-beginning-of-line-key (kbd "M-h"))
|
||||
(defconst ergoemacs-move-end-of-line-key (kbd "M-H"))
|
||||
|
||||
;; Move by screen (page up/down)
|
||||
(defconst ergoemacs-scroll-down-key (kbd "M-I"))
|
||||
(defconst ergoemacs-scroll-up-key (kbd "M-K"))
|
||||
|
||||
;; Move to beginning/ending of file
|
||||
(defconst ergoemacs-beginning-of-buffer-key (kbd "M-J"))
|
||||
(defconst ergoemacs-end-of-buffer-key (kbd "M-L"))
|
||||
|
||||
;; isearch
|
||||
(defconst ergoemacs-isearch-forward-key (kbd "M-;"))
|
||||
(defconst ergoemacs-isearch-backward-key (kbd "M-:"))
|
||||
|
||||
(defconst ergoemacs-recenter-key (kbd "M-p"))
|
||||
|
||||
;;; MAJOR EDITING COMMANDS
|
||||
|
||||
;; Delete previous/next char.
|
||||
(defconst ergoemacs-delete-backward-char-key (kbd "M-d"))
|
||||
(defconst ergoemacs-delete-char-key (kbd "M-f"))
|
||||
|
||||
; Delete previous/next word.
|
||||
(defconst ergoemacs-backward-kill-word-key (kbd "M-e"))
|
||||
(defconst ergoemacs-kill-word-key (kbd "M-r"))
|
||||
|
||||
; Copy Cut Paste, Paste previous
|
||||
(defconst ergoemacs-kill-region-key (kbd "M-x"))
|
||||
(defconst ergoemacs-kill-ring-save-key (kbd "M-c"))
|
||||
(defconst ergoemacs-yank-key (kbd "M-v"))
|
||||
(defconst ergoemacs-yank-pop-key (kbd "M-V"))
|
||||
(defconst ergoemacs-copy-all-key (kbd "M-C"))
|
||||
(defconst ergoemacs-cut-all-key (kbd "M-X"))
|
||||
|
||||
;; undo and redo
|
||||
(defconst ergoemacs-redo-key (kbd "M-Z"))
|
||||
(defconst ergoemacs-undo-key (kbd "M-z"))
|
||||
|
||||
; Kill line
|
||||
(defconst ergoemacs-kill-line-key (kbd "M-g"))
|
||||
(defconst ergoemacs-kill-line-backward-key (kbd "M-G"))
|
||||
|
||||
;;; Textual Transformation
|
||||
|
||||
(defconst ergoemacs-mark-paragraph-key (kbd "M-S-SPC"))
|
||||
(defconst ergoemacs-shrink-whitespaces-key (kbd "M-w"))
|
||||
(defconst ergoemacs-comment-dwim-key (kbd "M-'"))
|
||||
(defconst ergoemacs-toggle-letter-case-key (kbd "M-/"))
|
||||
|
||||
; keyword completion, because Alt+Tab is used by OS
|
||||
(defconst ergoemacs-call-keyword-completion-key (kbd "M-t"))
|
||||
|
||||
; Hard-wrap/un-hard-wrap paragraph
|
||||
(defconst ergoemacs-compact-uncompact-block-key (kbd "M-q"))
|
||||
|
||||
;;; EMACS'S SPECIAL COMMANDS
|
||||
|
||||
; Mark point.
|
||||
(defconst ergoemacs-set-mark-command-key (kbd "M-SPC"))
|
||||
|
||||
(defconst ergoemacs-execute-extended-command-key (kbd "M-a"))
|
||||
(defconst ergoemacs-shell-command-key (kbd "M-A"))
|
||||
|
||||
;;; WINDOW SPLITING
|
||||
(defconst ergoemacs-move-cursor-next-pane-key (kbd "M-s"))
|
||||
(defconst ergoemacs-move-cursor-previous-pane-key (kbd "M-S"))
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; OTHER SHORTCUTS
|
||||
|
||||
(defconst ergoemacs-switch-to-previous-frame-key (kbd "M-~"))
|
||||
(defconst ergoemacs-switch-to-next-frame-key (kbd "M-`"))
|
||||
|
||||
(defconst ergoemacs-query-replace-key (kbd "M-5"))
|
||||
(defconst ergoemacs-query-replace-regexp-key (kbd "M-%"))
|
||||
|
||||
(defconst ergoemacs-delete-other-windows-key (kbd "M-1"))
|
||||
(defconst ergoemacs-delete-window-key (kbd "M-!"))
|
||||
|
||||
(defconst ergoemacs-split-window-vertically-key (kbd "M-2"))
|
||||
(defconst ergoemacs-split-window-horizontally-key (kbd "M-@"))
|
||||
|
||||
(defconst ergoemacs-extend-selection-key (kbd "M-8"))
|
||||
(defconst ergoemacs-select-text-in-quote-key (kbd "M-*"))
|
||||
379
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-mode.el
Executable file
379
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-mode.el
Executable file
|
|
@ -0,0 +1,379 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
;; ergoemacs-mode.el -- A emacs keybinding set based on ergonomics.
|
||||
|
||||
;; Copyright © 2007, 2008, 2009 by Xah Lee
|
||||
;; Copyright © 2009 by David Capello
|
||||
|
||||
;; Author: Xah Lee ( http://xahlee.org/ ), David Capello ( http://www.davidcapello.com.ar/ )
|
||||
;; Version: 5.1
|
||||
;; Keywords: qwerty, dvorak, keybinding, ergonomic, colemak
|
||||
|
||||
;; You can redistribute this program and/or modify it under the terms
|
||||
;; of the GNU General Public License as published by the Free Software
|
||||
;; Foundation; either version 2, or (at your option) any later
|
||||
;; version.
|
||||
|
||||
;;; DESCRIPTION
|
||||
|
||||
;; This keybinding set puts the most frequently used emacs keyboard
|
||||
;; shortcuts into the most easy-to-type spots.
|
||||
;;
|
||||
;; For complete detail, see:
|
||||
;; http://xahlee.org/emacs/ergonomic_emacs_keybinding.html
|
||||
|
||||
;;; INSTALL
|
||||
|
||||
;; See the file “_INSTALL.txt”.
|
||||
|
||||
;;; HISTORY
|
||||
|
||||
;; See the file “_HISTORY.txt”.
|
||||
|
||||
;;; ACKNOWLEDGMENT
|
||||
;; Thanks to Nikolaj Schumacher for his implementation of extend-selection.
|
||||
;; Thanks to Andreas Politz and Nikolaj Schumacher for correcting/improving implementation of toggle-letter-case.
|
||||
;; Thanks to Lennart Borgman for several suggestions on code to prevent shortcuts involving shift key to start select text when CUA-mode is on.
|
||||
;; Thanks to David Capello for contribution to shrink-whitespaces.
|
||||
;; Thanks to marciomazza for spotting several default bindings that should have been unbound.
|
||||
;; Thanks to those who have created and improved the version for Colemak layout. They are (by date): “vockets”, “postivan”, Graham Poulter.
|
||||
;; Thanks to lwarxx for bug report on diff-mode
|
||||
;; Thanks to many users who send in comments and appreciations on this.
|
||||
|
||||
;;; --------------------------------------------------
|
||||
|
||||
;; Add this same directory to load elisp files
|
||||
(add-to-list 'load-path (file-name-directory (or load-file-name buffer-file-name)))
|
||||
|
||||
;; Ergoemacs-keybindings version
|
||||
(defconst ergoemacs-mode-version "5.1"
|
||||
"Ergoemacs-keybindings minor mode version number.")
|
||||
|
||||
;; Include extra files
|
||||
(load "functions")
|
||||
(load "ergoemacs-unbind")
|
||||
|
||||
;; Load the keyboard layout looking the ERGOEMACS_KEYBOARD_LAYOUT
|
||||
;; enviroment variable (this variable is set by ErgoEmacs runner)
|
||||
(defvar ergoemacs-keyboard-layout (getenv "ERGOEMACS_KEYBOARD_LAYOUT")
|
||||
"It is set with the value of ERGOEMACS_KEYBOARD_LAYOUT
|
||||
enviroment variable. The possible values are:
|
||||
|
||||
us = US English QWERTY keyboard layout
|
||||
dv = US-Dvorak keyboard layout
|
||||
sp = Spanish keyboard layout
|
||||
it = Italian keyboard layout
|
||||
colemak = Ergonomic Colemak keyboard layout")
|
||||
|
||||
(cond
|
||||
((string= ergoemacs-keyboard-layout "us")
|
||||
(load "ergoemacs-layout-us"))
|
||||
((or (string= ergoemacs-keyboard-layout "us_dvorak")
|
||||
(string= ergoemacs-keyboard-layout "dv"))
|
||||
(load "ergoemacs-layout-dv"))
|
||||
((string= ergoemacs-keyboard-layout "sp")
|
||||
(load "ergoemacs-layout-sp"))
|
||||
((or (string= ergoemacs-keyboard-layout "it")
|
||||
(string= ergoemacs-keyboard-layout "it142"))
|
||||
(load "ergoemacs-layout-it"))
|
||||
((string= ergoemacs-keyboard-layout "colemak")
|
||||
(load "ergoemacs-layout-colemak"))
|
||||
(t ; US qwerty by default
|
||||
(load "ergoemacs-layout-us"))
|
||||
)
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; ergoemacs-keymap
|
||||
|
||||
(defvar ergoemacs-keymap (make-sparse-keymap)
|
||||
"ErgoEmacs minor mode keymap.")
|
||||
|
||||
;; Single char cursor movement
|
||||
(define-key ergoemacs-keymap ergoemacs-backward-char-key 'backward-char)
|
||||
(define-key ergoemacs-keymap ergoemacs-forward-char-key 'forward-char)
|
||||
(define-key ergoemacs-keymap ergoemacs-previous-line-key 'previous-line)
|
||||
(define-key ergoemacs-keymap ergoemacs-next-line-key 'next-line)
|
||||
|
||||
;; Move by word
|
||||
(define-key ergoemacs-keymap ergoemacs-backward-word-key 'backward-word)
|
||||
(define-key ergoemacs-keymap ergoemacs-forward-word-key 'forward-word)
|
||||
|
||||
;; Move by paragraph
|
||||
(define-key ergoemacs-keymap ergoemacs-backward-paragraph-key 'backward-paragraph)
|
||||
(define-key ergoemacs-keymap ergoemacs-forward-paragraph-key 'forward-paragraph)
|
||||
|
||||
;; Move to beginning/ending of line
|
||||
(define-key ergoemacs-keymap ergoemacs-move-beginning-of-line-key 'move-beginning-of-line)
|
||||
(define-key ergoemacs-keymap ergoemacs-move-end-of-line-key 'move-end-of-line)
|
||||
|
||||
;; Move by screen (page up/down)
|
||||
(define-key ergoemacs-keymap ergoemacs-scroll-down-key 'scroll-down)
|
||||
(define-key ergoemacs-keymap ergoemacs-scroll-up-key 'scroll-up)
|
||||
|
||||
;; Move to beginning/ending of file
|
||||
(define-key ergoemacs-keymap ergoemacs-beginning-of-buffer-key 'beginning-of-buffer)
|
||||
(define-key ergoemacs-keymap ergoemacs-end-of-buffer-key 'end-of-buffer)
|
||||
|
||||
;; isearch
|
||||
(define-key ergoemacs-keymap ergoemacs-isearch-forward-key 'isearch-forward)
|
||||
(define-key ergoemacs-keymap ergoemacs-isearch-backward-key 'isearch-backward)
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-recenter-key 'recenter)
|
||||
|
||||
;;; MAJOR EDITING COMMANDS
|
||||
|
||||
;; Delete previous/next char.
|
||||
(define-key ergoemacs-keymap ergoemacs-delete-backward-char-key 'delete-backward-char)
|
||||
(define-key ergoemacs-keymap ergoemacs-delete-char-key 'delete-char)
|
||||
|
||||
; Delete previous/next word.
|
||||
(define-key ergoemacs-keymap ergoemacs-backward-kill-word-key 'backward-kill-word)
|
||||
(define-key ergoemacs-keymap ergoemacs-kill-word-key 'kill-word)
|
||||
|
||||
; Copy Cut Paste, Paste previous
|
||||
(define-key ergoemacs-keymap ergoemacs-kill-region-key 'kill-region)
|
||||
(define-key ergoemacs-keymap ergoemacs-kill-ring-save-key 'kill-ring-save)
|
||||
(define-key ergoemacs-keymap ergoemacs-yank-key 'yank)
|
||||
(define-key ergoemacs-keymap ergoemacs-yank-pop-key 'yank-pop)
|
||||
(define-key ergoemacs-keymap ergoemacs-copy-all-key 'copy-all)
|
||||
(define-key ergoemacs-keymap ergoemacs-cut-all-key 'cut-all)
|
||||
|
||||
;; undo and redo
|
||||
(define-key ergoemacs-keymap ergoemacs-redo-key 'redo)
|
||||
(define-key ergoemacs-keymap ergoemacs-undo-key 'undo)
|
||||
|
||||
; Kill line
|
||||
(define-key ergoemacs-keymap ergoemacs-kill-line-key 'kill-line)
|
||||
(define-key ergoemacs-keymap ergoemacs-kill-line-backward-key 'kill-line-backward)
|
||||
|
||||
;;; Textual Transformation
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-mark-paragraph-key 'mark-paragraph)
|
||||
(define-key ergoemacs-keymap ergoemacs-shrink-whitespaces-key 'shrink-whitespaces)
|
||||
(define-key ergoemacs-keymap ergoemacs-comment-dwim-key 'comment-dwim)
|
||||
(define-key ergoemacs-keymap ergoemacs-toggle-letter-case-key 'toggle-letter-case)
|
||||
|
||||
; keyword completion, because Alt+Tab is used by OS
|
||||
(define-key ergoemacs-keymap ergoemacs-call-keyword-completion-key 'call-keyword-completion)
|
||||
|
||||
; Hard-wrap/un-hard-wrap paragraph
|
||||
(define-key ergoemacs-keymap ergoemacs-compact-uncompact-block-key 'compact-uncompact-block)
|
||||
|
||||
;;; EMACS'S SPECIAL COMMANDS
|
||||
|
||||
; Mark point.
|
||||
(define-key ergoemacs-keymap ergoemacs-set-mark-command-key 'set-mark-command)
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-execute-extended-command-key 'execute-extended-command)
|
||||
(define-key ergoemacs-keymap ergoemacs-shell-command-key 'shell-command)
|
||||
|
||||
;;; WINDOW SPLITING
|
||||
(define-key ergoemacs-keymap ergoemacs-move-cursor-next-pane-key 'move-cursor-next-pane)
|
||||
(define-key ergoemacs-keymap ergoemacs-move-cursor-previous-pane-key 'move-cursor-previous-pane)
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; STANDARD SHORTCUTS
|
||||
|
||||
(define-key ergoemacs-keymap (kbd "C-n") 'new-empty-buffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-S-n") 'make-frame-command)
|
||||
(define-key ergoemacs-keymap (kbd "C-o") 'find-file)
|
||||
(define-key ergoemacs-keymap (kbd "C-w") 'close-current-buffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-s") 'save-buffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-S-s") 'write-file)
|
||||
(define-key ergoemacs-keymap (kbd "C-p") 'print-buffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-a") 'mark-whole-buffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-S-w") 'delete-frame)
|
||||
|
||||
(define-key ergoemacs-keymap (kbd "C-f") 'search-forward)
|
||||
|
||||
(define-key ergoemacs-keymap (kbd "<delete>") 'delete-char) ; the Del key for forward delete. Needed if C-d is set to nil.
|
||||
|
||||
(define-key ergoemacs-keymap (kbd "C-<prior>") 'previous-user-buffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-<next>") 'next-user-buffer)
|
||||
|
||||
(define-key ergoemacs-keymap (kbd "C-S-<prior>") 'previous-emacs-buffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-S-<next>") 'next-emacs-buffer)
|
||||
|
||||
(define-key ergoemacs-keymap (kbd "M-S-<prior>") 'backward-page)
|
||||
(define-key ergoemacs-keymap (kbd "M-S-<next>") 'forward-page)
|
||||
|
||||
(define-key ergoemacs-keymap (kbd "C-x C-b") 'ibuffer)
|
||||
(define-key ergoemacs-keymap (kbd "C-h m") 'describe-major-mode)
|
||||
(define-key ergoemacs-keymap (kbd "C-h o") 'where-is-old-binding)
|
||||
|
||||
;; Ctrl+Break is a common IDE shortcut to stop compilation/find/grep
|
||||
(define-key ergoemacs-keymap (kbd "C-<pause>") 'kill-compilation)
|
||||
|
||||
;;; --------------------------------------------------
|
||||
;;; OTHER SHORTCUTS
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-switch-to-previous-frame-key 'switch-to-previous-frame)
|
||||
(define-key ergoemacs-keymap ergoemacs-switch-to-next-frame-key 'switch-to-next-frame)
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-query-replace-key 'query-replace)
|
||||
(define-key ergoemacs-keymap ergoemacs-query-replace-regexp-key 'query-replace-regexp)
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-delete-other-windows-key 'delete-other-windows)
|
||||
(define-key ergoemacs-keymap ergoemacs-delete-window-key 'delete-window)
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-split-window-vertically-key 'split-window-vertically)
|
||||
(define-key ergoemacs-keymap ergoemacs-split-window-horizontally-key 'split-window-horizontally)
|
||||
|
||||
(define-key ergoemacs-keymap ergoemacs-extend-selection-key 'extend-selection)
|
||||
(define-key ergoemacs-keymap ergoemacs-select-text-in-quote-key 'select-text-in-quote)
|
||||
|
||||
;;----------------------------------------------------------------------
|
||||
;; ErgoEmacs hooks
|
||||
|
||||
(defun ergoemacs-cua-hook ()
|
||||
"Prevent `cua-mode' from going into selection mode when commands with Shift key is used."
|
||||
|
||||
(put 'cua-scroll-down 'CUA nil)
|
||||
(put 'cua-scroll-up 'CUA nil)
|
||||
(put 'backward-paragraph 'CUA nil)
|
||||
(put 'forward-paragraph 'CUA nil)
|
||||
(put 'beginning-of-buffer 'CUA nil)
|
||||
(put 'end-of-buffer 'CUA nil)
|
||||
(put 'move-end-of-line 'CUA nil)
|
||||
)
|
||||
|
||||
(defun ergoemacs-minibuffer-setup-hook ()
|
||||
"Hook for minibuffer to move through history with previous-line and next-line keys."
|
||||
|
||||
(defvar ergoemacs-minibuffer-keymap (copy-keymap ergoemacs-keymap))
|
||||
|
||||
(define-key ergoemacs-minibuffer-keymap ergoemacs-previous-line-key 'previous-history-element)
|
||||
(define-key ergoemacs-minibuffer-keymap ergoemacs-next-line-key 'next-history-element)
|
||||
(define-key ergoemacs-minibuffer-keymap (kbd "<f11>") 'previous-history-element)
|
||||
(define-key ergoemacs-minibuffer-keymap (kbd "<f12>") 'next-history-element)
|
||||
(define-key ergoemacs-minibuffer-keymap (kbd "S-<f11>") 'previous-matching-history-element)
|
||||
(define-key ergoemacs-minibuffer-keymap (kbd "S-<f12>") 'next-matching-history-element)
|
||||
|
||||
(add-to-list 'minor-mode-overriding-map-alist (cons 'ergoemacs-mode ergoemacs-minibuffer-keymap))
|
||||
)
|
||||
|
||||
(defun ergoemacs-isearch-hook ()
|
||||
"Hook for `isearch-mode-hook' so ergoemacs keybindings are not lost."
|
||||
|
||||
;; TODO restore these keys! (it is not necessary, when the
|
||||
;; ergoemacs-isearch-hook is removed from isearch-mode-hook)
|
||||
|
||||
(define-key isearch-mode-map (kbd "M-p") 'nil) ; was isearch-ring-retreat
|
||||
(define-key isearch-mode-map (kbd "M-n") 'nil) ; was isearch-ring-advance
|
||||
(define-key isearch-mode-map (kbd "M-y") 'nil) ; was isearch-yank-kill
|
||||
(define-key isearch-mode-map (kbd "M-c") 'nil) ; was isearch-toggle-case-fold
|
||||
(define-key isearch-mode-map (kbd "M-r") 'nil) ; was isearch-toggle-regexp
|
||||
(define-key isearch-mode-map (kbd "M-e") 'nil) ; was isearch-edit-string
|
||||
|
||||
(define-key isearch-mode-map ergoemacs-isearch-forward-key 'isearch-repeat-forward)
|
||||
(define-key isearch-mode-map ergoemacs-isearch-backward-key 'isearch-repeat-backward)
|
||||
(define-key isearch-mode-map ergoemacs-recenter-key 'recenter)
|
||||
(define-key isearch-mode-map ergoemacs-yank-key 'isearch-yank-kill)
|
||||
|
||||
;; isearch-other-control-char sends the key to the original buffer and cancels isearch
|
||||
(define-key isearch-mode-map ergoemacs-kill-ring-save-key 'isearch-other-control-char)
|
||||
(define-key isearch-mode-map ergoemacs-kill-word-key 'isearch-other-control-char)
|
||||
(define-key isearch-mode-map ergoemacs-backward-kill-word-key 'isearch-other-control-char)
|
||||
|
||||
(define-key isearch-mode-map (kbd "<f11>") 'isearch-ring-retreat)
|
||||
(define-key isearch-mode-map (kbd "<f12>") 'isearch-ring-advance)
|
||||
)
|
||||
|
||||
;; Hook for interpreters
|
||||
(defun ergoemacs-comint-hook ()
|
||||
"Hook for `comint-mode-hook'."
|
||||
|
||||
(define-key comint-mode-map (kbd "<f11>") 'comint-previous-input)
|
||||
(define-key comint-mode-map (kbd "<f12>") 'comint-next-input)
|
||||
(define-key comint-mode-map (kbd "S-<f11>") 'comint-previous-matching-input)
|
||||
(define-key comint-mode-map (kbd "S-<f12>") 'comint-next-matching-input)
|
||||
)
|
||||
|
||||
;; Log edit mode
|
||||
(defun ergoemacs-log-edit-hook ()
|
||||
"Hook for `log-edit-mode-hook'."
|
||||
|
||||
(define-key log-edit-mode-map (kbd "<f11>") 'log-edit-previous-comment)
|
||||
(define-key log-edit-mode-map (kbd "<f12>") 'log-edit-next-comment)
|
||||
(define-key log-edit-mode-map (kbd "S-<f11>") 'log-edit-previous-comment)
|
||||
(define-key log-edit-mode-map (kbd "S-<f12>") 'log-edit-next-comment)
|
||||
)
|
||||
|
||||
(defun ergoemacs-eshell-hook ()
|
||||
"Hook for `eshell-mode-hook', to redefine some ErgoEmacs keys so they are more useful."
|
||||
|
||||
;; Redefining ergoemacs-move-beginning-of-line-key to eshell-bol in eshell-mode-map
|
||||
;; does not work, we have to use minor-mode-overriding-map-alist in this case
|
||||
(defvar ergoemacs-eshell-keymap (copy-keymap ergoemacs-keymap))
|
||||
|
||||
(define-key ergoemacs-eshell-keymap ergoemacs-move-beginning-of-line-key 'eshell-bol)
|
||||
(define-key ergoemacs-eshell-keymap (kbd "<home>") 'eshell-bol)
|
||||
(define-key ergoemacs-eshell-keymap (kbd "<f11>") 'eshell-previous-matching-input-from-input)
|
||||
(define-key ergoemacs-eshell-keymap (kbd "<f12>") 'eshell-next-matching-input-from-input)
|
||||
(define-key ergoemacs-eshell-keymap (kbd "S-<f11>") 'eshell-previous-matching-input-from-input)
|
||||
(define-key ergoemacs-eshell-keymap (kbd "S-<f12>") 'eshell-next-matching-input-from-input)
|
||||
|
||||
(add-to-list 'minor-mode-overriding-map-alist (cons 'ergoemacs-mode ergoemacs-eshell-keymap))
|
||||
)
|
||||
|
||||
(defun ergoemacs-iswitchb-hook ()
|
||||
"Hooks for `iswitchb-minibuffer-setup-hook'."
|
||||
|
||||
(defvar ergoemacs-iswitchb-keymap (copy-keymap ergoemacs-keymap))
|
||||
|
||||
(define-key ergoemacs-iswitchb-keymap ergoemacs-isearch-backward-key 'iswitchb-prev-match)
|
||||
(define-key ergoemacs-iswitchb-keymap ergoemacs-isearch-forward-key 'iswitchb-next-match)
|
||||
|
||||
(define-key ergoemacs-iswitchb-keymap (kbd "<f11>") 'iswitchb-prev-match)
|
||||
(define-key ergoemacs-iswitchb-keymap (kbd "<f12>") 'iswitchb-next-match)
|
||||
(define-key ergoemacs-iswitchb-keymap (kbd "S-<f11>") 'iswitchb-prev-match)
|
||||
(define-key ergoemacs-iswitchb-keymap (kbd "S-<f12>") 'iswitchb-next-match)
|
||||
|
||||
(add-to-list 'minor-mode-overriding-map-alist (cons 'ergoemacs-mode ergoemacs-iswitchb-keymap))
|
||||
)
|
||||
|
||||
(defun ergoemacs-hook-modes ()
|
||||
"Installs/Removes ErgoEmacs minor mode hooks from major modes
|
||||
depending the state of `ergoemacs-mode' variable. If the mode
|
||||
is being initialized, some global keybindings in current-global-map
|
||||
will change."
|
||||
|
||||
(let ((modify-hook (if ergoemacs-mode 'add-hook 'remove-hook)))
|
||||
|
||||
;; when ergoemacs-mode is on, activate hooks and unset global keys, else do inverse
|
||||
(if (and ergoemacs-mode (not (equal ergoemacs-mode 0)))
|
||||
(ergoemacs-unset-redundant-global-keys)
|
||||
(ergoemacs-restore-global-keys))
|
||||
|
||||
(funcall modify-hook 'cua-mode-hook 'ergoemacs-cua-hook)
|
||||
(funcall modify-hook 'isearch-mode-hook 'ergoemacs-isearch-hook)
|
||||
(funcall modify-hook 'comint-mode-hook 'ergoemacs-comint-hook)
|
||||
(funcall modify-hook 'log-edit-mode-hook 'ergoemacs-log-edit-hook)
|
||||
(funcall modify-hook 'eshell-mode-hook 'ergoemacs-eshell-hook)
|
||||
(funcall modify-hook 'minibuffer-setup-hook 'ergoemacs-minibuffer-setup-hook)
|
||||
(funcall modify-hook 'iswitchb-minibuffer-setup-hook 'ergoemacs-iswitchb-hook)
|
||||
)
|
||||
)
|
||||
|
||||
;;----------------------------------------------------------------------
|
||||
;; ErgoEmacs minor mode
|
||||
|
||||
(define-minor-mode ergoemacs-mode
|
||||
"Toggle ergoemacs keybinding mode.
|
||||
This minor mode changes your emacs keybindings.
|
||||
Without argument, toggles the minor mode.
|
||||
If optional argument is 1, turn it on.
|
||||
If optional argument is 0, turn it off.
|
||||
Argument of t or nil should not be used.
|
||||
For full documentation, see:
|
||||
URL `http://xahlee.org/emacs/ergonomic_emacs_keybinding.html'
|
||||
|
||||
If you turned on by mistake, the shortcut to call execute-extended-command is M-a."
|
||||
nil
|
||||
:lighter " ErgoEmacs" ;; TODO this should be nil (it is for testing purposes)
|
||||
:global t
|
||||
:keymap ergoemacs-keymap
|
||||
|
||||
(ergoemacs-hook-modes)
|
||||
)
|
||||
|
||||
(provide 'ergoemacs-mode)
|
||||
205
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-unbind.el
Normal file
205
.emacs.d.backup/ergoemacs-keybindings-5.1/ergoemacs-unbind.el
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
|
||||
;; this file define keys that we want to set/unset because they are already defined by ergoemacs minor mode
|
||||
|
||||
(eval-when-compile (require 'edmacro))
|
||||
|
||||
(defconst ergoemacs-redundant-keys
|
||||
'( "C-/"
|
||||
"C-0"
|
||||
"C-1"
|
||||
"C-2"
|
||||
"C-3"
|
||||
"C-4"
|
||||
"C-5"
|
||||
"C-6"
|
||||
"C-7"
|
||||
"C-8"
|
||||
"C-9"
|
||||
"C-<backspace>"
|
||||
"C-<next>"
|
||||
"C-<prior>"
|
||||
"C-@"
|
||||
"C-M-%"
|
||||
"C-_"
|
||||
"C-a"
|
||||
"C-b"
|
||||
"C-d"
|
||||
"C-e"
|
||||
"C-f"
|
||||
"C-j"
|
||||
"C-k"
|
||||
"C-l"
|
||||
"C-n"
|
||||
"C-o"
|
||||
"C-p"
|
||||
"C-r"
|
||||
"C-s"
|
||||
"C-t"
|
||||
"C-v"
|
||||
"C-w"
|
||||
"C-x 0"
|
||||
"C-x 1"
|
||||
"C-x 2"
|
||||
"C-x 3"
|
||||
"C-x 5 0"
|
||||
"C-x 5 2"
|
||||
"C-x C-d"
|
||||
"C-x C-f"
|
||||
"C-x C-s"
|
||||
"C-x C-w"
|
||||
"C-x d"
|
||||
"C-x h"
|
||||
"C-x o"
|
||||
"C-y"
|
||||
"C-z"
|
||||
"M--"
|
||||
"M-0"
|
||||
"M-1"
|
||||
"M-2"
|
||||
"M-3"
|
||||
"M-4"
|
||||
"M-5"
|
||||
"M-6"
|
||||
"M-7"
|
||||
"M-8"
|
||||
"M-9"
|
||||
"M-<"
|
||||
"M->"
|
||||
"M-@"
|
||||
"M-\\"
|
||||
"M-a"
|
||||
"M-b"
|
||||
"M-c"
|
||||
"M-d"
|
||||
"M-e"
|
||||
"M-f"
|
||||
"M-h"
|
||||
"M-i"
|
||||
"M-j"
|
||||
"M-k"
|
||||
"M-l"
|
||||
"M-m"
|
||||
"M-n"
|
||||
"M-o"
|
||||
"M-p"
|
||||
"M-q"
|
||||
"M-r"
|
||||
"M-s"
|
||||
"M-t"
|
||||
"M-u"
|
||||
"M-v"
|
||||
"M-w"
|
||||
"M-x"
|
||||
"M-y"
|
||||
"M-z"
|
||||
"M-{"
|
||||
"M-}"
|
||||
)
|
||||
)
|
||||
|
||||
;; Some exceptions we don't want to unset.
|
||||
;; "C-g" 'keyboard-quit
|
||||
;; "C-i" 'indent-for-tab-command
|
||||
;; "C-m" 'newline-and-indent
|
||||
;; "C-q" 'quote-insert
|
||||
;; "C-u" 'universal-argument
|
||||
;; "C-h" ; (help-map)
|
||||
;; "C-x" ; (ctl-x-map)
|
||||
;; "C-c" ; (prefix)
|
||||
;; "M-g" ; (prefix)
|
||||
|
||||
(defvar ergoemacs-overridden-global-keys '()
|
||||
"Alist to store overridden keyboard shortcuts in
|
||||
`current-global-map' and other maps. Each item looks like '(MAP KEY OLD-COMMAND).")
|
||||
|
||||
(defun ergoemacs-unset-global-key (map key-s)
|
||||
"Sets to nil the associated command for the specified key in specified map.
|
||||
It is like:
|
||||
|
||||
\(define-key map (kbd key-s) nil))
|
||||
|
||||
But it saves the old command associated with the
|
||||
specified key, so we can restore it when ergoemacs minor mode is
|
||||
disabled at `ergoemacs-restore-global-keys'."
|
||||
(let (key oldcmd)
|
||||
(setq key (edmacro-parse-keys key-s))
|
||||
;; get the old command associated with this key
|
||||
(setq oldcmd (lookup-key map key))
|
||||
;; save that shortcut in ergoemacs-overridden-global-keys
|
||||
(if oldcmd
|
||||
(add-to-list 'ergoemacs-overridden-global-keys (cons map (cons key-s (cons oldcmd nil)))))
|
||||
;; redefine the key in the ergoemacs-keymap
|
||||
(define-key map key nil)
|
||||
)
|
||||
)
|
||||
|
||||
(defun ergoemacs-unset-redundant-global-keys ()
|
||||
"Unsets redundant keyboard shortcuts that should not be used in ErgoEmacs."
|
||||
(mapc (lambda (x)
|
||||
(ergoemacs-unset-global-key (current-global-map) x))
|
||||
ergoemacs-redundant-keys)
|
||||
)
|
||||
|
||||
(defun ergoemacs-restore-global-keys ()
|
||||
"Restores all keyboard shortcuts that were overwritten by `ergoemacs-unbind-global-key'."
|
||||
(mapc (lambda (x)
|
||||
(define-key
|
||||
(car x)
|
||||
(edmacro-parse-keys (car (cdr x)))
|
||||
(car (cdr (cdr x))))
|
||||
)
|
||||
ergoemacs-overridden-global-keys)
|
||||
(setq ergoemacs-overridden-global-keys '()) ; clear the list
|
||||
)
|
||||
|
||||
;; Based on describe-key-briefly
|
||||
(defun where-is-old-binding (&optional key)
|
||||
"Print the name of the function KEY invoked before to start ErgoEmacs minor mode."
|
||||
(interactive
|
||||
(let ((enable-disabled-menus-and-buttons t)
|
||||
(cursor-in-echo-area t)
|
||||
saved-yank-menu)
|
||||
(unwind-protect
|
||||
(let (key)
|
||||
;; If yank-menu is empty, populate it temporarily, so that
|
||||
;; "Select and Paste" menu can generate a complete event.
|
||||
(when (null (cdr yank-menu))
|
||||
(setq saved-yank-menu (copy-sequence yank-menu))
|
||||
(menu-bar-update-yank-menu "(any string)" nil))
|
||||
(setq key (read-key-sequence "Describe old key (or click or menu item): "))
|
||||
;; If KEY is a down-event, read and discard the
|
||||
;; corresponding up-event. Note that there are also
|
||||
;; down-events on scroll bars and mode lines: the actual
|
||||
;; event then is in the second element of the vector.
|
||||
(and (vectorp key)
|
||||
(let ((last-idx (1- (length key))))
|
||||
(and (eventp (aref key last-idx))
|
||||
(memq 'down (event-modifiers (aref key last-idx)))))
|
||||
(read-event))
|
||||
(list key))
|
||||
;; Put yank-menu back as it was, if we changed it.
|
||||
(when saved-yank-menu
|
||||
(setq yank-menu (copy-sequence saved-yank-menu))
|
||||
(fset 'yank-menu (cons 'keymap yank-menu))))))
|
||||
|
||||
(let (key-desc item-key item-cmd old-cmd)
|
||||
(setq key-desc (key-description key))
|
||||
(setq item ergoemacs-overridden-global-keys)
|
||||
(while (and item (not old-cmd))
|
||||
(setq item-key (car (cdr (car item))))
|
||||
(setq item-cmd (car (cdr (cdr (car item)))))
|
||||
(if (string= item-key key-desc)
|
||||
(setq old-cmd item-cmd))
|
||||
(setq item (cdr item))
|
||||
)
|
||||
(if old-cmd
|
||||
(with-temp-buffer
|
||||
(where-is old-cmd t)
|
||||
(message "Key %s was bound to %s which is now invoked by %s"
|
||||
key-desc old-cmd (buffer-string))
|
||||
)
|
||||
(message "Key %s was not bound to any command" key-desc)
|
||||
)
|
||||
)
|
||||
)
|
||||
385
.emacs.d.backup/ergoemacs-keybindings-5.1/functions.el
Executable file
385
.emacs.d.backup/ergoemacs-keybindings-5.1/functions.el
Executable file
|
|
@ -0,0 +1,385 @@
|
|||
;-*- coding: utf-8 -*-
|
||||
|
||||
(require 'redo "redo.elc" t) ; for redo shortcut
|
||||
|
||||
(delete-selection-mode 1) ; turn on text selection highlighting and make typing override selected text (Note: when delete-selection-mode is on, then transient-mark-mode is automatically on too.)
|
||||
|
||||
(defun call-keyword-completion ()
|
||||
"Call the command that has keyboard shortcut M-TAB."
|
||||
(interactive)
|
||||
(call-interactively (key-binding (kbd "M-TAB")))
|
||||
)
|
||||
|
||||
(defun describe-major-mode ()
|
||||
"Show inline doc for current major-mode."
|
||||
;; code by Kevin Rodgers. 2009-02-25
|
||||
(interactive)
|
||||
(describe-function major-mode))
|
||||
|
||||
(defun copy-all ()
|
||||
"Put the whole buffer content into the kill-ring.
|
||||
If narrow-to-region is in effect, then copy that region only."
|
||||
(interactive)
|
||||
(kill-ring-save (point-min) (point-max))
|
||||
(message "Buffer content copied")
|
||||
)
|
||||
|
||||
(defun cut-all ()
|
||||
"Cut the whole buffer content into the kill-ring.
|
||||
If narrow-to-region is in effect, then cut that region only."
|
||||
(interactive)
|
||||
(kill-region (point-min) (point-max))
|
||||
(message "Buffer content cut")
|
||||
)
|
||||
|
||||
;;; TEXT SELECTION RELATED
|
||||
|
||||
(defun select-text-in-quote ()
|
||||
"Select text between the nearest left and right delimiters.
|
||||
Delimiters are paired characters: ()[]<>«»“”‘’「」【】, including \"\"."
|
||||
(interactive)
|
||||
(let (b1 b2)
|
||||
(skip-chars-backward "^<>(“{[「«【\"‘")
|
||||
(setq b1 (point))
|
||||
(skip-chars-forward "^<>)”}]」】»\"’")
|
||||
(setq b2 (point))
|
||||
(set-mark b1)
|
||||
)
|
||||
)
|
||||
|
||||
;; by Nikolaj Schumacher, 2008-10-20. Released under GPL.
|
||||
(defun semnav-up (arg)
|
||||
(interactive "p")
|
||||
(when (nth 3 (syntax-ppss))
|
||||
(if (> arg 0)
|
||||
(progn
|
||||
(skip-syntax-forward "^\"")
|
||||
(goto-char (1+ (point)))
|
||||
(decf arg))
|
||||
(skip-syntax-backward "^\"")
|
||||
(goto-char (1- (point)))
|
||||
(incf arg)))
|
||||
(up-list arg))
|
||||
|
||||
;; by Nikolaj Schumacher, 2008-10-20. Released under GPL.
|
||||
(defun extend-selection (arg &optional incremental)
|
||||
"Select the current word.
|
||||
Subsequent calls expands the selection to larger semantic unit."
|
||||
(interactive (list (prefix-numeric-value current-prefix-arg)
|
||||
(or (and transient-mark-mode mark-active)
|
||||
(eq last-command this-command))))
|
||||
(if incremental
|
||||
(progn
|
||||
(semnav-up (- arg))
|
||||
(forward-sexp)
|
||||
(mark-sexp -1))
|
||||
(if (> arg 1)
|
||||
(extend-selection (1- arg) t)
|
||||
(if (looking-at "\\=\\(\\s_\\|\\sw\\)*\\_>")
|
||||
(goto-char (match-end 0))
|
||||
(unless (memq (char-before) '(?\) ?\"))
|
||||
(forward-sexp)))
|
||||
(mark-sexp -1))))
|
||||
|
||||
;;; TEXT TRANSFORMATION RELATED
|
||||
|
||||
(defun kill-line-backward ()
|
||||
"Kill text between the beginning of the line to the cursor position.
|
||||
If there's no text, delete the previous line ending."
|
||||
(interactive)
|
||||
(if (looking-back "\n")
|
||||
(delete-char -1)
|
||||
(kill-line 0)
|
||||
)
|
||||
)
|
||||
|
||||
(defun move-cursor-next-pane ()
|
||||
"Move cursor to the next pane."
|
||||
(interactive)
|
||||
(other-window 1)
|
||||
)
|
||||
|
||||
(defun move-cursor-previous-pane ()
|
||||
"Move cursor to the previous pane."
|
||||
(interactive)
|
||||
(other-window -1)
|
||||
)
|
||||
|
||||
(defun compact-uncompact-block ()
|
||||
"Remove or add line endings on the current block of text.
|
||||
This is similar to a toggle for fill-paragraph and unfill-paragraph
|
||||
When there is a text selection, act on the region.
|
||||
|
||||
When in text mode, a paragraph is considerd a block. When in programing
|
||||
language mode, the block is defined by between empty lines.
|
||||
|
||||
Todo: The programing language behavior is currently not done.
|
||||
Right now, the code uses fill* functions, so does not work or work well
|
||||
in programing lang modes. A proper implementation to compact is replacing
|
||||
EOL chars by space when the EOL char is not inside string."
|
||||
(interactive)
|
||||
|
||||
;; This command symbol has a property “'stateIsCompact-p”, the
|
||||
;; possible values are t and nil. This property is used to easily
|
||||
;; determine whether to compact or uncompact, when this command is
|
||||
;; called again
|
||||
|
||||
(let (bds currentLineCharCount currentStateIsCompact
|
||||
(bigFillColumnVal 4333999) (deactivate-mark nil))
|
||||
|
||||
(save-excursion
|
||||
;; currentLineCharCount is used to determine whether current state
|
||||
;; is compact or not, when the command is run for the first time
|
||||
(setq currentLineCharCount
|
||||
(progn
|
||||
(setq bds (bounds-of-thing-at-point 'line))
|
||||
(length (buffer-substring-no-properties (car bds) (cdr bds)))
|
||||
;; Note: 'line includes eol if it is not buffer's last line
|
||||
)
|
||||
)
|
||||
|
||||
;; Determine whether the text is currently compact. when the last
|
||||
;; command is this, then symbol property easily tells, but when
|
||||
;; this command is used fresh, right now we use num of chars of
|
||||
;; the cursor line as a way to define current compatness state
|
||||
(setq currentStateIsCompact
|
||||
(if (eq last-command this-command)
|
||||
(get this-command 'stateIsCompact-p)
|
||||
(if (> currentLineCharCount fill-column) t nil)
|
||||
)
|
||||
)
|
||||
|
||||
(if (and transient-mark-mode mark-active)
|
||||
(if currentStateIsCompact
|
||||
(fill-region (region-beginning) (region-end))
|
||||
(let ((fill-column bigFillColumnVal))
|
||||
(fill-region (region-beginning) (region-end)))
|
||||
)
|
||||
(if currentStateIsCompact
|
||||
(fill-paragraph nil)
|
||||
(let ((fill-column bigFillColumnVal))
|
||||
(fill-paragraph nil))
|
||||
)
|
||||
)
|
||||
|
||||
(put this-command 'stateIsCompact-p (if currentStateIsCompact
|
||||
nil t)) ) ) )
|
||||
|
||||
(defun shrink-whitespaces ()
|
||||
"Remove white spaces around cursor to just one or none.
|
||||
If current line does not contain non-white space chars, then remove blank lines to just one.
|
||||
If current line contains non-white space chars, then shrink any whitespace char surrounding cursor to just one space.
|
||||
If current line is a single space, remove that space.
|
||||
|
||||
Calling this command 3 times will always result in no whitespaces around cursor."
|
||||
(interactive)
|
||||
(let (
|
||||
cursor-point
|
||||
line-has-meat-p ; current line contains non-white space chars
|
||||
spaceTabNeighbor-p
|
||||
whitespace-begin whitespace-end
|
||||
space-or-tab-begin space-or-tab-end
|
||||
line-begin-pos line-end-pos
|
||||
)
|
||||
(save-excursion
|
||||
;; todo: might consider whitespace as defined by syntax table, and also consider whitespace chars in unicode if syntax table doesn't already considered it.
|
||||
(setq cursor-point (point))
|
||||
|
||||
(setq spaceTabNeighbor-p (if (or (looking-at " \\|\t") (looking-back " \\|\t")) t nil) )
|
||||
(move-beginning-of-line 1) (setq line-begin-pos (point) )
|
||||
(move-end-of-line 1) (setq line-end-pos (point) )
|
||||
;; (re-search-backward "\n$") (setq line-begin-pos (point) )
|
||||
;; (re-search-forward "\n$") (setq line-end-pos (point) )
|
||||
(setq line-has-meat-p (if (< 0 (count-matches "[[:graph:]]" line-begin-pos line-end-pos)) t nil) )
|
||||
(goto-char cursor-point)
|
||||
|
||||
(skip-chars-backward "\t ")
|
||||
(setq space-or-tab-begin (point))
|
||||
|
||||
(skip-chars-backward "\t \n")
|
||||
(setq whitespace-begin (point))
|
||||
|
||||
(goto-char cursor-point) (skip-chars-forward "\t ")
|
||||
(setq space-or-tab-end (point))
|
||||
(skip-chars-forward "\t \n")
|
||||
(setq whitespace-end (point))
|
||||
)
|
||||
|
||||
(if line-has-meat-p
|
||||
(let (deleted-text)
|
||||
(when spaceTabNeighbor-p
|
||||
;; remove all whitespaces in the range
|
||||
(setq deleted-text (delete-and-extract-region space-or-tab-begin space-or-tab-end))
|
||||
;; insert a whitespace only if we have removed something
|
||||
;; different that a simple whitespace
|
||||
(if (not (string= deleted-text " "))
|
||||
(insert " ") ) ) )
|
||||
|
||||
(progn
|
||||
;; (delete-region whitespace-begin whitespace-end)
|
||||
;; (insert "\n")
|
||||
(delete-blank-lines)
|
||||
)
|
||||
;; todo: possibly code my own delete-blank-lines here for better efficiency, because delete-blank-lines seems complex.
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun toggle-letter-case ()
|
||||
"Toggle the letter case of current word or text selection.
|
||||
Toggles from 3 cases: UPPER CASE, lower case, Title Case,
|
||||
in that cyclic order."
|
||||
(interactive)
|
||||
(let (pos1 pos2 (deactivate-mark nil) (case-fold-search nil))
|
||||
(if (and transient-mark-mode mark-active)
|
||||
(setq pos1 (region-beginning)
|
||||
pos2 (region-end))
|
||||
(setq pos1 (car (bounds-of-thing-at-point 'word))
|
||||
pos2 (cdr (bounds-of-thing-at-point 'word))))
|
||||
|
||||
(when (not (eq last-command this-command))
|
||||
(save-excursion
|
||||
(goto-char pos1)
|
||||
(cond
|
||||
((looking-at "[[:lower:]][[:lower:]]") (put this-command 'state "all lower"))
|
||||
((looking-at "[[:upper:]][[:upper:]]") (put this-command 'state "all caps") )
|
||||
((looking-at "[[:upper:]][[:lower:]]") (put this-command 'state "init caps") )
|
||||
(t (put this-command 'state "all lower") )
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(cond
|
||||
((string= "all lower" (get this-command 'state))
|
||||
(upcase-initials-region pos1 pos2) (put this-command 'state "init caps"))
|
||||
((string= "init caps" (get this-command 'state))
|
||||
(upcase-region pos1 pos2) (put this-command 'state "all caps"))
|
||||
((string= "all caps" (get this-command 'state))
|
||||
(downcase-region pos1 pos2) (put this-command 'state "all lower"))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;;; FRAME
|
||||
|
||||
(defun switch-to-next-frame ()
|
||||
"Select the next frame on current display, and raise it."
|
||||
(interactive)
|
||||
(other-frame 1)
|
||||
)
|
||||
|
||||
(defun switch-to-previous-frame ()
|
||||
"Select the previous frame on current display, and raise it."
|
||||
(interactive)
|
||||
(other-frame -1)
|
||||
)
|
||||
|
||||
;;; BUFFER RELATED
|
||||
|
||||
(defun next-user-buffer ()
|
||||
"Switch to the next user buffer.
|
||||
User buffers are those whose name does not start with *."
|
||||
(interactive)
|
||||
(next-buffer)
|
||||
(let ((i 0))
|
||||
(while (and (string-match "^*" (buffer-name)) (< i 50))
|
||||
(setq i (1+ i)) (next-buffer) )))
|
||||
|
||||
(defun previous-user-buffer ()
|
||||
"Switch to the previous user buffer.
|
||||
User buffers are those whose name does not start with *."
|
||||
(interactive)
|
||||
(previous-buffer)
|
||||
(let ((i 0))
|
||||
(while (and (string-match "^*" (buffer-name)) (< i 50))
|
||||
(setq i (1+ i)) (previous-buffer) )))
|
||||
|
||||
(defun next-emacs-buffer ()
|
||||
"Switch to the next emacs buffer.
|
||||
Emacs buffers are those whose name starts with *."
|
||||
(interactive)
|
||||
(next-buffer)
|
||||
(let ((i 0))
|
||||
(while (and (not (string-match "^*" (buffer-name))) (< i 50))
|
||||
(setq i (1+ i)) (next-buffer) )))
|
||||
|
||||
(defun previous-emacs-buffer ()
|
||||
"Switch to the previous emacs buffer.
|
||||
Emacs buffers are those whose name starts with *."
|
||||
(interactive)
|
||||
(previous-buffer)
|
||||
(let ((i 0))
|
||||
(while (and (not (string-match "^*" (buffer-name))) (< i 50))
|
||||
(setq i (1+ i)) (previous-buffer) )))
|
||||
|
||||
(defun new-empty-buffer ()
|
||||
"Opens a new empty buffer."
|
||||
(interactive)
|
||||
(let ((buf (generate-new-buffer "untitled")))
|
||||
(switch-to-buffer buf)
|
||||
(funcall (and initial-major-mode))
|
||||
(setq buffer-offer-save t)))
|
||||
;; note: emacs won't offer to save a buffer that's
|
||||
;; not associated with a file,
|
||||
;; even if buffer-modified-p is true.
|
||||
;; One work around is to define your own my-kill-buffer function
|
||||
;; that wraps around kill-buffer, and check on the buffer modification
|
||||
;; status to offer save
|
||||
;; This custome kill buffer is close-current-buffer.
|
||||
|
||||
|
||||
(defvar recently-closed-buffers (cons nil nil) "A list of recently closed buffers. The max number to track is controlled by the variable recently-closed-buffers-max.")
|
||||
(defvar recently-closed-buffers-max 10 "The maximum length for recently-closed-buffers.")
|
||||
|
||||
(defun close-current-buffer ()
|
||||
"Close the current buffer.
|
||||
|
||||
Similar to (kill-buffer (current-buffer)) with the following addition:
|
||||
|
||||
• prompt user to save if the buffer has been modified even if the buffer is not associated with a file.
|
||||
• make sure the buffer shown after closing is a user buffer.
|
||||
• if the buffer is a file, add the path to the list recently-closed-buffers.
|
||||
|
||||
A emacs buffer is one who's name starts with *.
|
||||
Else it is a user buffer."
|
||||
(interactive)
|
||||
(let (emacsBuff-p isEmacsBufferAfter)
|
||||
(if (string-match "^*" (buffer-name))
|
||||
(setq emacsBuff-p t)
|
||||
(setq emacsBuff-p nil))
|
||||
|
||||
;; offer to save buffers that are non-empty and modified, even for non-file visiting buffer. (because kill-buffer does not offer to save buffers that are not associated with files)
|
||||
(when (and (buffer-modified-p)
|
||||
(not emacsBuff-p)
|
||||
(not (string-equal major-mode "dired-mode"))
|
||||
(if (equal (buffer-file-name) nil)
|
||||
(if (string-equal "" (save-restriction (widen) (buffer-string))) nil t)
|
||||
t
|
||||
)
|
||||
)
|
||||
(if (y-or-n-p
|
||||
(concat "Buffer " (buffer-name) " modified; Do you want to save?"))
|
||||
(save-buffer)
|
||||
(set-buffer-modified-p nil)))
|
||||
|
||||
;; save to a list of closed buffer
|
||||
(when (not (equal buffer-file-name nil))
|
||||
(setq recently-closed-buffers
|
||||
(cons (cons (buffer-name) (buffer-file-name)) recently-closed-buffers))
|
||||
(when (> (length recently-closed-buffers) recently-closed-buffers-max)
|
||||
(setq recently-closed-buffers (butlast recently-closed-buffers 1))
|
||||
)
|
||||
)
|
||||
|
||||
;; close
|
||||
(kill-buffer (current-buffer))
|
||||
|
||||
;; if emacs buffer, switch to a user buffer
|
||||
(if (string-match "^*" (buffer-name))
|
||||
(setq isEmacsBufferAfter t)
|
||||
(setq isEmacsBufferAfter nil))
|
||||
(when isEmacsBufferAfter
|
||||
(previous-user-buffer)
|
||||
)
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue