changeset 96281:b61f47138fd3

(goto-map): New variable. Rebind goto-related commands to this `M-g' prefix keymap. (search-map): New variable for `M-s' prefix keymap. Bind `M-s o' to `occur', `M-shr' to `highlight-regexp', `M-shp' to `highlight-phrase', `M-shl' to `highlight-lines-matching-regexp', `M-shu' to `unhighlight-regexp', `M-shf' to `hi-lock-find-patterns', `M-shw' to `hi-lock-write-interactive-patterns'.
author Juri Linkov <juri@jurta.org>
date Wed, 25 Jun 2008 20:17:07 +0000
parents bfca3297fa0b
children 40b913a5812c
files lisp/bindings.el
diffstat 1 files changed, 22 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/bindings.el	Wed Jun 25 16:51:33 2008 +0000
+++ b/lisp/bindings.el	Wed Jun 25 20:17:07 2008 +0000
@@ -804,16 +804,31 @@
 (define-key ctl-x-map "\C-n" 'set-goal-column)
 (define-key global-map "\C-a" 'move-beginning-of-line)
 (define-key global-map "\C-e" 'move-end-of-line)
-(define-key esc-map "g" (make-sparse-keymap))
-(define-key esc-map "g\M-g" 'goto-line)
-(define-key esc-map "gg" 'goto-line)
 
-(define-key esc-map "gn" 'next-error)
-(define-key esc-map "g\M-n" 'next-error)
 (define-key ctl-x-map "`" 'next-error)
 
-(define-key esc-map "gp" 'previous-error)
-(define-key esc-map "g\M-p" 'previous-error)
+(defvar goto-map (make-sparse-keymap)
+  "Keymap for navigation commands.")
+(define-key esc-map "g" goto-map)
+
+(define-key goto-map    "g" 'goto-line)
+(define-key goto-map "\M-g" 'goto-line)
+(define-key goto-map    "n" 'next-error)
+(define-key goto-map "\M-n" 'next-error)
+(define-key goto-map    "p" 'previous-error)
+(define-key goto-map "\M-p" 'previous-error)
+
+(defvar search-map (make-sparse-keymap)
+  "Keymap for search related commands.")
+(define-key esc-map "s" search-map)
+
+(define-key search-map "o"  'occur)
+(define-key search-map "hr" 'highlight-regexp)
+(define-key search-map "hp" 'highlight-phrase)
+(define-key search-map "hl" 'highlight-lines-matching-regexp)
+(define-key search-map "hu" 'unhighlight-regexp)
+(define-key search-map "hf" 'hi-lock-find-patterns)
+(define-key search-map "hw" 'hi-lock-write-interactive-patterns)
 
 ;;(defun function-key-error ()
 ;;  (interactive)