https://github.com/dalance/vseq.vim
A Vim plugin for generating sequential number vertically
https://github.com/dalance/vseq.vim
vim-plugins
Last synced: 6 months ago
JSON representation
A Vim plugin for generating sequential number vertically
- Host: GitHub
- URL: https://github.com/dalance/vseq.vim
- Owner: dalance
- License: mit
- Created: 2016-07-19T13:54:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-23T15:22:12.000Z (almost 10 years ago)
- Last Synced: 2025-01-28T13:54:39.502Z (over 1 year ago)
- Topics: vim-plugins
- Language: VimL
- Homepage:
- Size: 11.7 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vseq.vim
##INTRODUCTION
*vseq* is a Vim plugin for generating sequential number vertically.
[](https://asciinema.org/a/3i5yptlh2udbl9bkvrteee1ek)
##USAGE
Select same numbers vertically by visual block select, and execute `:VSeqIncrDec`. So, the numbers become the incremented sequence by decimal number.
Unlike `g`, this plugin can select radix manually, and automatically aligns by white space or zero padding.
For example,
```
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
0 0 0 0 00
```
the previous buffer becomes the following by
- Select 1st column and execute `:VseqIncrDec`.
- Select 2nd column and execute `:VseqIncrHex`.
- Select 3rd column and execute `:VseqDecrDec`.
- Select 4th column and execute `:VseqDecrHex`.
- Select 5th column and execute `:VseqIncrDec`.
```
0 0 10 a 00
1 1 9 9 01
2 2 8 8 02
3 3 7 7 03
4 4 6 6 04
5 5 5 5 05
6 6 4 4 06
7 7 3 3 07
8 8 2 2 08
9 9 1 1 09
10 a 0 0 10
```
###RECOMMENDED
If vim-operator-user plugin is installed, key-mappings by operator is avaliable. The key-mappings can do *dot-repeat*.
vim-operator-user plugin
https://github.com/kana/vim-operator-user
##INTERFACE
###VARIABLES
#### `g:vseq#upper_case` ( default value: = 0 )
If `g:vseq#upper_case` is 1, the alphabets of hex number become uppercase.
#### `g:vseq#padding_right` ( default value: = 0 )
If `g:vseq#padding_right` is 1, the padding by white space becomes right side of number.
The option is ignored at zero padding.
###COMMANDS
- `:VSeqIncrOct` : Generate sequential number incrementally by octal format.
- `:VSeqIncrDec` : Generate sequential number incrementally by decimal format.
- `:VSeqIncrHex` : Generate sequential number incrementally by hexadecimal format.
- `:VSeqDecrOct` : Generate sequential number decrementally by octal format.
- `:VSeqDecrDec` : Generate sequential number decrementally by decimal format.
- `:VSeqDecrHex` : Generate sequential number decrementally by hexadecimal format.
###KEY-MAPPINGS
- `(vseq-incr-oct)` : call `:VSeqIncrOct`.
- `(vseq-incr-dec)` : call `:VSeqIncrDec`.
- `(vseq-incr-hex)` : call `:VSeqIncrHex`.
- `(vseq-decr-oct)` : call `:VSeqDecrOct`.
- `(vseq-decr-dec)` : call `:VSeqDecrDec`.
- `(vseq-decr-hex)` : call `:VSeqDecrHex`.
###KEY-MAPPINGS AS OPERATOR
The following mappings is only avaibale when vim-operator-user plugin is installed.
- `(operator-vseq-incr-oct)` : call `:VSeqIncrOct` as operator.
- `(operator-vseq-incr-dec)` : call `:VSeqIncrDec` as operator.
- `(operator-vseq-incr-hex)` : call `:VSeqIncrHex` as operator.
- `(operator-vseq-decr-oct)` : call `:VSeqDecrOct` as operator.
- `(operator-vseq-decr-dec)` : call `:VSeqDecrDec` as operator.
- `(operator-vseq-decr-hex)` : call `:VSeqDecrHex` as operator.