I have my EXINIT set to

export EXINIT="set ts=4 sw=4 ai nosm nows expandtab"

I also want syn off to turn off syntax highlighting by default.

How can I add this to EXINIT? Tried using ; as a the separator but that doesn't work.

I know I can put these commands in .exrc file but I want to know if I can simply use EXINIT. vi or ex man pages don't talk about EXINIT when checked on my Mac.

  • III The environment variable EXINIT. ¦ The value of $EXINIT is used as an Ex command line.
    – Alex Kroll
    Jun 8 '19 at 9:47

by new line

export EXINIT='
    set ...
    syntax off

by |

export EXINIT='set ... | syntax off | balabala | ....'

check :h :|


Vim uses the | (vertical bar) as a command separator. Like:

export EXINIT="set ts=4 sw=4 ai nosm nows expandtab|syntax off"

See :help :bar. The | doesn't work with all commands. But there shouldn't be any problems with the commands you would typically use in a EXINIT (or VIMINIT).

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.