# Navigating Ruby Files with Vim - The Cheat Sheet ## Precision motions for Ruby Look up Ruby motions by running `:help ruby-motion`.
| command | effect |
|---|---|
| ]m | go to start of next method definition |
| ]M | go to end of next (or current) method definition |
| [m | go to start of previous method definition |
| [M | go to end of previous method definition |
| ]] | go to start of next module or class definition. |
| [[ | go to start of previous module or class definition. |
| % | jump between matchin keyword pairs |
| command | effect |
|---|---|
| ir | inside the current rubyblock |
| ar | around the current rubyblock |
| im | inside the current method definition |
| am | around the current method definition |
| iM | inside the current class or module |
| aM | around the current class or module |
| command | effect |
|---|---|
| gf | jump to the filename under the cursor |
| :find {file} | jump to the specified {file} in path |
| command | effect |
|---|---|
| <C-]> | jump to the first tag that matches the word under the cursor |
| :tag {keyword} | jump to the first tag that matches {keyword} |
| g<C-]> | prompt user to select from multiple matches for the word under the cursor. If only one match exists, jump to it without prompting. |
| :tselect {keyword} | prompt user to select from multiple matches for {keyword}. If only one match exists, jump to it without prompting. |
| command | effect |
|---|---|
| <Tab> | expand commandline to use next match |
| <S-Tab> | expand commandline to use previous match |
| <C-d> | show a list of all possible matches |