sponsor Vim development Vim logo Vim Book Ad

basic Tip #816: JAVH: Just another VIM Hacker

 tip karma   Rating 24/10, Viewed by 1029 

created:   November 5, 2004 16:38      complexity:   basic
author:   zzapper      as of Vim:   5.7

Perl has it's JAPH Just Another Perl Hacker (a short script that produces the output 'Just another Perl hacker' (Just Google for it)) I thought one day I'd try to something similar with VIM , the trick being to make it as obscure as possible:-

vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?"

Somebody (sorry I forget who, possibly Peppe) did this one

:s(.*(rekcaH iV rehtonA tsuJ(|t.|s).$)&&)|-s'.'s,\\(.\\)\\(.\\)\\(\\2.*\\),\\2\\3\\1,|'g|s=[^|]*|$=s,.,,=|d a|@a

Another voyager in cyberspace created the following

gvim -c "exec \"normal itYNQ#v'Z#ABG#GUR#BAYL#BAR\"|%s/#/ /g|normal ggVGg?ggVG~"

So what's the point:-
1) Well it attracts a few more people to VIM (I use it as a signature)
2) It sharpens your Vim skills,(they can never be sharp enough)
3) It's fun

So over to you! can you do any better!

 rate this tip  Life Changing Helpful Unfulfilling 

<<Getting vim to work with cvs commit | Non-blinking block cursor in the linux console >>

Additional Notes

Anonymous, November 8, 2004 6:08
What does the script do?

What is it good for?

Please make your message more exoteric.
[email protected], November 8, 2004 7:26
`Please make your message more exoteric.'

That's the spirit!

$ vim -u NONE +let\ @o=ƆfJX\ ~PFJX0\$2hP0@Oy00'\|0put='csatH\ \ AmnioVt\ hreUeJKr'\|norm!+d_@O <br> <br>The above should all be on one line. If it wraps after a <br>backslash, it's because there was a space there.</tt></td> </tr> <tr> <td class="lightbg"> [email protected], <font size='-1'> November 8, 2004 7:36 </font> </td> </tr> <tr> <td><tt>Blecch. It didn't like backslashes followed single-quotes. <br>The first characters after @o= should be <br>a backslash followed by a single-quote. All the other <br>single-quotes should be preceded by a backslash.</tt></td> </tr> <tr> <td class="lightbg"> [email protected], <font size='-1'> November 8, 2004 7:37 </font> </td> </tr> <tr> <td><tt>Blecch. It didn't like backslashes followed single-quotes. <br>The first characters after @o= should be a backslash <br>followed by a single-quote, then 0fJ etc. All the other <br>single-quotes should be preceded by a backslash.</tt></td> </tr> <tr> <td class="lightbg"> Perci Merci, <font size='-1'> November 8, 2004 17:39 </font> </td> </tr> <tr> <td><tt>Nice, useful to show off to vim hackers, <br>but a newcomer will be turned off by Vim by such complexity.</tt></td> </tr> <tr> <td class="lightbg"> [email protected], <font size='-1'> November 9, 2004 4:43 </font> </td> </tr> <tr> <td><tt>I was turned on to vim by such complexity (flexibility).</tt></td> </tr> <tr> <td class="lightbg"> <b>Anonymous</b>, <font size='-1'> November 9, 2004 6:17 </font> </td> </tr> <tr> <td><tt>I like this idea and thought I'd highlight the line to make this even cooler. <br>So I tried something like this <br>    $vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?|exe 'mat Error /\%'.line(".").'l.*'" <br>but didn't work. <br> <br>When I do this first, <br>    $vim -c ":%s%s*%Cyrnfr)fcbafbe[Oenz(Zbbyranne%|:%s)[[()])-)Ig|norm Vg?" <br>and then execute <br>    :exe 'mat Error /\%'.line(".").'l.*' <br>inside vim, it highlights as I expected. <br> <br>Can anyone tell me why? <br></tt></td> </tr> <tr> <td class="lightbg"> zzapper, <font size='-1'> November 10, 2004 22:30 </font> </td> </tr> <tr> <td><tt>This "tip" hightlights that you can do some pretty complex stuff with the vim -c command <br>vim -c "cmd1|cmd2|cmd3" <br>eg <br># print paste contents to default printer <br>gvim -c 's/^/\=@*/|hardcopy!|q!' <br> <br>But here as a bit of light-relief Vim's Easter Eggs <br> <br>:h 42 <br>:h holy-grail <br>:h!</tt></td> </tr> <tr> <td> <input type="submit" name="Add Note" value="Add Note"> </td> </tr> </table> </form> <!-- finish off the framework --> </td> </tr> </table> </td> </tr> </table> <!-- END OF THE PAGE BODY: BETWEEN HEADER AND FOOTER --> <table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="red"> <tr><td colspan="4"><img src="/images/spacer.gif" width="1" height="5" alt=""></td></tr> <tr><td colspan="4" bgcolor="#000000"><img src="/images/spacer.gif" height="2" width="1" alt=""></td></tr> <tr><td colspan="4"><img src="/images/spacer.gif" width="1" height="5" alt=""></td></tr> <tr> <td><img src="/images/spacer.gif" width="5" height="1" alt=""></td> <td align="left" valign="top"><small> If you have questions or remarks about this site, visit the <a href="http://vimonline.sf.net">vimonline development</a> pages. Please use this site responsibly. <br> Questions about <a href="https://www.vim8.org/about.php">Vim</a> should go to [email protected] after searching <a href="http://groups.yahoo.com/group/vim">the archive</a>. Help Bram <a href="http://iccf-holland.org/">help Uganda</a>. </small> </td> <td align="right" valign="top"> <a href="http://www.webconceptgroup.net"><img src="/images/logo_sponsor_wcg.jpg" width="131" height="30" border="0" alt="Sponsored by Web Concept Group Inc."></a> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=8&type=1" width="88" height="31" border="0" alt="SourceForge Logo"></a> </td> <td><img src="/images/spacer.gif" width="5" height="1" alt=""></td> </tr> <tr><td colspan="4"><img src="/images/spacer.gif" width="1" height="5" alt=""></td> </tr> </table> </body> </html>