LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-29-2011, 08:34 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Directory for vimrc so it's usable by both root and user foo.


kernel 2.6.21.5, Slackware 12.0

Hi:
I want to avoid the redundancy of placing .vimrc in both /root and /home/foo. Couldn't it be placed somewhere, say, in /etc and its settings be valid for both root and foo? Regards.

Last edited by stf92; 01-29-2011 at 08:55 AM.
 
Old 01-29-2011, 08:48 AM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
You might try placing a copy of your .vimrc in /etc/vim/vimrc or possibly /usr/share/vim/vimrc.

Regards,


Fordeck
 
Old 01-29-2011, 08:54 AM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
No use. Thanks anyways.
 
Old 01-29-2011, 08:58 AM   #4
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Make sure the vimrc file is not hidden in the mentioned paths (i.e. remove the leading period)


Regards,

Fordeck
 
Old 01-29-2011, 09:27 AM   #5
DonnieP
Member
 
Registered: Jan 2008
Location: Richmond, VA USA
Distribution: Slackware
Posts: 144

Rep: Reputation: 29
Try /etc/vimrc. And remember you'll have to remove the .vimrc in users' home directories for /etc/vimrc to stand alone.
 
Old 01-29-2011, 09:43 AM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Of course I removed the leading period and I tried /etc/vimrc too with no success. But maybe /etc scripts are read only at boot time. I'll try this.
 
Old 01-29-2011, 09:48 AM   #7
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
DonnieP brought up a good point:

Quote:
And remember you'll have to remove the .vimrc in users' home directories for /etc/vimrc to stand alone.
Did you try that?

Regards,

Fordeck
 
Old 01-29-2011, 10:03 AM   #8
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
It's true. Now I've done it. All I have is a vimrc in both /etc/ and /etc/vim/. And I have rebooted. But still no use. Thanks for the feedback.
 
Old 01-29-2011, 10:10 AM   #9
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Quote:
All I have is a vimrc in both /etc/ and /etc/vim/
What about /usr/share/vim/vimrc?

Regards,

Fordeck
 
Old 01-29-2011, 10:19 AM   #10
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
I don't frequently use SLAX so the only example I have is to boot BackTrack 3 which was a Slackware distro. It uses the /usr/share/vim/vimrc path.

Ubuntu 10.04 uses a symlink in /usr/share/vim/vimrc to point to /etc/vim/vimrc. Anyway I hope you find the answer.

Regards,

Fordeck
 
Old 01-29-2011, 10:28 AM   #11
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
According to the vim manpage:

/usr/share/vim/vimrc
System wide Vim initializations.

You will need to remove/rename any .vimrc in user's or root's $HOME for it to only use the system wide one. Also you do _not_ need to reboot. Vim will read files when you run it. If that still fails you can make vim use a config file with the -u switch. Perhaps you can alias it.
 
Old 01-29-2011, 10:44 AM   #12
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
The thing with slack is that almost all of the variables mentioned in manuals are empty after installation. In this case, it is $VIM. Command :version says
Quote:
fall-back for $VIM: "/usr/share/vim".
So I wrote the following in /etc/profile:
Code:
VIM="/usr/share/vim"
and this solved the problem as /usr/share/vim/vimrc was already there. I only had to add 'set autoindent' at the end, this being a feature I wanted to add, although it already has a 'set autoindent' command above in that file. But for some reason, it won't get executed. I would have to study the script, and perhaps study a little more bash in order to understand this.

Anyways, the problem's been solved, and I thank you guys. Regards.

EDIT: No great science to understand what happens in /usr/share/vim/vimrc. It just was compiled with support for autocommands, be this whatever it be.

Last edited by stf92; 01-29-2011 at 11:04 AM.
 
Old 01-30-2011, 12:22 AM   #13
Gavin Harper
Member
 
Registered: Feb 2010
Location: Finland
Distribution: Slackware
Posts: 169

Rep: Reputation: 24
I copy my vimrc into /usr/share/vim/vimrc

I can access it from both root and my user account.
 
  


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
hi i not getting my .vimrc file in this path ~/.vimrc dina3e Linux - Newbie 6 07-31-2012 04:36 PM
root/user and file/directory permissions nimnull22 Linux - Security 7 12-17-2010 02:06 PM
changing root directory of a user shanecaldeiro Linux - Newbie 10 05-19-2009 12:30 AM
wher is my vimrc file and the .vim directory slac 10.0 rkrishna Slackware 3 04-11-2005 03:50 AM
can not access directory from user account - only root walterbyrd Linux - General 1 03-04-2005 11:23 PM

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

All times are GMT -5. The time now is 08:54 AM.

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