https://github.com/deathaxe/sublime-hexbindec
Hexadecimal-Binary-Decimal converter for SublimeText 3
https://github.com/deathaxe/sublime-hexbindec
sublime-package sublime-text sublime-text-plugin
Last synced: 11 months ago
JSON representation
Hexadecimal-Binary-Decimal converter for SublimeText 3
- Host: GitHub
- URL: https://github.com/deathaxe/sublime-hexbindec
- Owner: deathaxe
- Created: 2016-07-13T16:39:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-23T17:47:28.000Z (over 6 years ago)
- Last Synced: 2025-06-03T01:58:06.081Z (about 1 year ago)
- Topics: sublime-package, sublime-text, sublime-text-plugin
- Language: Python
- Size: 5.86 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [HexBinDec][home]
[](http://opensource.org/licenses/MIT)
This package provides ability to inplace change the base of numbers in [SublimeText 3 Editor][1].
## Usage
1. Move the cursor over a number or select one or more numbers.
2. Press one of the following key combinations to convert the numbers.
- Ctrl+shift+b, ctrl+shift+d binary to decimal
- Ctrl+shift+b, ctrl+shift+h binary to hexadecimal
- Ctrl+shift+d, ctrl+shift+b binary to decimal
- Ctrl+shift+d, ctrl+shift+h binary to hexadecimal
- Ctrl+shift+h, ctrl+shift+b hexadecimal to binary
- Ctrl+shift+h, ctrl+shift+d hexadecimal to decimal
The commands are available in
- command pallet under `Convert Number: ...`
- main menu -> edit -> Convert Numbers
- context menu -> Convert Numbers
## Setup
You can setup patterns to identify binary, decimal and hexadecimal numbers for each syntax just by adding the following settings to the syntax specific settings file `.sublime-settings`.
```javascript
// ...
// Define the format of binary numbers for the Hex-Bin-System plugin
// Binaries look like 'B101110'
"convert_src_bin": "'B([01]+)'",
"convert_dst_bin": "'B{0:b}'",
// Define the format of hexadecimal numbers for the Hex-Bin-System plugin
// Hexadecimals look like 'H1AF23'
"convert_src_hex": "'H([0-9A-F]+)'",
"convert_dst_hex": "'H{0:X}'",
// Define the format of exponential numbers for the Hex-Bin-System plugin
// The pattern must match the base as group 1 and exponent as group 2.
// Exponential numbers look like 3.14EX-4
"convert_src_exp": "\\b([1-9]\\.\\d+)EX([-+]?\\d+)\\b",
"convert_dst_exp": "EX",
// ...
```
## Inspired by
[Hex-Bin-System][2] by ALLZ
[home]:
[1]:
[2]: