Vim Tetris

I don't know if some programmers here like to use the Vim editor, but if you do you might find this interesting, if you don't already know about it. It's been initially released in 2002, after all. Yeah, there's Tetris included in emacs, ... this is a thread about vim tetris. I've picked up the code that was sitting on vim.org and tried to make it closer to real tetris to the best of my abilities. I'm not familiar at all with vimscript, but if you want to participate to this project or if you have any suggestions, please let me know! Also let me know if you have any issues running the game.

The game supports sonic drops (and you can quickly move after it too), pausing, and speeds up. The randomizer could be better, though. Still, quite a feat for a text editor!

Controls (they're weird because the initial goal of this version was to teach how to control vim with h.j.k.l keys):
h: left
l: right
j: down
i,k: rotate
<Space>: drop
<Esc> or q: quit

Alright, so I took the time to look at the code. See updated version below. I adapted the controls to be similar to Texmaster:
z,c is left, right
x is soft drop
s is sonic drop
n, m and ',' are CCW, CW and CCW respectively. (I didn't use m ',' '.' because the dot could not appear in the on-screen instructions for some reason)

I you really want to have m ',' '.', just like in Texmaster, replace lines 234-237 with this:

Cool. Can you help out a vim noob and explain exactly how to run this?
I looked at vim.org's page and didn't really understand the instructions..

Click to expand...

Sure!
First of all, download the file from vim.org (or create a file called TeTrIs.vim with the code content from the post I made just above yours) and place it in your directory in ~/.vim/plugin
(If the .vim and .vim/plugin folders don't exist, simply make them using mkdir)

Once that is done, open vim by doing 'vim' in your terminal. You must source the game so that vim knows about its existence, by doing in vim
:source ~/.vim/plugin/TeTrIs.vim
(make sure you don't forget the colon)

By then, the game will be installed in vim's memory. To start it, press the following keys in order: \te
The game will start, asking you your name for high scores and the mode you want to play (select traditional, because rotating does not work). For the rest, the instructions from my post above or on vim.org should be clear enough.