Is there a way to make cat
, less
etc. print tab characters instead of tabs being converted to spaces? I am annoyed by this when I copy code from the terminal to an editor.
I am seeing two problems here.
First, destination editor can covert TAB to number of spaces. Some editor has default feature to convert TAB to number of spaces. If you disable this feature TAB character you copied from terminal will be copied as TAB(instead of space) to an editor. Windows Notepad++ has similar feature . If you are using vim, this page will be helpful for vim tab and space conversion
Another, source file in your case terminal may be representing tab
as spaces, please check that first. You can use cat -t filename
to
see if you have any TAB in source file or not. That command will
display TAB character as ^I.
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