ConvertBase.vim : Convert to/from various numeric bases
| script karma |
Rating 29/14,
Downloaded by 2216 |
Comments, bugs, improvements
|
Vim wiki
|
| created by |
| Christian J. Robinson |
| |
| script type |
| utility |
| |
| description |
This script is basically just three functions:
ConvertToBase(int, base)
ConvertFromBase(str, base)
ConvertBases(str, base1, base2)
And two example functions that are commented out.
The following mappings may also be useful:
" Translate the character under the cursor to a decimal value:
nmap <M-a>d i<C-R>=char2nr(getline(line("."))[col(".") - 1])<CR><ESC>lx
" ... hexadecimal value:
nmap <M-a>h ix<C-R>=ConvertToBase(char2nr(getline(line("."))[col(".") - 1]),16)<CR><ESC>lx
" ... octal value:
nmap <M-a>o i<C-R>=ConvertToBase(char2nr(getline(line("."))[col(".") - 1]),8)<CR><ESC>lx |
| |
| install details |
| Source the script or place it in your plugin directory. |
| |
script versions (upload new version)
Click on the package to download.
ip used for rating: 216.73.216.44
|