Giter VIP home page Giter VIP logo

sublime-display-nums's Introduction

Plugin that shows a number in 10, 16, 2 and 8 numeral systems for Sublime 3

This plugin converts the selected number in decimal, hexadecimal, binary or octal numeral systems and displays a popup that shows the result in all four (dec, hex, bin and oct) numeral systems.

Popup modes

basic - has minimal information:

popup example

extended - can convert numbers and supports additions:

popup example

tabled - backwards compatibility with @kalund plugin:

popup example

Additional functionality

  • Pressing any digit of binary number makes it opposite of it's current value.
  • Key binding is available for convert numeral system and swap endianness functions.

Addition: swap endianness

Displays buttons to swap endianness interpreting number as halfword (16 bits), word (32 bits) or doubleword (64 bits).

Addition: interpret hex number as float

Displays selected number in hex format as IEEE 754:

  • float (32 bits) if it is less or equal to 4 bytes length;
  • double (64 bits) if it is less or equal to 8 bytes length.

Addition: interpret number as size in bytes

Addition: bit shifting

Display buttons to shift the number left or right by one bit.

Installation

Clone this repository or download zip archive into the Sublime 3 package directory (you can find it in menu option Preferences -> Browse Packages...). Keep in mind that plugin folder name should be Display numbers.

Settings

You can setup this plugin settings or key bindings which can be edited in menu option Preferences -> Package Settings -> Display nums -> Settings or Key bindings accordingly. Or you can define project specific settings by adding "disnum." to the setting option, for example:

user settings file

{
    "plugin_mode": "extended"
}

project settings file

{
    "disnum.plugin_mode": "tabled"
}

sublime-display-nums's People

Contributors

dseight avatar nia40m avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

sublime-display-nums's Issues

Can't change bits in "big" number

Trying to change any bit in number 0xffffffffffffffffull I got python exception trace:

Traceback (most recent call last):
  File "/home/nsokolov/.config/sublime-text-3/Packages/Display numbers/display_nums.py", line 341, in select_function
    view.run_command(data.get("func"), data.get("data"))
  File "/opt/sublime_text/Lib/python33/sublime.py", line 1309, in run_command
    sublime_api.view_run_command(self.view_id, cmd, args)
OverflowError: int too big to convert

Number convert and bit change removes suffixes

Eg. converting any number like 0x3ull to int will be replaced with simple 3 without suffix.
This extends to any convert functionality, swap endianness functionality and bit change functionality.

It is unacceptable >_<

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.