0

I have started using vi in the terminal to write shell scripts. However, I noticed that the indentation is very large. In the preference panel, where could I change the indentation?

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
Johnathan
  • 1,877
  • 4
  • 23
  • 29
  • I've updated the tags. This is not a shell issue; it's controlled by your editor. I presume you're using the `vim` implementation of `vi`; please update the tags if you're not (type `:version` in your editor to verify). – Keith Thompson Mar 20 '15 at 19:32

2 Answers2

2

if you're using vi, you have to set the tab size using vi options.

when you first open the file, type : then enter

set ts=4

and this will set the tab spacing to 4 spaces per tab.

skrawler
  • 119
  • 3
  • Both `tabstop` (`ts`) and `shiftwidth` (`sw`) are likely to be relevant. See the accepted answer to the [duplicate question](http://stackoverflow.com/questions/2054627/how-do-i-change-tab-size-in-vim). – Keith Thompson Mar 20 '15 at 19:36
0

The OS X Terminal doesn't support changing the indentation size. You have to change the settings in vi.

Emil Laine
  • 41,598
  • 9
  • 101
  • 157