Click to See Complete Forum and Search --> : VIM question


Energon
03-26-2001, 06:09 PM
Is there any way to set global VIM parameters? basically, I'm wanting to setup a .vimrc type deal that applies to ALL users on the system... something that's (hopefully) overriden by their personal ones, but puts a nicer touch for people who don't want to customize it...

or is it setup to only allow config files in users home directory?

EscapeCharacter
03-26-2001, 06:17 PM
i dont know if this applies to vim but most programs if you want to have a config file global for all users you could throw it in /etc and rename it from .vimrc to vimrc

Strike
03-26-2001, 06:30 PM
Yes, /etc/vimrc is the file to do that.

Energon
03-26-2001, 07:16 PM
figures it'd be something that easy to guess... I didn't see anything in the manpages about that...

YaRness
03-27-2001, 08:25 AM
man pages are too often only useful if you already know how to use the software :eek:

Strike
03-27-2001, 12:24 PM
Originally posted by Energon:
figures it'd be something that easy to guess... I didn't see anything in the manpages about that...

For vim help, nothing beats their online help (F1 or :h).

YaRness
03-27-2001, 01:48 PM
Originally posted by Strike:
For vim help, nothing beats their online help (F1 or :h).

you can often do help for a particular thing as well. for example: ":h syntax". tres handy.

( try ":h help" to get ya started )

Energon
04-03-2001, 05:01 PM
odd... I copied my .vimrc to /etc/vimrc and renamed my .vimrc to .vimrc.tmp and tried to see if it would work... but when I fire up vim it's back to the default settings... so I'm guessing it's actually not /etc/vimrc... I'm gonna try and use the vim help to see what I can find, but it's kinda confusing for me to read through and find something like that... if anyone knows of any other places for the file, that'd be very cool...

Energon
04-03-2001, 05:08 PM
got it... you have to set the environment variable VIMINIT to where the file will be, ie:

export VIMINIT=/etc/vimrc

it gives errors when I start vim, but does what I need... so it'll have to do (and it doesn't say anything about the error, so I can't really do much to debug it)...

kmj
04-03-2001, 05:10 PM
:h vimrc :)

I thin the answer is to use the environment variable VIMINT; check the above for more info.

kmj
04-03-2001, 05:11 PM
damn,you beat me to it. :D

Energon
04-05-2001, 12:33 AM
Well, it works... but not totally... it's kind of like it pulls parts from my config file, but not all of it... keeping in mind that it works exactly how I want it to when it's in my home directory, I can't figure out why it wouldn't totally work through the VIMINIT var... and I didn't see much in the help info relating to problems with doing it that way... :(

kmj
04-05-2001, 11:24 AM
That's strange. Only some things in the global config file work? Can you see any kind of relationship between the things that do work and the things that don't? Maybe that will provide some clue.

Energon
04-05-2001, 02:08 PM
I don't see any correlation at all... this is the error I get:

search hit BOTTOM, continuing at TOPsearch hit BOTTOM, continuing at TOPError detected while processing VIMINIT:

not a clue what that means... but here's my vimrc:

set nocompatible
set bs=2
set nobackup
set ruler
syntax on
set hlsearch
set selectmode=mouse

not the best config, but it does what I want... and as far as I can tell it does the nocompatible line and that's it... :(

Energon
04-09-2001, 03:00 PM
the wierd thing is that it's treating VIMINT like a regex... I can't remember how I discovered it, but it's saying that "expression etc not found"... so I'm really confused about what's going on...

YaRness
04-09-2001, 03:21 PM
try "VIMINIT= source /etc/vimrc" or something that looks like that. VIMINIT doesn't contain the location for the file, it is intended to actually contain the settings you would find in the file. i think the source command reads the settings from the given file (here, '/etc/vimrc').

i found this answer here (http://www.naglenet.org/vim/vim.html), among other places that google (http://www.google.com/) told me to look at.

:cool: Google :cool:

Energon
04-09-2001, 05:59 PM
very cool... very cool... someone needs to tell the vim guys to update the manpage or something... it reads to me like you just put where the file will be found...