0

When I press o in evil mode (which moves the cursor to the line under, and goes into insert mode), the cursor is indented by two spaces.

When I press o, the cursor goes
  here

This happens in text mode and elisp buffers.

I tried to shut it off with this:

(defun remove-autoindent ()
  (electric-indent-mode nil))
 
(add-hook 'emacs-lisp-mode-hook 'remove-autoindent)
(add-hook 'text-mode-hook 'remove-autoindent)

But it didn't work. Which setting is causing this behavior?

I do not have any indent instructions outside of web-mode :config within use-package.

2
  • emacs.stackexchange.com/tags/elisp/info
    – Drew
    Commented Nov 29, 2023 at 19:36
  • Are you using some starter configuration like doom or spacemacs? (this behavior does not occur when starting from emacs -q, at least not in text-mode) Commented Nov 29, 2023 at 21:27

1 Answer 1

0

Coincidentally I just figured out a fix before finding this issue:

(setq evil-auto-indent nil)

Note however that if evil-auto-indent is set, pressing o just calls indent-according-to-mode behind the scenes, so however you have that set up is likely the root cause.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.