Monday, April 24, 2017

an old "hack" of mine, shared for amusement

I found this today, while looking for abandoned swap files on my
computer. The file was dated 2006, but the swap file is for vim 4.2,
and the hostname is one I last used ~ 1998. I guess I copied the
file, and the swap file, from a backup or something in 2006.

$ ls -l my-src/hacks/vi/fork my-src/hacks/vi/fork.swp
-rw-r--r-- 1 elijah users 58 Jun 6 2006 my-src/hacks/vi/fork
-rw-r--r-- 1 elijah users 24576 Jun 6 2006 my-src/hacks/vi/fork.swp
$ cat my-src/hacks/vi/fork
vi: set noml | w! | ! vim % :
vi: e! % | w! | q :

foobar
$

I don't remember writing that, but I can fully believe I did. (There's
other stuff there, I'm sure I have written.

What this does is left as an exercise for the reader.

I suspect I tested it on Solaris vi of that era. Testing in Solaris vi
(Version SVR4.0, Solaris 2.5.0) today[*], I need to hit <esc> to
unstick-it at a certain point, and I think the second line would be
better as just:

vi: q :

Elijah
------
[*] only has one, rather old, Solaris system left to test with

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment