LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch
User Name
Password
Arch This Forum is for the discussion of Arch Linux.

Notices


Closed Thread
  Search this Thread
Old 05-07-2019, 06:16 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Vim does not take notice of the VIM variable.


Code:
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.
 
Old 05-07-2019, 08:08 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
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.

https://www.cyberciti.biz/faq/set-en...ariable-linux/
 
Old 05-07-2019, 09:12 PM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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.
 
Old 05-08-2019, 05:11 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
duplicate of https://www.linuxquestions.org/quest...rc-4175653018/
 
Old 05-08-2019, 07:26 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Closed per above.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vim does not take notice of /etc/vimrc. stf92 Arch 22 05-08-2019 06:44 PM
LXer: UK judge: Apple notice on Samsung a - breach of order - , orders new notice LXer Syndicated Linux News 0 11-02-2012 02:10 PM
LXer: Novell Receives Delisting Notice From NASDAQ and Notice of Default From Wells Fargo Related to its Convertible Subordinated Notes Due to Late Filing of Form 10-Q LXer Syndicated Linux News 0 09-21-2006 03:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Arch

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration