I've created 2 files named tab1 and tab2. For tab1, I've used normal tab which is using 8 space by default.
Meanwhile for tab2, I've changed it using :set tabstop=4
command.
I've also tried :set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
It was working fine in vi, instead of having 8 blank spaces, now I have 4 blank spaces for tab.
inside vi
123456789
2
~
:set tabstop=4
However, when I view the files again with cat
command, it seems like both commands didn't help at all.
Please let me know how to make this changes persistent even outside vi when viewing it using other utilities such as cat
.
outside vi
123456789
user@host:~# cat tab1
1
user@host:~# cat tab2
2
user@host:~#
My goal is to have 4 spaces when using tab permanently even outside vi
editor like this.
Please let me know if you have a solution for this. Thanks
123456789
user@host:~# cat tab1
1
user@host:~# cat tab2
2
user@host:~#
123456789