Sunday, November 30, 2014

Re: Why Atom Can’t Replace Vim -- Learning the lesson of vi

Kartik Singhal wrote:
> Folks here might have already seen this, but this told me the fundamental
> difference between vim and emacs architecture, and why there hasn't been
> any modern replacement for vim.

That strikes me as a curious statement. To me, vim is the modern
replacement for vi. Why whould I want a modern replacement for a
modern replacement?

Vim script? I've heard of it, but it does not enter my life. When
I want to "write an extension" to vim, I've got two tools: the built-in
"q" command to record a macro, and one of my favorite mappings:

" Make * yank the current line into register y, then run it
" Mnemonic: * marks a executible in "ls -F"
map * "yyy@y

With ":r!" as a prefix, the * mapping is how I show shell commands,
run them, and show output in mailing list and Usenet posts. In
source code, I include, prefixed with a comment or embedded in a
null-op, commands that I am prone to use at that point in the code.
For example, almost every INCLUDERC command in in my .procmailrc
file looks like this:

# The various news posting recipes
vihack='
:new $HOME/.procmailrc.mail2news
'
INCLUDERC=$HOME/.procmailrc.mail2news

When I want to delve into those include files, it is just a * away.
I find it very handy that ": " begins a null-op command in sh/bash/ksh
because in vi and vim, because it's handy.

Without further explanation, here are some actual comments I have that
I use with these two scripts:

http://www.panix.com/~eli/unicode/show.cgi
http://www.panix.com/~eli/unicode/convert.cgi

# turn show.cgi output into psuedo code
# :+,$ s/^ *[0-9][0-9]* *0*\([1-9a-fA-F][0-9a-fA-F]*\) *[^ ]* */ "a" => "\&#x\U\1;",\t# /
# comment out psuedo code lines that remap to space
# :g/"a" => " "/s,^ , #,
# delete empty lines
# :g/^ *$/d
# change "a" on 26 lines to capitals
# rAjrBjrCjrDjrEjrFjrGjrHjrIjrJjrKjrLjrMjrNjrOjrPjrQjrRjrSjrTjrUjrVjrWjrXjrYjrZ
# change "a" on 26 lines to lowercase
# rajrbjrcjrdjrejrfjrgjrhjrijrjjrkjrljrmjrnjrojrpjrqjrrjrsjrtjrujrvjrwjrxjryjrz
# duplicate lowercase conversions to uppercase
# :+,$s,^ "\([a-z]\)"\(.*\),&^V^M "\u\1"\2,

Elijah
------
has probably been using vim since the 2.0 days, certainly 3.0

--
--
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: