Nguyễn Minh Đăng
Nguyễn Minh Đăng

Reputation: 99

Vimrc error: "syntax: command not found"

Everything worked fine a couple weeks ago and then boom! Out of no where I got this error from my .vimrc. I reduced it to the very ultimately basic version but nothing changed.

Ultimately superiorly basic version:

Ultimately superiorly basic version

Actual footage:

Actual footage

Upvotes: 7

Views: 18734

Answers (1)

romainl
romainl

Reputation: 196886

You are trying to source your vimrc in your shell, which doesn't make any sense at all.

Vim uses its own scripting language that is not understood by your shell and your shell uses its own scripting language that is not understood by Vim so there's no reason whatsoever to expect $ source ~/.vimrc (in your shell) or :source ~/.bashrc (in Vim) to do anything useful.

You can, however…

  • source your vimrc from within vim via :source ~/.vimrc,
  • or simply let Vim source it itself when it starts.

Upvotes: 33

Related Questions