| Crates.io | deindent |
| lib.rs | deindent |
| version | 1.0.1 |
| created_at | 2025-03-19 21:22:07.485731+00 |
| updated_at | 2025-03-22 23:56:58.604479+00 |
| description | A command line utility and Rust library to format overly-indented text. |
| homepage | |
| repository | https://github.com/adriangoransson/deindent |
| max_upload_size | |
| id | 1598614 |
| size | 13,102 |
A command line utility and Rust library to format overly-indented text.
At the moment, a Rust (or more specifically Cargo) installation is needed. To install, run:
$ cargo install deindent
My primary use-case for this utility is to deindent text that I'm copying from an editor to e.g. my browser.
Set up an alias in your shell that deindents your clipboard content.
$ alias pbdeindent='pbpaste | deindent | pbcopy'
wl-clipboard)$ alias wl-deindent='wl-paste | deindent | wl-copy'
The following Vimscript configures (Neo)Vim to automatically deindent the *
(clipboard) register after yanking to it.
if executable("deindent")
augroup DeindentClipboardRegister
autocmd!
autocmd TextYankPost *
\ if v:event["regname"] == "*" |
\ call setreg("*", system("deindent", getreg("*"))) |
\ endif
augroup END
endif