(Adjust previous/next navigation + minor manual clean) |
JohnBeckett (talk | contribs) No edit summary Tag: sourceedit |
||
(11 intermediate revisions by 9 users not shown) | |||
Line 12: | Line 12: | ||
|category2= |
|category2= |
||
}} |
}} |
||
− | Jar files are |
+ | Jar files are 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, |
+ | If you want to figure out how to do this yourself, read {{help|new-filetype}} and zipPlugin.vim. The latter is a plugin distributed with Vim: in Vim, put the cursor on <code>$VIMRUNTIME/plugin/zipPlugin.vim</code> and type <code>gf</code>. |
− | |||
⚫ | |||
⚫ | |||
<pre> |
<pre> |
||
au BufRead,BufNewFile *.jar,*.war,*.ear,*.sar,*.rar set filetype=zip |
au BufRead,BufNewFile *.jar,*.war,*.ear,*.sar,*.rar set filetype=zip |
||
</pre> |
</pre> |
||
− | If you |
+ | If you open a jar file in Vim, you will be able to browse it. If that does not work, update to a recent version of Vim with zipPlugin installed. |
==Comments== |
==Comments== |
Revision as of 02:54, 14 November 2015
Tip 1259 Printable Monobook Previous Next
created 2006 · complexity basic · author emmby · version 7.0
Jar files are 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, read :help new-filetype and zipPlugin.vim. The latter is a plugin distributed with Vim: in Vim, put the cursor on $VIMRUNTIME/plugin/zipPlugin.vim
and type gf
.
For impatient people, just place the following in a file named ~/.vim/ftdetect/jar.vim
(on Unix systems) or $HOME/vimfiles/ftdetect/jar.vim
(on Windows systems):
au BufRead,BufNewFile *.jar,*.war,*.ear,*.sar,*.rar set filetype=zip
If you open a jar file in Vim, you will be able to browse it. If that does not work, update to a recent version of Vim with zipPlugin installed.