Evil: Insert mode RET behaving weirdly in SML-mode and Haskell-mode
I don't know how to diagnose this properly sadly since the evil-ret motion confuses me, but in Haskell mode and SML-mode and probably others, return behaves oddly with respect to the indentation level you would expect, i.e. the one you would get by switching to Emacs state. Does anyone have an idea how to fix this? -- Sarah
On Mon, Oct 03, 2011 at 11:26:26PM +0200, Sarah Brofeldt wrote:
I don't know how to diagnose this properly sadly since the evil-ret motion confuses me, but in Haskell mode and SML-mode and probably others, return behaves oddly with respect to the indentation level you would expect, i.e. the one you would get by switching to Emacs state. Does anyone have an idea how to fix this?
In my opinion it is not a good idea to bind "RET" to `evil-ret' in insert mode. The reason is that many modes may have their own implementation of some return-key-magic, so at least, `evil-ret' should preserve the default binding in insert-mode (in addition to its own magic). For the short term (until we decide what to do) you can do two things: 1. customize `evil-auto-indent' (set to nil) to prevent automatic indentation, if this is you problem. 2. unbind `evil-ret' in insert-state, e.g, (define-key evil-insert-state-map (kbd "RET") nil) Anyway, you're right, having a binding like `evil-ret' active in insert-mode without taking care of any other binding is probably a bad idea. Thanks for pointing this out. Frank
On 2011-10-04 11:35 +0200, Frank Fischer wrote:
In my opinion it is not a good idea to bind "RET" to `evil-ret' in insert mode. The reason is that many modes may have their own implementation of some return-key-magic, so at least, `evil-ret' should preserve the default binding in insert-mode (in addition to its own magic).
I agree, it is not the first time this binding causes trouble. I'll remove the Insert state binding for `evil-ret' (but leave the command be, since it is also bound in Motion state). -- Vegard
participants (3)
-
Frank Fischer -
Sarah Brofeldt -
Vegard Øye