How to make a global ~/.vimrc?

4,603

Solution 1

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

Solution 2

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.

Solution 3

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.

Solution 4

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.)

Share:
4,603

Related videos on Youtube

Makah
Author by

Makah

Updated on September 17, 2022

Comments

  • Makah
    Makah over 1 year

    I want to make a program in C# that imports two types of files to SQL Server: tab delimited and fixed columns. Actually, I need to download a file every day and import that file into my database. I could make a console app with batch script. I saw some examples like this, but I don´t know if it is the best object-oriented way to do it.

    I could use StreamReader, Regex and so on, but I don't want to re-invent the wheel.

    PS: In VBA I used "QueryTables.Add".

    • msarchet
      msarchet over 12 years
      Could you show the format for what the file is supposed to look like related to the SQL server?
    • Aacini
      Aacini over 12 years
      Please note that Batch tag is "used for Windows batch file questions". Don't use it just because your question is related to "batch" word in any way...
  • Alex
    Alex over 14 years
    I am using CentOS
  • ennuikiller
    ennuikiller over 14 years
    should be /etc/vimrc on CentOs
  • Alex
    Alex over 14 years
    It is /etc/vimrc
  • Makah
    Makah over 12 years
    I'm using SQL Server 2008 express
  • Makah
    Makah over 12 years
    I have some trash rows in my file. I need something like row patterns (Regex). I could create some file converter then use SQLBulk
  • vvondra
    vvondra over 8 years
    By default it sources /etc/vim/vimrc.local which would be safer for updates
  • majkinetor
    majkinetor over 7 years
    Doesn't work on Solaris