.comment-link {margin-left:.6em;} <$BlogRSDURL$>

Thursday, June 15, 2006

Vim 7.0 - Edit jar files from within vim 

Cross-posted to: http://www.vim.org/tips/tip.php?tip_id=1259

Jar files are really just zip files, and you can browse them from within vim simply by treating them the same as vim treats zip files (note to the vim maintainers: can we add these to the default distribution?)

If you want to figure out how to do this yourself, simply read this section of the help docs: http://vimdoc.sourceforge.net/htmldoc/filetype.html#new-filetype and read zipPlugin.vim in your runtime/plugins directory.

For those who are impatient, the skinny version is to place the following text into a file named ~/.vim/ftdetect/jar.vim (if you're on unix):

######################## FILE START #####################
au BufReadCmd *.jar,*.war,*.ear,*.sar,*.rar call zip#Browse(expand(""))
######################## FILE END #####################
That's it! If you vim a jar file now, you'll be able to browse it.

Comments: Post a Comment


This page is powered by Blogger. Isn't yours?