I am using Evil (Vi keybindings) in Spacemacs.

Let's say I have something like that:

(defun myfunc-org-insert-custom-stuff ()
  (insert "This is custom stuff "))

but I would like to change the cursor from command to edit/insert mode, so I need to add some command after (insert "This is custom stuff ") so I am able to continue writing right away without the need to press a for jumping into insert mode.

The problem is I don't know what function will do that.

Any idea how to do that in Elisp?

  • I am using Spacemacs with Vim mode. Forgot to mention that. I am sorry. In Vim a will bring you back to insert mode from command mode. There are other ways like i but that's beside the point.
    – fegax
    Commented Jul 15, 2022 at 6:35
  • @phils Maybe it is Evil mode specific problem? Right now if I run this function I will stay in the command mode (the cursor is a rectangle block and not an I-beam) - because I triggered the function via a keybinding sequence and when I do that I have to be in a command mode (the rectangle block cursor).
    – fegax
    Commented Jul 15, 2022 at 6:35
  • Please update the text and tags to show that it is a question about Evil.
    – phils
    Commented Jul 15, 2022 at 7:08

1 Answer 1


You are probably looking for the function evil-insert-state. You could also use evil-insert or evil-append (which in Spacemacs you could find by using SPC h d k), but they take an argument, for which then you probably would like to use 0 or nil.

If you'd like to have evil-append like functionality, then I am not sure what is recommended, but I would probably use

  • (evil-insert-state) is it! Thank you.
    – fegax
    Commented Jul 15, 2022 at 17:01

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.