History
Article Edit this page Discussion

How to mimic the vim 6.0 plugin feature with older versions

From Vim Tips Wiki

Jump to: navigation, search

Tip 85 Previous Next Created: July 5, 2001 Complexity: intermediate Author: bubbleboy Version: 5.7


If you do not have Vim 6.0, but would like to mimic the plugins directory feature then copy and paste this into your vimrc:

exec "source " . substitute(glob($VIM."/plugins/*.vim"), "\n", "\nsource ", "g")

It will automatically source every Vim script file located in the vim/plugins directory.

Now, to add a new plugin, just drop the script in this directory and Vim will automatically find it.

[edit] Comments

To make Vim look in your home directory for the plugins directory:

Use $HOME, or ~ (tilde), instead of $VIM. If you use tilde, it must be inside the quotes. The $VIM (or $HOME) may be placed inside the quotes as well - glob("$VIM/plugins/*.vim") works just fine.


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto Wiki
Doctor Who
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Mystery Science Theater 3000
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions
Send this article to a friend
"How to mimic the vim 6.0 plugin feature with older versions"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation