1

Possible Duplicate:
Tab key == 4 spaces and auto-indent after curly braces in VIM
Vim: how to redefine tab as 4 spaces

I'm writing in vim, and I'm on the tabs side of the tabs vs. spaces war.

However, the tabs are taking up quite a bit of screen space. How can I make it so that they are functionally identical to tabs, but display the same length as, say, four spaces?

Thanks!

Community
  • 1
  • 1
River Tam
  • 3,096
  • 4
  • 31
  • 51
  • 2
    Oh my, [the google-fu is not strong in this one...](https://www.google.nl/search?client=opera&rls=en&q=vim+set+tab+to+4+spaces&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest) – Wrikken Dec 11 '12 at 23:52
  • 1
    Note that any special line-to-line formatting (e.g. indented line contiunations) will look vastly different in anyone else's editor with different (e.g. default tab=8 spaces) settings. – dash-tom-bang Dec 12 '12 at 02:42
  • 1
    @Wrikken Those certainly looked at the time like they were saying "convert all of the tab characters into 4 space characters". I didn't want to convert them to 4 space characters, so I specified, which I haven't found a site on the internet that specifies the difference aside from this page (not that I'm not sure it exists) – River Tam Dec 12 '12 at 23:07
  • In Vim, "size of tab characters" and "how many spaces to insert per indent level" are distinct question. Here's a better question http://stackoverflow.com/questions/2054627/how-do-i-change-tab-size-in-gvim – graywh Apr 10 '13 at 16:04

1 Answers1

6

add

set tabstop=4

to your $HOME/.vimrc

femtoRgon
  • 32,893
  • 7
  • 60
  • 87