Start anew
[msysgit.git] / share / vim / vim58 / macros / hanoi / hanoi.vim
blob834d6f2c4bed7c0555ac1c027b47e79a4fe0c583
1 set remap
2 set noterse
3 set wrapscan
4 " to set the height of the tower, change the digit in the following
5 " two lines to the height you want (select from 1 to 9)
6 map t 7
7 map! t 7
8 map L 1G/t\rX/^0\r$P1GJ$An$BGC0e$X0E0F$X/T\r@f\r@h\r$A1GJ@f0l$Xn$PU
9 map g IL
11 map J /^0[^t]*$\r
12 map X x
13 map P p
14 map U L
15 map A "fyl
16 map B "hyl
17 map C "fp
18 map e "fy2l
19 map E "hp
20 map F "hy2l
22 " initialisations:
23 " KM    cleanup buffer
24 " Y     create tower of desired height
25 " NOQ   copy it and inster a T
26 " NO    copy this one
27 " S     change last char into a $
28 " R     change last char in previous line into a n
29 " T     insert two lines containing a zero
30 " V     add a last line containing a backslash
31 map I KMYNOQNOSkRTV
33 "create empty line
34 map K 1Go\e
36 "delete to end of file
37 map M dG
39 "yank one line
40 map N yy
42 "put
43 map O p
45 "delete more than height-of-tower characters
46 map q tllD
48 "create a tower of desired height
49 map Y o0123456789Z\e0q
51 "insert a T in column 1
52 map Q 0iT\e
54 "substitute last character with a n
55 map R $rn
57 "substitute last character with a $
58 map S $r$
60 "insert two lines containing a zero
61 map T ko0\r0\r\r\e
63 "add a backslash at the end
64 map V Go/\e