diff --git a/README b/README deleted file mode 100644 index ac775c3..0000000 --- a/README +++ /dev/null @@ -1,206 +0,0 @@ -This is a mirror of http://www.vim.org/scripts/script.php?script_id=670 - -The visincr plugin facilitates making a column of increasing or decreasing -numbers, dates, or daynames. - -First, select a column using visual-block (ctrl-v) and move the cursor. - -Second, choose what sort of incremented list you want: - - :I [#] Will use the first line's number as a starting point to build - a column of increasing numbers (or decreasing numbers if the - increment is negative). - Default increment: 1 - Justification : left (will pad on the right) - - :II [# [zfill]] Will use the first line's number as a starting point - to build a column of increasing numbers (or decreasing numbers - if the increment is negative). - Default increment: 1 - Justification : right (will pad on the left) - Zfill : left padding will be done with the given - character, typically a zero. - - :IYMD [#] year/month/day - :IMDY [#] month/day/year - :IDMY [#] day/month/year - Will use the starting line's date to construct an increasing - or decreasing list of dates, depending on the sign of the - number. - Default increment: 1 (in days) - - :ID [#] Will produce an increasing/decreasing list of daynames. Three-letter - daynames will be used if the first day on the first line is a three - letter dayname; otherwise, full names will be used. - - :IO [#] - :IIO [#] [zfill] - Like :I and :II, except visincr creates octal numbers. - - :IR [#] - :IIR [#] [zfill] - Like :I and :II, except visincr uses Roman numerals. Negative and - zero counts are not supported for Roman numerals. - - :IX [#] - :IIX [#] [zfill] - Like :I and :II, except visincr creates hexadecimal numbers. - - ------------------- - EXTRA NOTES - ------------------- - For :I :II :IO :IIO :IR :IIR : - If the visual block is ragged on the right-hand side (as can - easily happen when the "$" is used to select the - right-hand-side), the block will have spaces appended to - straighten it out. If the string length of the count exceeds - the visual-block, then additional spaces will be inserted as - needed. Leading tabs are handled by using virtual column - calculations. - - For :IR and :IIR : - Since Roman numerals vary considerably in their lengths for - nearby numbers, an additional two spaces will be included. - - For :IYMD, :IMDY, and IDMY: - You'll need the plugin, available as - "Calendar Utilities" under the following url: - - http://mysite.verizon.net/astronaut/vim/index.html#CALUTIL - -Help is included, too -- check out :he visincr-examples to see -even more examples of each command in action. - -Examples: - - :I - Use ctrl-V to - Original Select, :I - 8 8 - 8 9 - 8 10 - 8 11 - 8 12 - - :I -1 - Use ctrl-V to - Original Select, :I -1 - 8 8 - 8 7 - 8 6 - 8 5 - 8 4 - - - :II - Use ctrl-V to - Original Select, :II - 8 8 - 8 9 - 8 10 - 8 11 - 8 12 - - :II -1 - Use ctrl-V to - Original Select, :II -1 - 8 8 - 8 7 - 8 6 - 8 5 - 8 4 - - - :IMDY - Use ctrl-V to - Original Select, :IMDY - 06/10/03 6/10/03 - 06/10/03 6/11/03 - 06/10/03 6/12/03 - 06/10/03 6/13/03 - 06/10/03 6/14/03 - - - :IYMD - Use ctrl-V to - Original Select, :IYMD - 03/06/10 03/06/10 - 03/06/10 03/06/11 - 03/06/10 03/06/12 - 03/06/10 03/06/13 - 03/06/10 03/06/14 - - - - - :IDMY - Use ctrl-V to - Original Select, :IDMY - 10/06/03 10/06/03 - 10/06/03 11/06/03 - 10/06/03 12/06/03 - 10/06/03 13/06/03 - 10/06/03 14/06/03 - - - :ID - Use ctrl-V to - Original Select, :ID - Sun Sun - Sun Mon - Sun Tue - Sun Wed - Sun Thu - - - :ID - Use ctrl-V to - Original Select, :ID - Sunday Sunday - Sunday Monday - Sunday Tuesday - Sunday Wednesday - Sunday Thursday - - :IA - Use ctrl-V to - Original Select, :IA - a a - a b - a c - a d - a e - - :IO - Use ctrl-V to - Original Select, :IO - 5 5 - 5 6 - 5 7 - 5 10 - 5 11 - - :IR - Use ctrl-V to - Original Select, :IR - II II - II III - II IV - II V - II VI - - Use ctrl-V to - Original Select, :IX - 8 8 - 8 9 - 8 a - 8 b - 8 c - - -------------- -SEE ALSO -------------- -vis : vimscript#1195 : apply any ex command (ex. :s/../../) to a visual block -vissort : vimtip#588 : how to sort a visual block (or sort based on one) -visincr : http://mysite.verizon.net/astronaut/vim/index.html#VISINCR (for the latest, albeit experimental, release) diff --git a/README.md b/README.md new file mode 100644 index 0000000..fa09a1a --- /dev/null +++ b/README.md @@ -0,0 +1,210 @@ +# VisIncr + +This is a mirror of http://www.vim.org/scripts/script.php?script_id=670 + +## Function +The visincr plugin facilitates making a column of increasing or decreasing +numbers, dates, or daynames. + +## Installation + +This plug-in required `isort`. + +`pip install isort` + +`plug 'fisadev/vim-isort'` + +**Vim** + +Add the following in your `~/.vimrac` in the plug-in section + + +if you are using **vim-plug** as vim plug-in manager: + +``` +call plug#begin('~/.vim/plugged') +... + +Plug 'vim-scripts/VisIncr' + +... +call plug#end() +``` + +**Neovim** + +Add the same in the plug-in section in vim config file `~/.config/nvim/init.vim` + +## Usage +First, select a column using visual-block (ctrl-v) and move the cursor. + +Second, choose what sort of incremented list you want: + + +## Commands + +| Command | Description | +| ----------------------------------- | ------------------------------------------------------------------ | +| :I [#] | Will use the first line's number as a starting point to build a column of increasing numbers (or decreasing numbers if the increasement is negative).
Default increment: 1
Justification: left (will pad on the right) | +|:I [#]| Will use the first line's number as a starting point to build a column of increasing numbers (or decreasing numbers if the increment is negative).
Default increment: 1
Justification: left (will pad on the right) | +| :II [# [zfill]] | Will use the first line's number as a starting point to build a column of increasing numbers (or decreasing numbers if the increment is negative).
Default increment: 1
Justification : right (will pad on the left)
Zfill : left padding will be done with the given character, typically a zero. | +| :IYMD [#] year/month/day
:IMDY [#] month/day/year
:IDMY [#] day/month/year| Will use the starting line's date to construct an increasing or decreasing list of dates, depending on the sign of the number. Default increment: 1 (in days) +| :ID [#] | Will produce an increasing/decreasing list of daynames. Three-letter daynames will be used if the first day on the first line is a three letter dayname; otherwise, full names will be used.| +|:IO [#]
:IIO [#] [zfill] | Like :I and :II, except visincr creates octal numbers.| +|:IR [#]
:IIR [#] [zfill]| Like :I and :II, except visincr uses Roman numerals. Negative and zero counts are not supported for Roman numerals.| +|:IX [#]
:IIX [#] [zfill]| Like :I and :II, except visincr creates hexadecimal numbers.| + +### EXTRA NOTES +- For `:I :II :IO :IIO :IR :IIR` : + +If the visual block is ragged on the right-hand side (as can +easily happen when the "$" is used to select the +right-hand-side), the block will have spaces appended to +straighten it out. If the string length of the count exceeds +the visual-block, then additional spaces will be inserted as +needed. Leading tabs are handled by using virtual column +calculations. + +- For `:IR and :IIR` : + +Since Roman numerals vary considerably in their lengths for +nearby numbers, an additional two spaces will be included. + +- For `:IYMD, :IMDY, and IDMY` : + +You'll need the plugin, available as +"Calendar Utilities" under the following url: + +http://mysite.verizon.net/astronaut/vim/index.html#CALUTIL + +- Help is included, too -- check out :he visincr-examples to see +even more examples of each command in action. + +## Examples: + +Following section provides some samples on each commands. + +`:I`: Use ctrl-V to select the original block, `ESC` to Normal mode, use command `:I` to reformat the selected + +| Original | ctrl-V & `:I` | +| ----------------------- | -------------------------- | +| 8
8
8
8
8 | 8
9
10
11
12 | + + +`:I -1`: Decreasing number by 1 from the beginning + +| Original | ctrl-V & `:I -1` | +| ----------------------- | ----------------------- | +| 8
8
8
8
8 | 8
7
6
5
4 | + + +`:II`: Increase the number by 1 (right justification) + +| Original | ctrl-V & `:II` | +| ----------------------- | ----------------------- | +| 8
8
8
8
8 | 8
9
10
11
12 | + + +`:II -1`: Decreasing number by 1 from the beginning (left justification) + +| Original | ctrl-V & `:I -1` | +| ----------------------- | ----------------------- | +| 11
10
9_
8_
7_ | 11
10
_9
_8
_7 | + + +`:IMDY`: MM/DD/YY Increase the Date by 1 + +| Original | ctrl-V & `:IMDY` | +|----------|------------------| +| 06/10/03 | 6/10/03 | +| 06/10/03 | 6/11/03 | +| 06/10/03 | 6/12/03 | +| 06/10/03 | 6/13/03 | +| 06/10/03 | 6/14/03 | + + +`:IYMD`: Increase the Year by 1 + +| Original | ctrl-V & `:IMDY` | +|----------|------------------| +| 03/06/10 | 03/06/10 | +| 03/06/10 | 03/06/11 | +| 03/06/10 | 03/06/12 | +| 03/06/10 | 03/06/13 | +| 03/06/10 | 03/06/14 | + + +`:IDMY`: YYMMDD Increase Year by 1 + +| Original | ctrl-V & `:IDMY` | +|----------|----------------| +| 10/06/03 | 10/06/03 | +| 10/06/03 | 11/06/03 | +| 10/06/03 | 12/06/03 | +| 10/06/03 | 13/06/03 | +| 10/06/03 | 14/06/03 | + + +`:ID`: Week + +| Original | ctrl-V & `:ID` | +|----------|----------------| +| Sun | Sun | +| Sun | Mon | +| Sun | Tue | +| Sun | Wed | +| Sun | Thu | + + +`:IA`: Increase with character secquence + +| Original | ctrl-V & `:IA` | +|----------|----------------| +| a | a | +| a | b | +| a | c | +| a | d | +| a | e | + + +`:IO`: Increate number by 1 (left justification) + +| Original | ctrl-V & `:IO` | +|----------|----------------| +| 5 | 5 | +| 5 | 6 | +| 5 | 7 | +| 5 | 10 | +| 5 | 11 | + + +`:IR`: Increate with Roman numerals. + +| Original | ctrl-V & `:IR` | +|----------|----------------| +| II | II | +| II | III | +| II | IV | +| II | V | +| II | VI | + + +`:IR`: Increate with Roman numerals. + +| Original | ctrl-V & `:IR` | +|----------|----------------| +| 8 | 8 | +| 8 | 9 | +| 8 | a | +| 8 | b | +| 8 | c | + + +------------- +## SEE ALSO +------------- +**vis** : vimscript#1195 : apply any ex command (ex. `:s/../../`) to a visual block + +**vissort** : vimtip#588 : how to sort a visual block (or sort based on one) + +**visincr** : http://mysite.verizon.net/astronaut/vim/index.html#VISINCR (for the latest, albeit experimental, release)