Evil question

To use a certain application, I’m forced to use Emacs (shock horror) rather than Vim, but I’m using it in Evil mode
to avoid Emacs-pinkie-strain (from Ctrl). To avoid Vim-pinkie-strain (from Esc), I use Alt-space to get from INSERT mode
to NORMAL mode. However this doesn’t work as expected in Emacs Evil mode because it always advances the cursor an
additional character forward. I’d be grateful if any Evil Emacs experts could let me know of any inclusions in ~/.emacs
file I could use to make Alt-space to work as expected!

On 2013-08-15, flymail <flymail@no-mx.forums.opensuse.org> wrote:
> To use a certain application, I’m forced to use Emacs (shock horror) rather than Vim, but I’m using it in Evil mode
> to avoid Emacs-pinkie-strain (from Ctrl). To avoid Vim-pinkie-strain (from Esc), I use Alt-space to get from INSERT mode
> to NORMAL mode. However this doesn’t work as expected in Emacs Evil mode because it always advances the cursor an
> additional character forward. I’d be grateful if any Evil Emacs experts could let me know of any inclusions in ~/.emacs
> file I could use to make Alt-space to work as expected!

… guess there are no Evil Emacs experts out there!

On 08/16/2013 10:55 AM, flymail wrote:
> no Evil Emacs expert

i can’t directly help [have not used emacs much since retiring
OS/2]…and don’t even know how to google up a place where the
‘experts’ might be (and you would not have to wear your fireproof
pants) :frowning:

best i can do: only 1.5M hits:
https://www.google.com/search?q=emacs+evil+forum+source

maybe one or three are useful…maybe.

hmmmm…maybe if you ask a monitor to move this to
programming/scripting you might find some who more often looks under
the hood…or, maybe the [opensuse] mail list would be productive…


dd
http://tinyurl.com/DD-Complaints

On 2013-08-16, dd <DenverD@no-mx.forums.opensuse.org> wrote:
> On 08/16/2013 10:55 AM, flymail wrote:
>> no Evil Emacs expert
>
> i can’t directly help [have not used emacs much since retiring
> OS/2]…and don’t even know how to google up a place where the
> ‘experts’ might be (and you would not have to wear your fireproof
> pants) :frowning:

Pants mean something very different in the U.K. :slight_smile:

> best i can do: only 1.5M hits:
> https://www.google.com/search?q=emacs+evil+forum+source
>
> maybe one or three are useful…maybe.

Nope.

> hmmmm…maybe if you ask a monitor to move this to
> programming/scripting you might find some who more often looks under
> the hood…or, maybe the [opensuse] mail list would be productive…

It just worked it out for myself. The answer is:


(global-set-key (kbd "M-SPC") (lambda () (interactive) (evil-normal-state) (evil-forward-char)))

The result is not exactly identical to Vim’s version (the effect is slightly different at the very end of a line), but
actually I prefer it; I might even hack my ~/.vimrc to match its behaviour.

On 08/16/2013 12:45 PM, flymail wrote:
> worked it out for myself

great!!


dd