Skip to Content
gnux

-t, --tabs

Have tabs N characters apart instead of 8 (enables -a), or use comma separated list of explicit tab positions.

An option of unexpandx.

Usage

unexpandx -t N, LIST [FILE]...
unexpandx --tabs=N, LIST [FILE]...

Details

ShortLongValueDefaultMeaning
-t--tabsN, LISThave tabs N characters apart instead of 8 (enables -a), or use comma separated list of explicit tab positions

Examples

Convert 4-space indentation and alignment to tabs

unexpandx -t 4 main.go

Retab a Go file for gofmt, leaving alignment inside lines alone

unexpandx -t 4 --first-only main.go

Retab a report laid out in fixed columns

unexpandx -t 10,20,40 report.txt

Edit with spaces, then hand the file back with tabs

expandx -t 4 a.go | unexpandx -t 4 --first-only > b.go

Restore the tabs a Makefile needs after an editor turned them into spaces

unexpandx -t 8 spaces.mk > Makefile

Help in the terminal

gnux help unexpandx --tabs

On this page