The only way to use the plugin right after the install is to run it with lua, as shown in the video in the README, such as :'<,'>lua require('decipher').encode_selection("base64").
Providing pre-made copy pastable mappings to put into the user config...
return {
'MisanthropicBit/decipher.nvim',
version = '*',
event = 'VeryLazy',
config = function()
local decipher = require 'decipher'
decipher.setup {
vim.keymap.set({ 'n', 'v' }, '<leader>ube', function()
decipher.encode_selection 'base64'
end, { noremap = true, silent = true, desc = '[B]ase64 [E]ncode' }),
vim.keymap.set({ 'n', 'v' }, '<leader>ubd', function()
decipher.decode_selection 'base64'
end, { noremap = true, silent = true, desc = '[B]ase64 [D]ecode' }),
vim.keymap.set({ 'n', 'v' }, '<leader>ubse', function()
decipher.encode_selection 'base64-url-safe'
end, { noremap = true, silent = true, desc = '[B]ase64 URL [S]afe [E]ncode' }),
vim.keymap.set({ 'n', 'v' }, '<leader>ubsd', function()
decipher.decode_selection 'base64-url-safe'
end, { noremap = true, silent = true, desc = '[B]ase64 URL [S]afe [D]ecode' }),
vim.keymap.set({ 'n', 'v' }, '<leader>uue', function()
decipher.encode_selection 'url'
end, { noremap = true, silent = true, desc = '[U]RL [E]ncode' }),
vim.keymap.set({ 'n', 'v' }, '<leader>uud', function()
decipher.decode_selection 'url'
end, { noremap = true, silent = true, desc = '[U]RL [D]ecode' }),
}
end,
}
Did you check the docs?
Is your feature request related to a problem? Please describe.
The only way to use the plugin right after the install is to run it with lua, as shown in the video in the README, such as
:'<,'>lua require('decipher').encode_selection("base64").Describe the solution you would like
It would be nice to have some commands, such as
:EncodeBase64,:EncodeCrockford, etc.This would also allow to start the plugin only when needed with the 'Cmd' feature of Lazy.
Describe alternatives you have considered
Providing pre-made copy pastable mappings to put into the user config...
Additional context
Right now I set the plugin like this, to have easier access to its features:
Note: For anyone wondering, the
uin<leader>u... stands for UtilsThanks!