Mapping ESC in minibuffer normal mode to keyboard-quit and autoindent woes

Vegard Øye vegard_oye at hotmail.com
Sat Mar 12 13:19:46 CET 2011


On 2011-03-11 23:35 +0100, Justin Zhu wrote:

> I like to have ESC behave like C-g in normal mode in the minibuffer

The most straightforward way is to disable Viper in the minibuffer:

    (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
    (defadvice viper-set-minibuffer-overlay (around vimpulse activate) nil)
    (defadvice viper-has-face-support-p (around vimpulse activate) nil)
    (define-key minibuffer-local-map (kbd "ESC") 'abort-recursive-edit)

That will remove all modal functionality when using Ex.

> Another issue is vimpulse messing with comment indenting. I have RET
> bound to comment-indent-new-line so that in a comment, pressing
> enter inserts a comment prefix. However, with vimpulse on, it
> inserts an extra tab to the new line.

This should work without binding RET yourself -- Viper binds RET to
`viper-autoindent', which in Vimpulse calls `comment-indent-new-line'.
I am unable to reproduce the behavior in c-mode or java-mode. What
major mode are you using? Are you using the Git version of Vimpulse?

> Any help is greatly appreciated!

Please note that Vimpulse is being discontinued in favor of Evil,[1]
which will do everything Vimpulse does and much more. I will still
provide basic support for Vimpulse to ease the transition, but once
Evil hits its first release, Vimpulse is officially obsolete.

[1] http://gitorious.org/evil

-- 
Vegard



More information about the implementations-list mailing list