MisanthropicBit/decipher.nvim

github github
utilitytext-objectplugin
stars 29
issues 3
subscribers 3
forks 1
CREATED

2022-11-28

UPDATED

16 days ago


[!IMPORTANT]
A bit library is needed which requires that either neovim has been compiled with luajit or you are using v0.9.0+ which provides a bit library.

demo

Installing

Plug 'MisanthropicBit/decipher.nvim'
use 'MisanthropicBit/decipher.nvim'

Setup

Setup decipher using decipher.setup unless you are content with the defaults. The options below are the default values. Refer to the docs for more help.

require("decipher").setup({
    active_codecs = "all", -- Set all codecs as active and useable
    float = { -- Floating window options
        padding = 0, -- Zero padding (does not apply to title if any)
        border = { -- Floating window border
            { "╭", "FloatBorder" },
            { "─", "FloatBorder" },
            { "╮", "FloatBorder" },
            { "│", "FloatBorder" },
            { "╯", "FloatBorder" },
            { "─", "FloatBorder" },
            { "╰", "FloatBorder" },
            { "│", "FloatBorder" },
        },
        mappings = {
            close = "q", -- Key to press to close the floating window
            apply = "a", -- Key to press to apply the encoding/decoding
            jsonpp = "J", -- Key to prettily format contents as json if possbile
            help = "?", -- Toggle help
        },
        title = true, -- Display a title with the codec name
        title_pos = "left", -- Position of the title
        autoclose = true, -- Autoclose floating window if insert
                          -- mode is activated or the cursor is moved
        enter = false, -- Automatically enter the floating window if
                       -- opened
        options = {}, -- Options to apply to the floating window contents
    },
})

Supported Codecs

  • ✅ = supported
  • ❌ = not supported
  • 🗓️ = planned
Codec Encoding Decoding
base32
zbase32
crockford
base64
base64-url¹
base64-url-safe²
url

¹ Combination of base64 and url codecs.

² Base64-variant that is safe to include in urls.