ArchThis Forum is for the discussion of Arch Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
root@darkstar~# cat /usr/share/vim/vimrc
" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
" /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing archlinux.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages.
runtime! archlinux.vim
" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
" Or better yet, read /usr/share/vim/vim80/vimrc_example.vim or the vim manual
" and configure vim to your own liking!
" do not load defaults if ~/.vimrc is missing
"let skip_defaults_vim=1
set backup
syntax off
root@darkstar~# echo $VIM
/usr/share/vim
root@darkstar~#
Now if I run vim I still have color syntax highlighting. How do you explain it? My distro is arch.
Perhaps I'm missing something and it's been a long time since I mucked about with variables in BASH, but I do not see anywhere the quoted code where you set a variable.
There are other RC files that override the global settings in /usr/share/vim/vimrc. Usually, $HOME/.vimrc and $HOME/.vim/vimrc as well as .exrc. You see them when you run the :version command in a vim session. Also try :help vimrc.
I just tested it on my Ubuntu 16 server, setting syntax off in /usr/share/vim/vimrc, and syntax on in $HOME/.vimrc. Syntax is highlighted. Setting syntax off in $HOME/.vimrc: Syntax is not highlighted. In short, works as expected.
By the way, if you want a program to read an environment variable like VIM, it is not sufficient to set it. You also need to export it. However, I am not sure if that is relevant here, as /usr/share/vim seems to be the default. VIM is not set in my environment.
Last edited by berndbausch; 05-07-2019 at 09:21 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.