Ravikanth Andhavarapu
Ravikanth Andhavarapu

Reputation: 716

My .vim folder is empty

I have been using Ubuntu for a little while. I started learning programming recently. I started using vim. I have Ubuntu 12.04 installed. I do not know when I installed vim. I am wondering if it was present by default.

I have no ~/.vimrc file and the ~/.vim folder is empty. I found that .vimrc file should just be created by me.

1)All vim files seem to be located in /usr/share/vim. Why was ~/.vim created and left empty?

2)To configure and customize vim should they be shifted to ~/.vim? If so, can you point me to a resource which helps me do that?

Upvotes: 0

Views: 1353

Answers (2)

paxdiablo
paxdiablo

Reputation: 881623

The vim stuff in your home directory is specifically for your customisations, rather than system-wide ones.

That's the way it generally works under UNIXy operating systems, global stuff affecting everyone is found in a global area (such as /etc) and user-specific stuff is found in the user's home directory somewhere.

If you look at the man page for vim, you'll see something like:

/usr/share/vim/vimrc   System wide Vim initializations.
~/.vimrc               Your personal Vim initializations.
/usr/share/vim/gvimrc  System wide gvim initializations.
~/.gvimrc              Your personal gvim initializations.

The .vim directory in your home directory is specifically for things like plug-ins that only you want, rather than inflicting them on everyone. On a home machine with just one user, it doesn't make a lot of difference (unless you want the plug-ins available when you sudo to root as well).

But on a system with many users (and where you may not have the power to affect global areas), you'll need to do customisation only for your user.

Upvotes: 2

FDinoff
FDinoff

Reputation: 31429

Do not change anything under /usr/share/vim this will be updated when ever vim gets updated so your changes will be lost. Do not move them to ~/.vim as they are loaded automatically.

If you want to customize vim yourself you can place files in ~/.vim. This folder is part of the default vim runtimepath.

The different folders that you can add in ~/.vim that allow customization are below (Taken from :help runtimepath)

This is a list of directories which will be searched for runtime
files:
  filetype.vim  filetypes by file name |new-filetype|
  scripts.vim   filetypes by file contents |new-filetype-scripts|
  autoload/ automatically loaded scripts |autoload-functions|
  colors/   color scheme files |:colorscheme|
  compiler/ compiler files |:compiler|
  doc/      documentation |write-local-help|
  ftplugin/ filetype plugins |write-filetype-plugin|
  indent/   indent scripts |indent-expression|
  keymap/   key mapping files |mbyte-keymap|
  lang/     menu translations |:menutrans|
  menu.vim  GUI menus |menu.vim|
  plugin/   plugin scripts |write-plugin|
  print/    files for printing |postscript-print-encoding|
  spell/    spell checking files |spell|
  syntax/   syntax files |mysyntaxfile|
  tutor/    files for vimtutor |tutor|

If you want a more detailed explanation of what these directories do (and what should go in them) you can read about them in :help. The help in vim is very detailed and will explain almost everything about vim.

If nothing is in your ~/.vim directory don't worry. Your distribution might of added it to simplify your life since some people get confused when it doesn't exist.

Upvotes: 1

Related Questions