is it possible to replace Insert state with Emacs state?

Frank Fischer frank.fischer at mathematik.tu-chemnitz.de
Fri Feb 10 09:18:00 CET 2012


On Fri, Feb 10, 2012 at 12:00:56PM +0800, Eric Luo wrote:
> 
> Hi,
> 
> When in Insert state, some Emacs-state key bindings are shadowed in evil, it
> is annoyed as I used to emacs edit command.
> 
> Is it possible to enter the emacs state when I press "O","o","i","I" etc
> in Normal state.

Replacing insert state with Emacs state completely is probably not a
good idea if you want to use functions related with the repeat-system,
because this requires some interaction that is only possible with
insert-state. This includes the repeat command "." itself but also
block or linewise insertion or insertion with count. But perhaps this
is not necessary. Insert state is already the state that is closest to
Emacs (except for Emacs state itself, of course) and only contains few
key-bindings. So if only the shadowing keybindings annoy you I assume
the easiest solution might be to remove all additional keybindings
from the corresponding keymap:

;; remove all keybindings from insert-state keymap
(setcdr evil-insert-state-map nil) 
;; but [escape] should switch back to normal state
(define-key evil-insert-state-map [escape] 'evil-normal-state) 

Btw: *all* keybindings defined by evil are in "evil-maps.el" and they are
usual Emacs keymaps. It's always a good place to look for something
related to keybindings.

Hope that works.

Frank



More information about the implementations-list mailing list