Easily add/remove Vim scripts 12

Posted by ryan Tue, 20 Jul 2010 01:39:00 GMT

I like being able to easily add and remove Vim scripts, whether it's to try one out or easily upgrade to a newer version down the line. Since the directory structure of a script almost always follows the standard runtime directory structure, I simply wrote a script that adds each directory under $HOME/.vim/vendor to Vim's runtimepath, so that Vim includes the vendor directories in its script-searching behavior. That way, I can simply download something like rails.vim, which has files in autoload, doc, and plugin, and would be very annoying to remove manually, uncompress it into its own directory under $HOME/.vim/vendor, restart Vim, and the script is loaded. Removing the script is as easy as removing the directory under vendor and restarting Vim.

To add this behavior, simply put the following in your $HOME/.vimrc file:

let vendorpaths = globpath("$HOME/.vim", "vendor/*")

let vendorruntimepaths = substitute(vendorpaths, "\n", ",", "g")
set runtimepath^=vendorruntimepaths

let vendorpathslist = split(vendorpaths, "\n")
for vendorpath in vendorpathslist
  if isdirectory(vendorpath."/doc")
    execute "helptags ".vendorpath."/doc"
  endif
endfor

For the latest and greatest version of this code, refer to my vimrc.

  1. Exchange 2 months later:

    Very well written. You got every point explained. Loved the whole article! Many thanks!

  2. Currency 3 months later:

    This way of add and remove Vim scripts is pretty cool and will save a lot of my time.Thanks : )

  3. darmowe krzyzowki 9 months later:

    Great blog post, I have been waiting for that

  4. darmowe pozycjonowanie 9 months later:

    This is the greatest topic I have read today

  5. linux 9 months later:

    Thanks for this great post. Did you do it all on your own? This must've taken a lot of time

  6. susan about 1 year later:

    Very Cheap Pro Cycling Online Shop www.bike-jersey.net for Cycling Jerseys.They have great quality and very cheap price ,also could offer the great service and fast shipping!!!

  7. online pokies over 2 years later:

    it should be very interesting book. I would read it.

  8. http://www.tigersasicsausbuy.com/ almost 3 years later:
  9. Samsung Galaxy S4 cheapest price almost 3 years later:

    The samsung galaxy S4 is a Smartphone which was manufactured by Samsung Electronics. It was first announced in the New York city and this phone is a descendant to the Samsung galaxy III. Galaxy S4 is designed with various new features such as smart stay, smart scroll, smart alerts, 13 megapixel camera and 1080p display. It uses Google’s Android mobile operating system. The Samsung software applications are usually named with the letter ‘S’ followed by the function, for example the fitness related application is called as S Health and the voice assistant is called S voice. The Samsung Galaxy S4 supports high efficiency video coding. The camera software of galaxy S4 is designed with excellent features such as drama shot, sports Modes, beauty face, 360 photos, sound and shot, cinema photo, night, Eraser, best face, dual shot, best photo, dual recording, high dynamic range, dual video call, etc.

    Samsung Galaxy S4 cheapest price

  10. Asics Onitsuka Tiger almost 3 years later:
  11. phen375 almost 3 years later:

    Yet they can be basically devised for ending have excess fat and diet pill they charge you will want to be able to be" 130 excess fat from the minute you are making careful analysis make home conversation. phen375Your capsule might minimize lower throughout the pace connected with digestion of food, stopping versus works with boosting ones own metabolic process. Are you currently wondering whether weight loss of the sugar loaded beverages you are fond of. There is a lot of varieties of weight reduction dietary supplements available to buy that several different conisderations to your system together leeway for going out to social functions or just treating yourself to something that you desire. Investigate the training video beneath to view, tips on how toOnly consider, once you select buy phen375 cheapyou may choose to realize your own burner as well as urge for food suppressant. Looking for much more facts regarding it , go to my very together with long-lasting benefits by studying through to reviews plus verifying their sites. Don't you on a regular basis look at diets along with fall will require a correct schooling method.

  12. Andrenum about 3 years later:

    business enterprise start up loans: script your have success story to get these financial products fast, you can go for online type. there are many lenders having her or his websites on the online market place. you effortlessly choose the economical institution of your final choice and then, you are required to fill up an online application form providing vital information such equally name, age, employment, income, residence, communicate with number and thus , on after answering the form request it online to the lender. the lender could very well verify the ideas provided by an and then the will approve mortgage. the news provided by you will be kept special. the loan many will be deposited to your description within 24 days. online forms are easily available regarding market..prolonged time back, financial vendors provided short term loans welwyn garden metro area to almost anybody with little to no regard for her history, payment record or existing accounting circumstance. absence of care showed by banks this united states caused many problems to result in a large involving people defaulting on their installment loans. this, in turn, provided to this financial problems. therefore, financial providers have since tightened the minimal expects for loans, this much more complicated for individual to access the money they phone. most financial institutions now need people to have a good credit record, can easily give confirmation in regards to how they can repay the loan, and can achieve an expanded level of time for approvals..http://clever100dayloans.com/ - 100 day loans.from 2009, total imports amounted to $253.9 billion, down inside the 2008 figure involved with $322.3 billion. india ranked fifteenth in the overall world in terms of import volume..acquiring fixed assets; sale proceeds of pre-programmed assets; dividends; repayment of long term debts and debentures and repayment of preference share capital..involving secured category, the type of borrower's valuable help acts as a main target. the particular borrower pledges a tool that can have access to a larger amount choose building, land, house. by placing collateral, a borrower might avail the amount varying from smallest amount 10 000 on to maximum 75 000 with easy repayment period of 5- 25 years or so. this option ideal for suited for residence or people who have capacity to choose valuable property up against the amount..a person can apply when it comes to bank loans uae by submitting details online. bank relationship business manager will approach you can with different cash loan plans. when want to you can check uae banks on the inside person you can take the cell number from an individual's websites and repair up a joining with their adviser. loans in dubai have never has been so easy..http://valuepaydayadvance.com/ - online payday advance lenders.small cash advance is also called payday advance, as a person in debt is required to get rid of the loan number with his upcoming paycheck. you should use the availed fund for several uses such as reducing the old expenses of the lenders, purchasing new electronics item, repairing the old motorbike and so on. you should pay back this fund when your loan duration ends. not repaying the advance period will cost you more in regards to higher interest rankings or penalty charge. the quick cash advance uses high interest ratio. online search will help users in finding out latest advance deals, available with excellent interest rates..these kinds of above facilities establish these loans highly popular among some salaried people. so, take the help these loans to solve emergency monetary conditions effectively without opposite any apprehension.