[TUHS] diving into vi (nvi) - some observations from a slow learner
Will Senn
will.senn at gmail.com
Sat Jun 8 02:20:35 AEST 2024
Thanks for the tips, Ralph. I definitely learned the 6, but put 'em on a
card with searching. Here's my motion card, including the scrolling
commands, mark movement and a couple odd balls, to see how my mind works
:) :
https://decuser.github.io/assets/img/vi/motions-notecard.jpg
On another note, I was reminded in an offline discussion that QED was
the predecessor to ed - my history of tech always seems to glitch at the
genesis of Unix. Of course the Unix pioneers didn't say "Let there be
Unix and so mote it be" even though it may seems so to some of us. A lot
of intellectual blood, sweat, and tears went into what came before and
Ken Thompson definitely stood on the shoulders of Lampson, Deutsch,
Kleene and others to create his masterpiece.
Ritchie's partial history of QED
https://www.bell-labs.com/usr/dmr/www/qed.html
Deutsch & Lampson's work
https://dl.acm.org/doi/pdf/10.1145/363848.363863
Thompson's innovation
https://dl.acm.org/doi/pdf/10.1145/363347.363387
Kleene's indirect contribution (Automata<->Regular Expression)
https://www.logicmatters.net/tyl/booknotes/kleene-metamath/
Later,
Will
On 6/7/24 10:41 AM, Ralph Corderoy wrote:
> Hi Will,
>
>> But, I think I'll stick with nvi a while until I really nail it down.
> Something I used to do was to look at each key on the keyboard and think
> what it would do, e.g. d, D, and ^D. Most do at least one thing.
>
>> Leftward motions - [[, {, (, 0, ^|_, B, b, h|^H
>> Rightward Movement - l|SP, e, E, w, W, $, ), }, ]]
> You're missing these handy six: f F t T ; ,
>
>> Upward motions - 1G, ^B, H, ^U, -, k | ^P
>> Downward motions - G, ^F, L, ^D, ^M | +, j | ^J | ^N
> There's also keeping the cursor on the same line but moving the window
> over the text: z ^E ^Y
>
>> Off to figure out tags
> Understand the format of the tags file first; built by ctags(1).
> ^] on a word looks it up and goes there.
> Where you were is pushed on to the ‘tagstack’.
> When you wish to exit that rabbit hole, ^T pops the top of the stack and
> goes there which returns you to where you pressed ^].
>
> $ func='foo bar xyzzy'
> $ printf "%s: $func"'\n' $func >src
> $ cat src
> foo: foo bar xyzzy
> bar: foo bar xyzzy
> xyzzy: foo bar xyzzy
> $ grep -n '[^:]*' src | awk -F: '{print $2 "\tsrc\t" $1}' >tags
> $ sed -n l tags
> foo\tsrc\t1$
> bar\tsrc\t2$
> xyzzy\tsrc\t3$
> $
>
> vi src, move to a word, ^] and it will move you to the ‘definition’
> line. Imagine each line is a function definition with calls to other
> functions. You're wandering down and up a ‘call tree’, following
> possible execution paths.
>
More information about the TUHS
mailing list