https://github.com/uxcn/vim-x2x
vim plugin to convert radixes
https://github.com/uxcn/vim-x2x
radix vim vimscript
Last synced: over 1 year ago
JSON representation
vim plugin to convert radixes
- Host: GitHub
- URL: https://github.com/uxcn/vim-x2x
- Owner: uxcn
- Created: 2014-06-21T22:21:09.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2019-08-28T17:44:58.000Z (almost 7 years ago)
- Last Synced: 2025-01-11T10:20:04.329Z (over 1 year ago)
- Topics: radix, vim, vimscript
- Language: Vim script
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-x2x #
Functions to convert one radix to another (also see [x2x](https://github.com/uxcn/x2x))
## Using ##
The two main ways to use this are directly calling the functions
(Bin, Oct, Dec, Hex), and mappings.
For example, to insert a binary value from hexadecimal in insert mode
=Bin('0xdeadbeef')
Maps can also be useful.
xmap b x2b
nmap b x2b
xmap o x2o
nmap o x2o
xmap d x2d
nmap d x2d
xmap h x2h
nmap h x2h
The above convert values using visual select (vwh), and motions
(hw).
## Help ##
:help x2x
*Bin()*
Bin({expr}) Convert {expr} to binary.
*Oct()*
Oct({expr}) Convert {expr} to octal.
*Dec()*
Dec({expr}) Convert {expr} to decimal.
*Hex()*
Hex({expr}) Convert {expr} to hexadecimal.
*v_x2b*
{Visual}x2b Convert highlighted to binary.
*x2b*
x2b{motion} Convert value that {motion} moves over to binary.
*v_x2o*
{Visual}x2o Convert highlighted to octal.
*x2o*
x2o{motion} Convert value that {motion} moves over to octal.
*v_x2d*
{Visual}x2d Convert highlighted to decimal.
*x2d*
x2d{motion} Convert value that {motion} moves over to decimal.
*v_x2h*
{Visual}x2h Convert highlighted to hexadecimal.
*x2h*
x2h{motion} Convert value that {motion} moves over to hexadecimal.
## Install ##
The two easiest ways to install are vundle and pathogen.
### vundle ###
See [vundle](https://github.com/gmarik/Vundle.vim) for vundle install
instructions.
In your vimrc, add
Plugin 'uxcn/vim-x2x'
From vim, run
:PluginInstall
### pathogen ###
See [pathogen](https://github.com/tpope/vim-pathogen) for pthogen install
instructions.
Clone vim-x2x into the bundle directory
git clone git://github.com/uxcn/vim-x2x.git ~/.vim/bundle/vim-x2x