How to source one ftplugin from another
November 08, 2012
I recently read an article about using Vim for writing prose. A lot of the tips there are really cool, but I don’t want or need them for all the types of files I write in. I do, however, use TeX and Markdown frequently, and who knows if I’d ever want another file type. So I didn’t want to create separate ftplugin files for each with duplicated content. Plus, duplication is always bad.
So I figured out how to reference one
ftplugin file from another. I created
prose.vim with all the stuff I wanted to use in my writing files (e.g.,
.markdown). I put that one in the
Then I created
tex.vim and added the following line to
both of them. This made all the difference
With that, I load my prose.vim file any time I use markdown or tex files. And
any time I want to change the way those act, I can just make changes in one
Hope that helps somebody.
I'm Ryan Schuetzler, a husband and father, professor at the University of Nebraska at Omaha, and professional nerd. You can follow me on twitter, but there's not much there.