patternjump : Move cursor as you like.
| script karma
Downloaded by 541
Comments, bugs, improvements
script versions (upload new version)
|Patternjump give you a effective way to move cursor in various modes. The rules to move cursor can be easily optimized by using regular expression. Those rules defined by regular expression are called patterns in this introduction. Numbers of patterns can be registered and cursor would be moved to the closest candidate in them. This plugin serves two keymappings. One searches candidates for forward direction, and the other searches them for backward direction.
Suppose that your cursor is on the first character of a line like this:
let foo = "bar"
If you define a pattern "bar", of course, it matches with "bar". Thus using the keymapping which searches candidates in forward direction, cursor will move on a word "bar". Here I should say there are two types of patterns, head-patterns and tail-patterns. All the patterns should belong to either head or tail patterns, you can choose which when you register a new pattern. If "bar" belongs to head-patterns, cursor will move on 'b' of "bar". And if "bar" belongs to tail-patterns, cursor will move on 'r' of "bar".
let foo = "#bar" '#' represents cursor position
let foo = "bar#" '#' represents cursor position
I guess you have found that the pattern "bar" seems like not useful. So "bar" is not included in default patterns. Alternatively, a pattern '\<\h\k\+\>' is included in default patterns. This pattern matches with a independent word determined by the option 'iskeyword' in a source code. Therefore cursor will stop at "let", "foo", "bar". I think they are the very what we want to correct when we review a source code in many cases.
Latest version : https://github.com/machakann/vim-patternjump
|Unzip and just put all folders in your ~/.vim.|
Click on the package to download.
ip used for rating: 126.96.36.199