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


Reply
  Search this Thread
Old 04-30-2019, 01:57 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 /etc/vimrc.


Code:
bill@darkstar~/work2$ cat /etc/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
bill@darkstar~/work2$
However, I still have syntax highlighting. Possible cause?
 
Old 04-30-2019, 02:06 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Try
Code:
cp -f /etc/vimrc ~/.vimrc
 
Old 04-30-2019, 02:13 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
It worked! But vim has to read /etc/vimrc!
 
Old 04-30-2019, 07:59 PM   #4
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,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
On my machine, the global vimrc is located at /usr/share/vim/vimrc.
 
Old 04-30-2019, 08:55 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Oh yes, I remember that. I did 'locate vimrc' and that path did not appear. Then I used /etc/vimrc.
 
Old 05-01-2019, 04:16 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
Originally Posted by frankbell View Post
On my machine, the global vimrc is located at /usr/share/vim/vimrc.
Mine tooo.
 
Old 05-02-2019, 07:09 PM   #7
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Neither /etc/vimrc nor /usr/share/vim/vimrc is taken notice of by vim. It only reads ~/.vimrc. How can it be? I want to have a global vimrc.
 
Old 05-03-2019, 12:28 AM   #8
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by stf92 View Post
Neither /etc/vimrc nor /usr/share/vim/vimrc is taken notice of by vim. It only reads ~/.vimrc. How can it be? I want to have a global vimrc.
Normally the path is compiled IN your copy of VIM, so it is dependant on your distribution of Linux, but you can set the environment variable VIM to /usr/share/vim and it will use the vimrc IN that directory (if your maintainer compiled that option into vim).
My version has
Code:
   system vimrc file: "
$VIM/vimrc
   user vimrc file: "
$HOME/.vimrc
compiled into the executable.
 
1 members found this post helpful.
Old 05-03-2019, 08:18 AM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
/dirty labour saving thought:

If you have this in your user add mechanism, you can toss a .vimrc into /etc/skel and whatever user gets created gets this
 
Old 05-03-2019, 07:36 PM   #10
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by business_kid View Post
/dirty labour saving thought:

If you have this in your user add mechanism
What is this?
 
Old 05-04-2019, 06:01 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
My bad, that was unclear. I knew what I was talking about, but you'd have to be clairvoyant. If you have a ~/.vimrc in your /etc/skel, every new user would get one.
 
1 members found this post helpful.
Old 05-04-2019, 07:50 AM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Well, thanks.
 
Old 05-04-2019, 03:33 PM   #13
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
With a .vimrc in /etc/skel I have to have a separate .vimrc for root! Vim does not take notice of //etc/skel/.vimrc if I am root.
 
Old 05-05-2019, 04:03 AM   #14
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
The /etc/skel .vimrc is only passed top NEW users you add from now on. You have top sort any existing users yourself, like root. I tried to make that clear.
 
Old 05-05-2019, 08:40 AM   #15
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
What is the meaning of "top sort"?
 
  


Reply



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
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
hi i not getting my .vimrc file in this path ~/.vimrc dina3e Linux - Newbie 6 07-31-2012 04:36 PM
ls -a *vim* does not find .vimrc notwithstanding it is there. stf92 Linux - Newbie 2 07-09-2011 12:40 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
wher is my vimrc file and the .vim directory slac 10.0 rkrishna Slackware 3 04-11-2005 03:50 AM

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

All times are GMT -5. The time now is 02:55 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