mirror of
https://github.com/anotherhadi/sttr.nvim.git
synced 2026-10-05 08:48:25 +02:00
main
sttr.nvim
A Neovim plugin for sttr: select text, pick a transformation, done.
Supports charwise (v), linewise (V), and block (<C-v>) visual selections.
The list of available transformations is read dynamically from your installed version of sttr.
Requirements
- Neovim 0.10+
- sttr installed and available in
$PATH
Installation
lazy.nvim
{
'anotherhadi/sttr.nvim',
config = function()
require('sttr').setup()
end,
}
Setup
require('sttr').setup()
No keymaps are set by default. Add your own:
vim.keymap.set('v', '<leader>st', ':<C-u>SttrTransform<CR>', { silent = true, desc = 'sttr: transform selection' })
Commands
| Command | Description |
|---|---|
:SttrTransform |
Open the transformation picker for the current visual selection |
:SttrClearCache |
Clear the cached transformation list (re-reads sttr --help) |
Pickers
The plugin automatically uses the best available picker:
- telescope.nvim
- snacks.nvim picker
vim.ui.select(built-in, or overridden by snacks/dressing/etc.)
Block visual
In block visual mode (<C-v>), each line of the selection is transformed independently. This is useful for transforming a column of values (e.g. base64-decoding a column of tokens).
Transformations
sttr.nvim dynamically reads transformations from sttr --help at first use, so it always reflects your installed version. sttr supports 60+ operations including:
- Encoding: base64, base32, URL, HTML, hex, morse…
- Hashing: md5, sha256, sha512, bcrypt…
- Case: camelCase, snake_case, kebab-case, UPPER, lower…
- Lines: sort, reverse, unique, shuffle…
- Formats: JSON↔YAML, markdown→HTML…
- Extraction: emails, IPs, URLs…
Languages
Lua
100%