public
Description: Translate vim commands into human-readable texts
Homepage: http://www.dira.ro/blog/2009/05/vimmish-vim-translator/
Clone URL: git://github.com/dira/vimmish.git
name age message
file .gitignore Fri Mar 27 11:44:34 -0700 2009 initial commit - started restructuring [dira]
file README.textile Tue Apr 21 12:35:41 -0700 2009 minor: readme format [dira]
file Rakefile Tue Apr 21 12:28:02 -0700 2009 output test results to a file [dira]
file example.rb Mon Apr 20 04:54:58 -0700 2009 separated printing & parser [dira]
directory lib/ Mon Apr 20 04:54:58 -0700 2009 separated printing & parser [dira]
directory test/ Sun Apr 19 11:47:19 -0700 2009 added ; and refactoring [dira]
file test_results.txt Tue Apr 21 12:28:02 -0700 2009 output test results to a file [dira]
README.textile

Speak vimmish?

vimmish translates a “vim input stream” to human-readable text:

From

iDon't know vim :(.<ESC>^2WBc2wbetter now<ESC><RIGHT>Da.<ESC>II can understan<ESC><RIGHT>~dE

To


                   i => insert before cursor: 
  Don't know vim :(. => type Don't know vim :(.
               <ESC> => go to normal mode
                   ^ => move to the begining of the line (not blank character)
                  2W => move to the begining of the next space-separated word, 2 times
                   B => move backwards one space-separated-word
                 c2w => change to the begining of the next word, 2 times
          better now => type better now
               <ESC> => go to normal mode
             <RIGHT> => move one character to the right
                   D => delete the rest of the current line
                   a => append after cursor: 
                   . => type .
               <ESC> => go to normal mode
                   I => insert to the begining of the current line: 
     I can understan => type I can understan
               <ESC> => go to normal mode
             <RIGHT> => move one character to the right
                   ~ => change character case
                  dE => delete to the end of the next space-separated-word

Usage


vimtalk = "iDon't know vim :(. Yet :)<ESC>"
humanized = Vimmish.humanize(vimmish)

pp humanized
pp VimmishFormatters.pretty(humanized)

Status

It parses frequently used motions and commands for normal mode / insert mode / visual mode (combined with motions).
Check the test results