Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/trmckay/based.nvim

Neovim plugin to convert numberical base of selection or current word
https://github.com/trmckay/based.nvim

neovim

Last synced: about 2 months ago
JSON representation

Neovim plugin to convert numberical base of selection or current word

Awesome Lists containing this project

README

        

# based.nvim

based.nvim is a Neovim plugin for quickly converting buffer text to/from hex.

## Demo

https://user-images.githubusercontent.com/43476566/208255795-f4f5e50a-bfff-4b5b-bb37-2b836bdd2005.mov

## Example configuration

```lua
local based = require("based")

-- Not necessary if you don't want to override any defaults.
-- `:help based` for information on configuration keys
based.setup({
highlight = "MyHighlightGroup"
})

vim.api.nvim_set_keybind({ "n", "v" }, "", based.convert) -- Try to detect base and convert
vim.api.nvim_set_keybind({ "n", "v" }, "Bh", function() based.convert("hex") end) -- Convert from hex
vim.api.nvim_set_keybind({ "n", "v" }, "Bd", function() based.convert("dec") end) -- Convert from decimal
```