Search code examples
macoszshzshrczsh-alias

Quotes became invalid in .zshrc file


In my .zshrc file, if I add

alias vii=“mvim -v”

or alias vii=‘mvim -v’


After I used command vii, the terminal displayed:

zsh: command not found: “mvim

or zsh: command not found: ‘mvim


If I put

alias vii=mvim -v

Then, commandvii works as mvim without -v


Same, in my .zshrc file,

ZSH_THEME=robbyrussell works.

ZSH_THEME=“robbyrussell" doesn't work

Why quotes became invalid in the .zshrc file? How to solve?


Solution

  • You have to use ASCII quotes, not the curly quotes your editor is inserting.

    Compare

    alias vii=“mvim -v”   # wrong
    

    with

    alias vii="mvim -v"   # right