8000 GitHub - adriangoransson/deindent: A command line utility and Rust library to format overly-indented text
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

adriangoransson/deindent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deindent

A command line utility and Rust library to format overly-indented text.

Installation

Head on over to the releases and get a copy!

Or install using Cargo:

$ cargo install deindent

Example uses

My primary use-case for this utility is to deindent text that I'm copying from an editor to e.g. my browser.

Deindent system clipboard

Set up an alias in your shell that deindents your clipboard content.

  • macOS:
$ alias pbdeindent='pbpaste | deindent | pbcopy'
$ alias wl-deindent='wl-paste | deindent | wl-copy'

(Neo)Vim

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

About

A command line utility and Rust library to format overly-indented text

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0