john13@garfield.UUCP (John Russell) (12/26/87)
Speaking of making every editor under the sun a vi clone, here are sets of macros that make DME look a lot like vi. Actually I find DME much better, but some people find it hard to adjust :-). Note that I haven't attempted to emulate all possible commands, just the ones I use a lot. Some two-letter combinations like 'ZZ' I had to abbreviate so read over these files before you install them. The block operations are done very skimpily (probably better to have them move temporary ram files around, or open up new windows for yank/cut buffers), since I normally use DME's instead. I couldn't find an easy reliable way to map ':' to escape (try doing it then reading a file from df0:), although I guess you could use two different files and remap it as I do the <esc> key. And $scanf seems to have made it impossible to remap '$' to anything. One nice feature is that you can define macros in terms of other macros, so expressions like 'repeat 10 k' are legal (and actually implemented as '10 k'). Feel free to add your own, especially block operations if you use this a lot. Remember, keys like <esc> and 'i' just switch modes, you can kill vi mode with ca-v. John PS While using these it struck me that in vi I _always_ know if I'm in insert mode or not, while in DME I could never remember :-(. -- Add these to s:.edrc -- map cs-v `source ram:vi.on' map ca-v `source ram:vi.off' -- Ram:vi.on -- map j down map k up map h left map l right map ^ firstnb map i `ca-v map esc cs-v' map o `downadd insline k ^ j i' map O `insline j ^ k i' map G bottom map Z `saveold' map ! `escimm `execute '' map w wright map b wleft map c-z iconify map c-b pagedown map c-f pageup map p `down bmove' map P bmove map m block map d bdelete map y bcopy map r `del esc' map / `escimm `find '' map n next map N prev map J join map x del map q `ifelse m `escimm `saveold quit'' `quit'' map esc esc map s-esc esc map + return map - `first up' map A `last i' map D remeol map return `first down' map I `^ i' map 1 `escimm `repeat 1'' map 2 `escimm `repeat 2'' map 3 `escimm `repeat 3'' map 4 `escimm `repeat 4'' map 5 `escimm `repeat 5'' map 6 `escimm `repeat 6'' map 7 `escimm `repeat 7'' map 8 `escimm `repeat 8'' map 9 `escimm `repeat 9'' -- Ram:vi.off -- unmap j unmap k unmap h unmap l unmap ^ unmap o unmap O unmap G unmap Z unmap w unmap b unmap c-z map c-b block unmap c-f unmap p unmap P unmap m unmap d unmap y unmap r unmap / unmap n unmap N unmap J unmap q unmap i unmap x unmap + unmap - unmap A unmap D map return `firstnb down insline' unmap I unmap ! unmap 1 unmap 2 unmap 3 unmap 4 unmap 5 unmap 6 unmap 7 unmap 8 unmap 9 -- To preserve deniability, I have not informed the University of this posting. But if I had, they would have been 100% behind it, yessirree bob. This posting has statements that are evasive, misleading, and just plain wrong. But that is only because I love the UseNet with all my heart!