vote up 1 vote down star

Right now, I make everyone do ~/.vimrc and put their settings there.

How can I make a global, default .vimrc for new users?

Edit: I am using CentOS

flag

79% accept rate

migrated from stackoverflow.com

4 Answers

vote up 9 vote down check

usually by creating /etc/vimrc or /etc/vim/vimrc. Depends on your version of vim and linux/unix

link|flag
I am using CentOS – Alex Nov 1 at 2:12
3  
should be /etc/vimrc on CentOs – ennuikiller Nov 1 at 2:16
It is /etc/vimrc – Alex Nov 1 at 2:21
vote up 6 vote down

to create a default ~/.vimrc for all new users, you should be able to drop it into /etc/skel

If I recall correctly, that provides the template for new user's home directories.

link|flag
vote up 2 vote down

In Debian, it appears the file you are looking for is:

/etc/vim/vimrc

It might be different in a different distro (though I think that is not much likely).

Good luck.

link|flag
vote up 1 vote down

See :help system-vimrc:

For Unix, MS-DOS, MS-Windows, OS/2, VMS, Macintosh, RISC-OS and Amiga the system vimrc file is read for initializations. The path of this file is shown with the ":version" command. Mostly it's "$VIM/vimrc". Note that this file is ALWAYS read in 'compatible' mode, since the automatic resetting of 'compatible' is only done later. Add a ":set nocp" command if you like.

So, put your system configurations in this file. Type :help version in vim to see where, or echo $VIM at the shell to see if $VIM is defined. (Note that you may have to set $VIM for all users, such as in a system bashrc file.)

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.