Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error while running "source .vimrc"

i am having a simple vimrc file when i run "source .vimrc" in ubuntu I am getting the following error.

$ source .vimrc 
bash: .vimrc: line 3: syntax error near unexpected token `"syntax"'
bash: .vimrc: line 3: `if has("syntax")'

Here is my script file

set term=builtin_ansi
set nu
if has("syntax")
    syntax on
endif

I do have syntax installed in my vim.

vim --version | grep syntax
vim: /home/shankaran/src/ns/service/build/dp/lib/libcrypto.so.1.0.0: no version information available (required by /usr/lib/libpython2.7.so.1.0)
vim: /home/shankaran/src/ns/service/build/dp/lib/libssl.so.1.0.0: no version information available (required by /usr/lib/libpython2.7.so.1.0)
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 
like image 700
user2421350 Avatar asked Dec 20 '22 18:12

user2421350


1 Answers

You tried to source your Vim configuration file from bash. Do it from Vim:

$ vim
:source /path/to/.vimrc

If it's located at ~/.vimrc, Vim will source that file automatically.

like image 165
romainl Avatar answered Jan 05 '23 09:01

romainl