|increment a binary number||guitou Foujanet||6/16/09 7:46 AM|
I have started to use VIM 1 month ago and I think I start to
understand the philosophy of this editor.
But I have a problem, I am sure that there is a solution. My problem
is the following: I would like to increment a binary number. For
example, I would like to increment 00000001 -> 00000010 -> 00000011
and so on...
But the key Ctrl-A increment a decimal number, and I don't find the
method to increment a binary number.
And after that, I would like to use a macro to increment a number from
2^0 to 2^8 for example.
|Re: increment a binary number||Andy Wokula||6/16/09 12:07 PM|
guitou Foujanet schrieb:
See attached plugin, it is a continuation of the
"Help" is in the comments to the code.
If you're not used to folding, type zi to toggle folding on and off.
Source the script:
To enable it permanently, put it in the plugin folder ...
Default keys are <Leader>ba and <Leader>bx to increment/decrement a
|Re: increment a binary number||Charles Campbell||6/25/09 7:43 AM|
The latest version of visincr (a plugin) supports production of binary
Use ctrl-v to select the column, then press :IB. The result:
Same, but use :IIB: (this is right-justified, but variable-width fonts
Want zero-fill? Try the same with :IIB 1 0 (increment by one, fill
If you want visincr, you can get it from my website: