Vim Tips Wiki
(Change to TipImported template + severe manual clean)
(Move categories to tip template)
Line 9: Line 9:
 
|version=5.7
 
|version=5.7
 
|rating=24/10
 
|rating=24/10
  +
|category1=
  +
|category2=
 
}}
 
}}
 
Perl has its JAPH Just Another Perl Hacker (a short script that produces the output 'Just another Perl hacker' (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:
 
Perl has its JAPH Just Another Perl Hacker (a short script that produces the output 'Just another Perl hacker' (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:

Revision as of 04:40, 25 April 2008

Tip 816 Printable Monobook Previous Next

created November 5, 2004 · complexity basic · author zzapper · version 5.7


Perl has its JAPH Just Another Perl Hacker (a short script that produces the output 'Just another Perl hacker' (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?"

Here are some others, from various sources.

:s(.*(rekcaH iV rehtonA tsuJ(|t.|s).$)&&)|-s'.'s,\\(.\\)\\(.\\)\\(\\2.*\\),\\2\\3\\1,|'g|s=[^|]*|$=s,.,,=|d a|@a
gvim -c "exec \"normal itYNQ#v'Z#ABG#GUR#BAYL#BAR\"|%s/#/ /g|normal ggVGg?ggVG~"

So what's the point:

  1. It attracts a few more people to Vim (I use it as a signature).
  2. It sharpens your Vim skills.
  3. It's fun.

This "tip" shows that you can do some pretty complex stuff with the Vim -c command.

vim -c "cmd1|cmd2|cmd3"
# Example: print paste contents to default printer
gvim -c 's/^/\=@*/|hardcopy!|q!'

Comments