Code Monkey home page Code Monkey logo

patternjump's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=4881

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".

    head-pattern :
        let foo = "#bar"                         '#' represents cursor position

    tail-pattern :
        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

patternjump's People

Contributors

machakann avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.