How to control Emacs vs. vi state with a file local variable?

Christoph LANGE math.semantic.web at
Mon Feb 4 10:56:39 CET 2013

Hi Frank,

with the recent improvements to evil (I can't tell the exact change
responsible for this) the feature I had once wished for (see old
communication below) suddenly started to work – thanks!


2012-10-31 17:39 Frank Fischer:
>> I would like to generally open all files of a certain type (org-mode)
>> in vi state but make exceptions for a few individual files.  Using
>> file local variables didn't work.
>> I tried
>> Local Variables:
>> eval: (evil-emacs-state)
>> End:
>> but apparently the order of execution was the following:
>> 1. load the file
>> 2. apply the local variables, switching to Emacs state
>> 3. here, or possibly before (2), switch buffer to org-mode
>> 4. on seeing that org-mode is not in the list of
>> evil-emacs-state-modes, switch to vi state
>> If this assumption is right, is there any way of opening individual
>> files in Emacs state?
> I think your assumptions are right and there is currently no way.
> But maybe the following patch could help. It defines a new variable
> `evil-this-buffer-initial-state' that can be set to some value != nil
> to overwrite the initial state in the current buffer. When set in a
> file variable it should do what you want.

Christoph Lange, School of Computer Science, University of Birmingham, Skype duke4701

→ Enabling Domain Experts to use Formalised Reasoning @ AISB 2013
  2–5 April, Exeter, UK.  Deadline (extended) 28 Jan
→ Intelligent Computer Mathematics, 7–12 Jul, Bath, UK; Deadline 8 Mar
→ SePublica Workshop @ ESWC 2013.  Montpellier, France, 26-30 May.

More information about the implementations-list mailing list