hanoi.vim

来自「MSYS在windows下模拟了一个类unix的终端」· VIM 代码 · 共 65 行

VIM
65
字号
set remapset noterseset wrapscan" to set the height of the tower, change the digit in the following" two lines to the height you want (select from 1 to 9)map t 7map! t 7map L 1G/t
X/^0
$P1GJ$An$BGC0e$X0E0F$X/T
@f
@h
$A1GJ@f0l$Xn$PUmap g ILmap J /^0[^t]*$
map X xmap P pmap U Lmap A "fylmap B "hylmap C "fpmap e "fy2lmap E "hpmap F "hy2l" initialisations:" KM	cleanup buffer" Y	create tower of desired height" NOQ	copy it and inster a T" NO	copy this one" S	change last char into a $" R	change last char in previous line into a n" T	insert two lines containing a zero" V	add a last line containing a backslashmap I KMYNOQNOSkRTV"create empty linemap K 1Go"delete to end of filemap M dG"yank one linemap N yy"putmap O p"delete more than height-of-tower charactersmap q tllD"create a tower of desired heightmap Y o0123456789Z0q"insert a T in column 1map Q 0iT"substitute last character with a nmap R $rn"substitute last character with a $map S $r$"insert two lines containing a zeromap T ko0
0

"add a backslash at the endmap V Go/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?