Removing automatically inserted indent when exiting insert mode

Nikolai Weibull now at bitwi.se
Thu Sep 22 15:40:21 CEST 2011


Hi!

A suggested improvement is to remove automatically inserted indent
when exiting insert mode.  I guess the condition is that if the last
command was evil-ret when exiting insert mode, any indent
automatically inserted should be removed.  This is what Vim does.

It seems like it could be as easy as

(add-hook 'evil-insert-state-exit-hook
'evil-delete-autoindent-on-insert-state-exit)

(defun evil-delete-autoindent-on-insert-state-exit ()
  (if (eq last-command 'evil-ret)
      (delete-horizontal-space))))

without the horrible name.

What do you think?



More information about the implementations-list mailing list