Vim Tips Wiki
(Undo revision 37571 by 5.236.170.100 (talk) we keep comments section to encourage people to comment here rather than talk page)
m (Reverted edits by 202.62.16.98 (talk | block) to last version by 76.90.122.112)
(2 intermediate revisions by 2 users not shown)
Line 16: Line 16:
 
If you want to figure out how to do this yourself, simply read {{help|new-filetype}} and zipPlugin.vim in your runtime/plugins directory.
 
If you want to figure out how to do this yourself, simply read {{help|new-filetype}} and zipPlugin.vim in your runtime/plugins directory.
   
For the impatient, just place the following in a file named ~/.vim/ftdetect/jar.vim (if you're on Unix):
+
For impatient people, just place the following in a file named ~/.vim/ftdetect/jar.vim (if you're on Unix):
   
 
<pre>
 
<pre>

Revision as of 18:32, 17 April 2015

Tip 1259 Printable Monobook Previous Next

created 2006 · complexity basic · author emmby · version 7.0


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.

If you want to figure out how to do this yourself, simply read :help new-filetype and zipPlugin.vim in your runtime/plugins directory.

For impatient people, just place the following in a file named ~/.vim/ftdetect/jar.vim (if you're on Unix):

au BufRead,BufNewFile *.jar,*.war,*.ear,*.sar,*.rar set filetype=zip

If you Vim a jar file now, you'll be able to browse it.

Comments