Slackware This Forum is for the discussion of Slackware 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
09-04-2014, 06:30 PM
|
#1
|
Member
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105
Rep:
|
Vim colors
I created a ~/.vimrc which contains this:
Which refers to dante.vim located in /usr/share/vim/vim74/colors/
When I close the terminal and open a new one, and try to edit a file, the default colorscheme still shows up. I know it's not using the one I specified in .vimrc because after I edit the file I enter:
:colorscheme dante
And it changes to dante. People make it sound so simple, but the colorscheme specified in ~/.vimrc still only takes affect when I run the :colorscheme command. How do I get it to work even on reboot/new terminal?
|
|
|
09-04-2014, 06:37 PM
|
#2
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
|
Is it possible that you have two colorscheme lines in your .vimrc, and the second is resetting the dante line?
It really is so simple, when you get all the little duckies in a row.
If not, could you post your ~/.vimrc and the dante.vim file for us.
Last edited by astrogeek; 09-04-2014 at 06:40 PM.
|
|
|
09-04-2014, 07:20 PM
|
#3
|
LQ Veteran
Registered: May 2008
Posts: 7,010
|
I'm not an expert but I think they must have changed the definitions needed for vim colour files at some point.
Check the colour file contains something like:
Code:
hi clear
set background=dark
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "gazl"
where g:colors_name is set to the name of the colour file. I've found that without this, vim won't load the colour scheme from a statement in vimrc, but it will work if loaded from within vim with :color.
|
|
|
09-04-2014, 07:22 PM
|
#4
|
Member
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105
Original Poster
Rep:
|
Ok, I just noticed that the colorscheme DOES indeed take effect, when I run vim WITHOUT sudo. If I run it with sudo it doesn't load the colorscheme.
|
|
|
09-04-2014, 07:31 PM
|
#5
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
|
You will need to have the root .vimrc also invoke the desired color scheme.
Surely you are not running Vim with sudo for normal uses are you?
Last edited by astrogeek; 09-04-2014 at 07:32 PM.
|
|
|
09-04-2014, 08:14 PM
|
#6
|
Member
Registered: Oct 2013
Distribution: Slackware, Arch
Posts: 105
Original Poster
Rep:
|
Ok that makes sense. No, I only run it using sudo when I need to edit, say, a /etc file that is write-protected or something.
|
|
|
09-04-2014, 10:10 PM
|
#7
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
|
Ok, just wasn't sure from your other posts.
So, yes, when using Vim with sudo it will use /root/.vimrc instead of the user's ~/.vimrc.
If you are the only user or admin for the box, just copy your own .vimrc over to root and you will always be in a familiar environment - it's what I do, must be right!
|
|
|
All times are GMT -5. The time now is 09:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|