Giter VIP home page Giter VIP logo

sequence's Introduction

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

Usage:

Put the cursor anywhere on these lines. The range will be guessed and the first
sequence of numbers will be transformed. If you want to transform the second
sequence of numbers you must use a visual block selection (dashes in this
example).

array [1] = 9              array [1] = -9-              array [1] = 9
array [1] = 9              array [2] = -9-              array [2] = 8
array [1] = 9    alt-a:    array [3] = -9-    alt-x:    array [3] = 7
array [1] = 9              array [4] = -9-              array [4] = 6
array [1] = 9              array [5] = -9-              array [5] = 5

With a count:

array [1] = 9                array [1] = -9-                array [1] = 9
array [1] = 9                array [3] = -9-                array [3] = 7
array [1] = 9    2 alt-a:    array [5] = -9-    2 alt-x:    array [5] = 5
array [1] = 9                array [7] = -9-                array [7] = 3
array [1] = 9                array [9] = -9-                array [9] = 1

Note: If the range is not easy to guess, use a selection instead

If you wanted to increment / decrement all numbers by only one, select your
lines and press ^a / ^x

   v mode                     ^v mode
array [1] = 8             array [6] = -8-             array [6] = 5
array [1] = 8             array [6] = -8-             array [6] = 5
array [1] = 8    5 ^a:    array [6] = -8-    3 ^x:    array [6] = 5
array [1] = 8             array [6] = -8-             array [6] = 5
array [1] = 8             array [6] = -8-             array [6] = 5

----------------------------------------------------------------------------

This plugin integrates with Tim Pope's repeat plugin. It means that you can use
. to repeat any normal mode (for now) sequence mapping you just used!

For more information see: http://github.com/tpope/vim-repeat

----------------------------------------------------------------------------

You have the possibility to define your own custom mappings in your .vimrc:

    vmap <m-a> <plug>SequenceV_Increment
    vmap <m-x> <plug>SequenceV_Decrement
    nmap <m-a> <plug>SequenceN_Increment
    nmap <m-x> <plug>SequenceN_Decrement

    vmap <c-a> <plug>SequenceAdd
    vmap <c-x> <plug>SequenceSubtract

Note: You can replace Alt+a, Alt+x, Ctrl+a and Ctrl+x with whatever you like.

sequence's People

Contributors

kurkale6ka avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

jean

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.