Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulating a cellular automata using VIM mappings?

Having nothing better to do, I've learned that if you open the following text on vim:

...............X..........................................
...............X..........................................
................XX........................................
..................XX......................................
....................XX....................................
......................XXX.................................
.........................XXX..............................
............................XX............................
..............................XX..........................
................................XX........................
..................................X.......................
...................................X......................
...................................X......................
...................................X......................
..................................X.......................
................................XX........................
..............................XX..........................
............................XX............................
.........................XXX..............................
......................XXX.................................
....................XX....................................
..................XX......................................
................XX........................................
...............X..........................................
...............X..........................................
...............X..........................................
................XX........................................
..................XX......................................
....................XX....................................
......................XXX.................................
.........................XXX..............................
............................XX............................
..............................XX..........................
................................XX........................
..................................X.......................
...................................X......................
...................................X......................
...................................X......................
..................................X.......................
................................XX........................
..............................XX..........................
............................XX............................
.........................XXX..............................
......................XXX.................................
....................XX....................................
..................XX......................................
................XX........................................
...............X..........................................

... set the following map:

:noremap t ddGpgg

... and hold the "t" key down, you'll watch a cool sine waving.

This, on other hand:

:noremap t ddGpMddGpgg

Will candy your eyes with a cool DNA-spinning animation. What other neat looking animations are possible with VIM mappings? Is it possible to simulate a cellular automaton?

like image 460
MaiaVictor Avatar asked Nov 02 '22 19:11

MaiaVictor


1 Answers

Linus Akesson's created some cool (somewhat related) things: http://www.linusakesson.net/programming/vim/

like image 100
pandubear Avatar answered Nov 09 '22 15:11

pandubear