What is the
~/.vim file used for, if anything, other than plugins? Is it part of Vim, or was it "invented" by plugin managers like Vundle?
What is the
I don't have conclusive evidence, but:
.vimis one of the default values of
'runtimepath' 'rtp' vimfiles 'runtimepath' 'rtp' string (default: Unix: "$HOME/.vim, $VIM/vimfiles, $VIMRUNTIME, $VIM/vimfiles/after, $HOME/.vim/after" ... 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
I think Pathogen was one of the first plugins to allow you to easily install plugins in other directories
Even its first release used
" pathogen.vim - path option manipulation " Maintainer: Tim Pope " Last Change: Apr 26, 2008 " Install in ~/.vim/autoload (or ~\vimfiles\autoload). " " API is documented below. if exists("g:loaded_pathogen") || &cp finish
runtimepathsupport was introduced in, or before, 2008. From
*version6.txt* For Vim version 7.3. Last change: 2008 Aug 06 ... Plugin support *new-plugins* To make it really easy to load a Vim script when starting Vim, the "plugin" runtime directory can be used. All "*.vim" files in it will be automatically loaded. For Unix, the directory "~/.vim/plugin" is used by default. The 'runtimepath' option can be set to look in other directories for plugins. |load-plugins| |add-plugin| The |:runtime| command has been added to load one or more files in 'runtimepath'.
Vim 6.2 makes use of
runtimepath, adding support for the
ftplugindirectory. See patch 6.2.073:
*** ../vim-6.2.072/runtime/doc/filetype.txt Sun Jun 1 12:20:32 2003 --- runtime/doc/filetype.txt Thu Aug 14 11:22:30 2003 *************** *** 1,4 **** ! *filetype.txt* For Vim version 6.2. Last change: 2003 Apr 25 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *filetype.txt* For Vim version 6.2. Last change: 2003 Aug 14 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 147,157 **** This means that the contents of compressed files are not inspected. *new-filetype* ! If a file type that you want to use is not detected yet, there are two ways to ! add it. In any way, it's better not modify the $VIMRUNTIME/filetype.vim file. ! It will be overwritten when installing a new version of Vim. ! A. If your file type can be detected by the file name. 1. Create your user runtime directory. You would normally use the first item of the 'runtimepath' option. Example for Unix: > :!mkdir ~/.vim
runtimepath has been in use since at least 2003, well before Pathogen was released. We can safely conclude its invention predated Vundle and similar plugins. (Though it could have been invented by someone who wanted to make using plugins easier.) And its use was definitely making user-level extensions to functionality easier, by allowing one to drop files in various directories to easily affect Vim behaviour.
It's an optional part of Vim proper and predated the plugin managers. It can be used for plugins you write yourself, for plugins you get from others, and to augment or replace Vim's standard plugins. I didn't find a primary place in the documentation where its use is discussed, but you can find a number of examples by executing
It can also be used for your own
filetype.vim file to add the recognition of filetypes or filename suffixes not recognized by Vim's
$VIMRUNTIME/filetype.vim. Recent versions of Vim also look there for a file named
~/.vimrc does not exist, allowing you to keep all your Vim configuration files in that directory.