*usr_06.txt*	For Vim version 6.0f.  Last change: 2000 Aug 12

		     VIM USER MANUAL - by Bram Moolenaar
		
			      Set your settings


|06.1|  The vimrc file
|06.2|  The default vimrc file explained
|06.3|  Adding a plugin
|06.4|  Often used options

     Next chapter: |usr_07.txt|  Using syntax highlighting
 Previous chapter: |usr_05.txt|  Making big changes
Table of contents: |usr_toc.txt|

==============================================================================
*06.1*  The vimrc file

==============================================================================
*06.2*  The default vimrc file explained

==============================================================================
*06.3*  Adding a plugin						*add-plugin*

Vim's functionality can be extended by adding a plugin.  A plugin is nothing
more than a Vim script file that is loaded when Vim starts up.  It usually
adds a nice feature for a limited audience (if it was for everybody it would
have been included in Vim itself).

Where can you find plugins?  Some come with Vim.  You can find them in the
directory $VIMRUNTIME/macros and its sub-directories.  Others can be
downloaded from the net, check out http://www.vim.org.  They are sometimes
posted in a Vim |maillist|.

How to start using a plugin?  First read the text in the plugin itself to
check for any special conditions.  Then copy the file to your plugin
directory:

	system		plugin directory ~
	Unix		~/.vim/plugin/
	PC and OS/2	$HOME/vimfiles/plugin or $VIM/vimfiles/plugin
	Amiga		s:vimfiles/plugin
	Macintosh	$VIM:vimfiles:plugin
	RISC-OS		Choices:vimfiles.plugin

Example for Unix: >

	cp /usr/local/share/vim/vim60/macros/justify.vim ~/.vim/plugin

That's all!  Now you can use the commands defined in this plugin to justify
text.

Actually, the "plugin" directory can be in any of the directories in the
'runtimepath' option.  All of these directories will be searched for plugins
and they are all loaded.  For example, if this command: >

	set runtimepath

produces this output: >

	runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim60

then Vim will load all plugins in these directories: >

	/etc/vim/plugin/
	~/.vim/plugin/
	/usr/local/share/vim/vim60/plugin/

Note that the last one is the value of $VIMRUNTIME which has been expanded.

What if it looks like your plugin is not being loaded?  You can find out what
happens when Vim starts up by using the |-V| argument: >
	vim -V1
You will see a lot of messages, in between them is a remark about loading the
plugins.  It starts with: >
	Searching for "plugin/*.vim" in 
There you can see where Vim looks for your plugin scripts.

Further reading:
	|load-plugins|	When the plugins are loaded during startup.
	|write-plugin|	How to write a plugin script.

==============================================================================
*06.4*  Often used options

==============================================================================
 vim:tw=78:
