<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,25 +1,66 @@
 class Motion &lt; Treetop::Runtime::SyntaxNode
   def eval (mode = nil)
-    r = eval_simple(motion)
-    mode_part = {
-      nil =&gt; 'move ',
-      :command =&gt; '',
-      :selection =&gt; 'select ',
-    }[mode]
-    [[text_value, &quot;#{mode_part}#{r}&quot;]]
+    @text = motion.text_value
+    @translation = Motion.translation(@text)
+
+    @name = get_name(@translation)
+    begin
+      @how_many_times = quantity.text_value
+    rescue
+      @how_many_times = nil
+    end
+
+    result = apply_quantity
+    result = apply_mode(result, text_value, mode)
+ end
+
+private
+  def pluralize(what, how_many)
+    return what + (how_many != 1 ? 's' : '')
+  end
+
+  def apply_quantity
+    if (@how_many_times.nil? || @how_many_times.empty?)
+      return @name;
+    end
+    if (@how_many_times.to_i != 0)
+      quantity_value = @how_many_times.to_i
+      if (@text == '^')
+        q = '' #ignore count
+      elsif (@text == '$')
+        # special count
+        q = &quot; that is #{quantity_value - 1} lines below&quot; if quantity_value &gt; 1
+      else
+        q = &quot;, #{@how_many_times} #{pluralize('time', @how_many_times)}&quot; if quantity_value &gt; 1
+      end
+      return &quot;#{@name}#{q}&quot;
+    else 
+      quantity_value = {
+        'a' =&gt; 'a', 
+        'i' =&gt; 'inner'
+      }[@how_many_times]
+      return &quot;#{quantity_value} #{@translation[1][:special_count]}&quot;
+    end
+  end
+
+  def get_name(translation)
+    translation &amp;&amp; (translation.respond_to? :flatten) ? translation[0] : translation
   end
-  
-  def motion_name(motion)
-    names = {
-      'w' =&gt; ['to the begining of the next word', 'word'],
-      'W' =&gt; ['to the begining of the next space-separated word', 'word'],
-      'b' =&gt; ['to the begining of the previous word', 'word'],
-      'B' =&gt; ['backwards one space-separated-word', 'word'],
-      'e' =&gt; ['to the end of the next word', 'word'],
-      'E' =&gt; ['to the end of the next space-separated-word', 'word'],
-      'ge' =&gt; ['to the end of the previous word', 'word'],
-      'gE' =&gt; ['to the end of the previous space-separated-word', 'word'],
 
+  def self.translation(motion_text)
+    word_motions_translations = {
+      'w'  =&gt; ['to the begining of the next word'],
+      'W'  =&gt; ['to the begining of the next space-separated word'],
+      'b'  =&gt; ['to the begining of the previous word'],
+      'B'  =&gt; ['backwards one space-separated-word'],
+      'e'  =&gt; ['to the end of the next word'],
+      'E'  =&gt; ['to the end of the next space-separated-word'],
+      'ge' =&gt; ['to the end of the previous word'],
+      'gE' =&gt; ['to the end of the previous space-separated-word'],
+    }
+    word_motions_translations.each_pair{|key, motion| motion[1] = { :special_count =&gt; &quot;word&quot; }}
+  
+    translations = {
       '0' =&gt; 'to the begining of the line',
       '^' =&gt; 'to the begining of the line (not blank character)',
       '$' =&gt; 'to the end of the line',
@@ -38,45 +79,27 @@ class Motion &lt; Treetop::Runtime::SyntaxNode
       
       'l' =&gt; 'one character to the right',
       '&lt;RIGHT&gt;' =&gt; 'one character to the right',
+
+      ';' =&gt; ['repeat last character find', {:modes =&gt; { nil =&gt; '' }}],
     }
-    return names[motion]
+    translations = translations.merge(word_motions_translations)
+    translations[motion_text]
   end
-     
-  # TODO move to a special class
-  def eval_simple(motion)
-    text = motion.text_value
-    motion_name = motion_name(text)
-    motion_name = motion_name[0] if motion_name.respond_to? :flatten
-    begin
-      quantity_text = quantity.text_value
-    rescue
-      nil
-    end
 
-    result = motion_name
-    if (quantity_text.nil? || quantity_text.empty?)
-      return result
-    end
-      
-    if (quantity_text.to_i != 0)
-      quantity_value = quantity_text.to_i
-      if (text == '^')
-        q = '' #ignore count
-      elsif (text == '$')
-        # special count
-        q = &quot; that is #{quantity_value - 1} lines below&quot; if quantity_value &gt; 1
-      else
-        q = &quot;, #{quantity_text} #{pluralize('time', quantity_text)}&quot; if quantity_value &gt; 1
-      end
-      &quot;#{motion_name}#{q}&quot;
-    else 
-      quantity_value = {'a' =&gt; 'a', 'i' =&gt; 'inner'}[quantity_text]
-      &quot;#{quantity_value} #{motion_name(text)[1]}&quot;
-    end
- end
+  def apply_mode(result, text, mode)
+    modes = {
+      nil =&gt; 'move ',
+      :command =&gt; '',
+      :selection =&gt; 'select ',
+    }.merge(get_mode(@translation))
+    [[text, &quot;#{modes[mode]}#{result}&quot;]]
+  end
 
-private
-  def pluralize(what, how_many)
-    return what + (how_many != 1 ? 's' : '')
+  def get_mode(translation) 
+    if (translation.respond_to? :flatten) &amp;&amp; translation[1] &amp;&amp; translation[1][:modes]
+      translation[1][:modes]
+    else
+      {}
+    end
   end
 end</diff>
      <filename>lib/grammar/motion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,9 @@ class ParametricMotion &lt; Treetop::Runtime::SyntaxNode
     names = {
       'f' =&gt; 'move on the next #{character}',
       'F' =&gt; 'move on the previous #{character}',
-      't' =&gt; 'move to the next #{character}',
-      'T' =&gt; 'move to the previous #{character}',
+      't' =&gt; 'move before the next #{character}',
+      'T' =&gt; 'move before the previous #{character}',
+      ';' =&gt; 'repeat the last character find',
     }
     return names[motion]
   end</diff>
      <filename>lib/grammar/parametric_motion.rb</filename>
    </modified>
    <modified>
      <diff>@@ -171,6 +171,7 @@ grammar Vim
       quantity:motion_counter?
       motion:(
         'h' / '&lt;LEFT&gt;' / 'j' / '&lt;DOWN&gt;' / 'k' / '&lt;UP&gt;' / 'l' / '&lt;RIGHT&gt;' /
+        ';' /
         [wWbeBE] / 'g' [eE] / 
         [$^] /
         '('</diff>
      <filename>lib/grammar/vim.treetop</filename>
    </modified>
    <modified>
      <diff>@@ -22,17 +22,19 @@ describe 'motions' do
     include Assertions
     {
       'fy' =&gt; 'move on the next y',
-      '2fy' =&gt; 'move on the next y, 2 times',
       'Fy' =&gt; 'move on the previous y',
-      '2Fy' =&gt; 'move on the previous y, 2 times',
-      'ty' =&gt; 'move to the next y',
-      '2ty' =&gt; 'move to the next y, 2 times',
-      'Ty' =&gt; 'move to the previous y',
-      '2Ty' =&gt; 'move to the previous y, 2 times',
+      'ty' =&gt; 'move before the next y',
+      'Ty' =&gt; 'move before the previous y',
+      ';' =&gt; 'repeat last character find',
     }.each_pair do |vim, result|
       it &quot;should parse #{vim} and translate correctly&quot; do
         vim.should parse_to(parser, [[vim, result]])
       end
+      
+      it &quot;should parse 2#{vim} and translate correctly&quot; do
+        vim = &quot;2#{vim}&quot;
+        vim.should parse_to(parser, [[vim, &quot;#{result}, 2 times&quot;]])
+      end
     end
   end
 
@@ -97,11 +99,11 @@ describe 'motions' do
       '3G' =&gt; 'move to line 3',
       'gg' =&gt; 'move to first line (beginning of file)',
       '15gg' =&gt; 'move to line 15',
-      # TODO %90 = 90%
-      # TODO H - home, M - middle, L - last
-      # CTRL+U scroll down 50%, CTRL+D scroll up 50%,
-      # CTRL+E scroll up 1 line, CTRL+Y scroll down 1 line,
-      # CTRL+F scroll forward screen, CTRL+B scroll backword screen
+      #TODO %90 = 90%
+      #TODO H - home, M - middle, L - last
+      #CTRL+U scroll down 50%, CTRL+D scroll up 50%,
+      #CTRL+E scroll up 1 line, CTRL+Y scroll down 1 line,
+      #CTRL+F scroll forward screen, CTRL+B scroll backword screen
     }.each_pair do |vim, result|
       it &quot;should parse #{vim} and translate correctly&quot; do
         vim.should parse_to(parser, [[vim, result]])</diff>
      <filename>test/motions_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>45185e5134dd72895eb228ebe38230a30867bb4e</id>
    </parent>
  </parents>
  <author>
    <name>Irina Dumitrascu</name>
    <email>irina2000d@yahoo.com</email>
  </author>
  <url>http://github.com/dira/vimmish/commit/bf15b579abf63ea58569a879747feed7bda0d972</url>
  <id>bf15b579abf63ea58569a879747feed7bda0d972</id>
  <committed-date>2009-04-19T11:47:19-07:00</committed-date>
  <authored-date>2009-04-19T10:32:31-07:00</authored-date>
  <message>added ; and refactoring</message>
  <tree>7e8cb03df68f2ea0dfe5d29ac6f1e0ca774efa7d</tree>
  <committer>
    <name>Irina Dumitrascu</name>
    <email>irina2000d@yahoo.com</email>
  </committer>
</commit>
