this repo has no description

Add article on inc/dec

+46
+46
content/incrementing_and_decrementing.md
··· 1 + --- 2 + title: Incrementing and decrementing 3 + --- 4 + 5 + # Incrementing and decrementing 6 + 7 + A useful feature that might not be super well knows is the ability to increment and decrement with `C-a` and `C-x`. 8 + 9 + ## Basic usage 10 + 11 + Use `C-a` to increment and `C-x` to decrement, optionally prefixed by a count. 12 + Note that `vim` will jump to the next thing it can increment/decrement in the line. 13 + 14 + Here I increment/decrement the first number, 15 + show that it jumps to the next relevant location in the line, 16 + and finally use a count with `1000<C-a>`. 17 + 18 + asciinema(u3IQ2BGQ16Au2KqsRdTA32cVY) 19 + 20 + ## Usage with a selection 21 + 22 + If you make a selection and try to increment/decrement it will do so per line, 23 + taking your selection into account. 24 + So the first valid thing in the line that is inside the selection will be targeted. 25 + 26 + asciinema(0bdcvVBYSiYhKT1a9aLgsiSXn) 27 + 28 + There is another more obscure feature by prefixing the action with `g`. 29 + This will increment the numbers with an increasing sequence. 30 + I think an example shows it off better than anything else. 31 + 32 + Here I create a line "0. item" and duplicate it a few times. 33 + I visually line select everything (`ggVG`) and do `g <c-A>`. 34 + 35 + asciinema(PN45fc01eQ2LrOhUBD99Pdx3I) 36 + 37 + ## Settings that affect usage 38 + By default incrementing/decrementing works not only for decimal numbers but also on binary and hexadecimal numbers. 39 + 40 + asciinema(yKsVIo6FtTuTETHNkNRXzXo3R) 41 + 42 + The two other modes available is "octal" and "alpha". 43 + The latter one is weird but might occasionally be useful. 44 + Note that it only works on single characters, so "z" won't turn into "aa" on increment. 45 + 46 + asciinema(um2yGsUBaxlJ5d52Hx3Am5ET1)