summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2003-02-03 22:33:13 +0000
committerKim F. Storm <storm@cua.dk>2003-02-03 22:33:13 +0000
commite63a95c1d1f30af7a40649ac829efd9c08d8b66b (patch)
tree4ce2aaca823239c29c175a955093c5b49e3d340f
parentc04186f854feeb91c6dc4501816ff049111fb363 (diff)
downloademacs-e63a95c1d1f30af7a40649ac829efd9c08d8b66b.tar.gz
(ido-define-mode-map): Remap viper delete char/word
commands to their ido specific equivalents. Disable ESC in viper mode (to avoid exiting insert mode), since ido doesn't work in viper command mode. (ido-delete-backward-updir, ido-delete-backward-word-updir): Handle remapped viper commands.
-rw-r--r--lisp/ido.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/ido.el b/lisp/ido.el
index cef907be3b4..0391ec68b4a 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1352,6 +1352,12 @@ This function also adds a hook to the minibuffer."
(define-key map "\C-k" 'ido-kill-buffer-at-head)
)
+ (when (if (boundp 'viper-mode) viper-mode)
+ (define-key map [remap viper-backward-char] 'ido-delete-backward-updir)
+ (define-key map [remap viper-del-backward-char-in-insert] 'ido-delete-backward-updir)
+ (define-key map [remap viper-delete-backward-word] 'ido-delete-backward-word-updir)
+ (define-key map [remap viper-intercept-ESC-key] 'ignore))
+
(setq ido-mode-map map)
(run-hooks 'ido-define-mode-map-hook)))
@@ -2166,6 +2172,10 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
(ido-up-directory t)))
((and ido-pre-merge-state (string-equal (car ido-pre-merge-state) ido-text))
(ido-undo-merge-work-directory (substring ido-text 0 -1) t t))
+ ((eq this-original-command 'viper-backward-char)
+ (funcall this-original-command (prefix-numeric-value count)))
+ ((eq this-original-command 'viper-del-backward-char-in-insert)
+ (funcall this-original-command))
(t
(delete-backward-char (prefix-numeric-value count)))))
@@ -2175,7 +2185,9 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
(if (= (minibuffer-prompt-end) (point))
(if (not count)
(ido-up-directory t))
- (backward-kill-word (prefix-numeric-value count))))
+ (if (eq this-original-command 'viper-delete-backward-word)
+ (funcall this-original-command (prefix-numeric-value count))
+ (backward-kill-word (prefix-numeric-value count)))))
(defun ido-get-work-directory (&optional incr must-match)
(let ((n (length ido-work-directory-list))