1

When I try to enter a command such as set number in Spacemacs, I get the error State number cannot be set as initial Evil state.

What is an initial evil state and what does the error message actually mean, ie the implication?

  • you accepted an answer. So you solved something. What exactly did you solve and what commands did you run? – Charlie Parker Jan 10 at 3:05
2

:set numbers ends up calling evil-ex-set-initial-state which expects an initial state, such as normal, insert, emacs, etc. This command sets up the initial state the current buffer starts out with for better Emacs integration. For example, a text editing related buffer should start in normal state, a REPL in insert state, buffers with many special keys in Emacs state, etc.

This means you're doing the wrong thing if you want to enable line numbers. Use M-x linum-mode instead. Generally, you'll want to learn a bit more about Emacs before diving in, be it with Spacemacs or not.

That aside, I'm not sure whether accepting :set for :set-initial-state isn't a bug within Evil's ex parser. I'll have to investigate into that.

edit: The mentioned behavior comes from Evil trying to autocomplete set to a valid command, something Vim does as well for Ex commands. The shortened notation is to have a clear preference what a very short command would be resolved to as there would be too many auto-completion candidates to pick from.

  • none of your suggestions worked. I still cannot see line numbers in my text files. – Charlie Parker Jan 10 at 3:05
  • Make a new thread for this instead of hijacking an existing one with a most likely different problem. – wasamasa Jan 10 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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