Tech and Biz Ramblings

Changing the Tab Size in VI Editor

The vi editor is a powerful editor. Problem with it is that it is only for the command line which means that many preferences are not accessible via a ‘Preferences’ page. You need to know how to set preferences using commands.

Recently I've found out how to change the tab size in the vi editor. I think by default the tab size is 8 characters, which is too long for coding with proper indentation. To change it to a four character stop, use the following command in command mode:

:set tabstop=4


Additionally to turn auto indentation on, it is

:set autoindent

To turn auto indentation off, it is

:set noautoindent
comments powered by Disqus

Related contents

vi (9)