Vim Tips Wiki
(Change to TipImported template + severe manual clean)
(changed for the impatient to for impatient people.)
Tags: Visual edit rollback
(8 intermediate revisions by 5 users not shown)
Line 2: Line 2:
 
{{TipImported
 
{{TipImported
 
|id=1259
 
|id=1259
|previous=1257
+
|previous=1251
 
|next=1260
 
|next=1260
|created=June 15, 2006
+
|created=2006
 
|complexity=basic
 
|complexity=basic
 
|author=emmby
 
|author=emmby
 
|version=7.0
 
|version=7.0
 
|rating=32/16
 
|rating=32/16
  +
|category1=
  +
|category2=
 
}}
 
}}
 
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.
 
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.
Line 14: 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>
au BufReadCmd *.jar,*.war,*.ear,*.sar,*.rar call zip#Browse(expand("&lt;amatch&gt;"))
+
au BufRead,BufNewFile *.jar,*.war,*.ear,*.sar,*.rar set filetype=zip
 
</pre>
 
</pre>
   
Line 23: Line 25:
   
 
==Comments==
 
==Comments==
 
----
 

Revision as of 21:30, 7 June 2014

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