I've been trying to use GNU indent to indent some very simple C files, and I wish to use the K&R indentation style but without any use of spaces, purely tabs.
I've tried indent -kr --use-tabs, and just indent -kr but they both just use the default K&R with spaces or mix indentation with spaces and tabs.
Is there a way to use K&R with GNU indent while strictly using tabs only? If not, is there a better utility for indentation in this style?
The default assumed width of a tab in GNU indent is 8 (because historically that is what line-printers, teletypes and dumb terminals use). If your indent width is not then a multiple of 8, the tool will mix tabs and spaces to meet your indent width specification.
You need to set the tab width to match your indent with the --tab-size / -ts option, as described in the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With