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?
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?
: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.