From ed4036f95db1cdf8c5275617fbb527cf81202fbc Mon Sep 17 00:00:00 2001 From: Tu Do Date: Wed, 21 May 2014 13:46:01 +0700 Subject: [PATCH 1/2] Add discover-my-major A better interface for getting information about major mode features. It can complement the built-in "C-h m" (describe-mode): "C-h m" can be thought of a full mode help, while discover-my-major a quick mode help, in the following ways: - Show key binding with description - Cursor is automatically switched to discover-my-major help buffer, and to quit the help buffer, simply press 'q'. In stock "C-h m", user has to manually switch, scroll up/down to look for major mode commands. Finally, user closes the buffer either by "C-x 0", or winner-mode undo (C-c ), which requires more key strokes. - Display just enough information. In "C-h m", it displays every thing, from major mode to minor modes, enabling minor modes and description of every modes. - More polished user interface. It's also better than smex-major-mode-commands, since smex-major-mode-commands does not show key bindings and description. --- core/prelude-mode.el | 1 + core/prelude-packages.el | 1 + 2 files changed, 2 insertions(+) diff --git a/core/prelude-mode.el b/core/prelude-mode.el index 0a172df..c09c2be 100644 --- a/core/prelude-mode.el +++ b/core/prelude-mode.el @@ -65,6 +65,7 @@ (define-key map (kbd "C-c h") 'helm-prelude) (define-key map (kbd "C-c I") 'prelude-find-user-init-file) (define-key map (kbd "C-c S") 'prelude-find-shell-init-file) + (define-key map 'help-command (kbd "C-m") 'discover-my-major) ;; make some use of the Super key (define-key map [?\s-d] 'projectile-find-dir) (define-key map [?\s-p] 'projectile-switch-project) diff --git a/core/prelude-packages.el b/core/prelude-packages.el index bdfb77a..a9360d3 100644 --- a/core/prelude-packages.el +++ b/core/prelude-packages.el @@ -49,6 +49,7 @@ anzu browse-kill-ring dash + discover-my-major diff-hl diminish easy-kill From 543bfd4cc4e688f73b91b79b58d2133eba65ea52 Mon Sep 17 00:00:00 2001 From: Tu Do Date: Tue, 27 May 2014 11:19:01 +0700 Subject: [PATCH 2/2] Update documentation --- README.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2606c1b..17f013a 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,7 @@ Keybinding | Description C-c g | Search in Google for the thing under point (or an interactive query). C-c G | Search in GitHub for the thing under point (or an interactive query). C-c y | Search in YouTube for the thing under point (or an interactive query). +C-c U | Search in Duckduckgo for the thing under point (or an interactive query). C-S-RET or Super-o | Insert an empty line above the current line and indent it properly. S-RET or M-o | Insert an empty line and indent it properly (as in most IDEs). C-S-up or M-S-up | Move the current line or region up. @@ -290,14 +291,28 @@ Keybinding | Description C-c u | Open URL in your default browser. C-c e | Eval a bit of Emacs Lisp code and replace it with its result. C-c s | Swap two active windows. +C-c D | Delete current file and buffer. C-c d | Duplicate the current line (or region). C-c M-d | Duplicate and comment the current line (or region). C-c r | Rename the currently visited file and buffer. C-c t | Open a terminal emulator (`ansi-term`). C-c k | Kill all open buffers except the one you're currently in. +C-c TAB | Indent and copy region to clipboard C-c h | Open Helm (available if you've enabled the `prelude-helm` module). -C-c + | Increment integer at point. -C-c - | Decrement integer at point. +C-c I | Open user's init file. +C-c S | Open shell's init file. +C-h C-m | Display key bindings of current major mode and descriptions of every binding. +C-c . + | Increment integer at point. Default is +1. +C-c . - | Decrement integer at point. Default is -1. +C-c . * | Multiply integer at point. Default is *2. +C-c . / | Divide integer at point. Default is /2. +C-c . \ | Modulo integer at point. Default is modulo 2. +C-c . ^ | Power to the integer at point. Default is ^2. +C-c . < | Left-shift integer at point. Default is 1 position to the left. +C-c . > | Right-shift integer at point. Default is 1 position to the right. +C-c . # | Convert integer at point to specified base. Default is 10. +C-c . % | Replace integer at point with another specified integer. +C-c . ' | Perform arithmetic operations on integer at point. User specifies the operator. Super-r | Recent files Super-x | Expand region Super-j | Join lines @@ -307,6 +322,9 @@ Keybinding | Description Super-m f | Magit file log Super-m b | Magit blame mode +**Note**: For various arithmetic operations, the prefix `C-c .` only needs to be pressed once for the first operation. +For subsequent operations, only the appropriate operations (i.e. `+`, `-`, `*`, `/`... needs to be pressed). + #### OSX modifier keys Prelude does not mess by default with the standard mapping of `Command` (to `Super`) and `Option` (to `Meta`).