You are not logged in.

#1 2016-08-09 04:52:20

ivanborodin
Member
Registered: 2013-08-30
Posts: 58

syntax off in /etc/vimrc does not turn off syntax highlighting

On my last upgrade (yesterday) I got VIM 7.4.2143-1 (which now seems to have new defaults) and many things changed:

- VIM now defaults to syntax highlighting when it not used to
- VIM now auto-indents my lines in what it seems strange ways
- VIM now use TABs where I entered spaces (while editing some line)

I set syntax off on my global /etc/vimrc to no avail ... which is the one that annoys me the most

I suppose I can set autoindent off too and get rid off "smart autoindents" and also set tabstop=whatever

Offline

#2 2016-08-09 06:32:05

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: syntax off in /etc/vimrc does not turn off syntax highlighting

Perhaps your personal vimrc or plugin is interfering?

What is the output of:

:scriptnames

Offline

#3 2016-08-09 16:52:42

ivanborodin
Member
Registered: 2013-08-30
Posts: 58

Re: syntax off in /etc/vimrc does not turn off syntax highlighting

Thanks for your reply x33a !

I didn't customize my VIM at all ... except for a single line in the default /etc/vimrc: set encoding=utf-8

:scriptnames

1: /etc/vimrc
2: /usr/share/vim/vimfiles/archlinux.vim ... never edited it
3: /usr/share/vim/vim74/* ... I can see lots of files which seem related to syntax highlighting etc ... never edited them; more

What I can see is that /usr/share/vim/vimfiles/* are dated June 2016 which is when I first installed VIM and /usr/share/vim/vim74/* are dated August 8 which is when I upgraded a few days ago and got the VIM 7.4.2143-1 upgrade.

Offline

#4 2016-08-09 17:26:11

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: syntax off in /etc/vimrc does not turn off syntax highlighting


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2016-08-09 17:52:33

ivanborodin
Member
Registered: 2013-08-30
Posts: 58

Re: syntax off in /etc/vimrc does not turn off syntax highlighting

Thanks for the reply graysky !

First and foremost, I can confirm (as a sanity check) that my /etc/vimrc is sourced at the top of the list.

And from the thread you pointed out I gather that somehow the user-specific ~/.vimrc configuration file overrides (am I right ?) the settings provided in the global /etc/vimrc configuration file. It seems it all boils down to the sourcing order but since I have no ~/.vimrc file (because I have no personal specific configuration yet) why is my /etc/vimrc not honored at all ?

Obviously I can move the configuration commands to the user-specific configuration files but I have to maintain more than one file (one for root plus one for each user) every time I want to set something globally and I suppose this is what /etc/vimrc stands for in the first place.

As a side note I can see that the last VIM upgrade changed more things than I am yet aware of.

Offline

#6 2017-02-18 11:24:31

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: syntax off in /etc/vimrc does not turn off syntax highlighting

Glancing over the various default configuration files it appears that syntax hightlighting is turned on by default in vim 8.  You should have a .vimrc file in your home directory under any circumstances anyway, so just add this line to /home/your_home/.vimrc:

syntax off

To turn syntax on while in vim:

:syntax on

This article might be helpful:  https://groups.google.com/forum/#!topic … 79-w8khagE

Offline

#7 2017-02-18 12:08:10

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,529
Website

Re: syntax off in /etc/vimrc does not turn off syntax highlighting

You edited /etc/vimrc, but did you bother reading the very brief comments in it:

" do not load defaults if ~/.vimrc is missing
"let skip_defaults_vim=1

Uncomment that line and you'll have what you want.  You could also create an empty ~/.vimrc which would have the same effect.  In the absence of an ~/.vimrc some common defaults are loaded by default unless skip_defaults_vim is set.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB