Friedrich Ewald My Personal Website

Less wide Tabs in VIM

To use less space in vim I decided to go with only two spaces for each tab stop. This also improves readability in my eyes. I set the following in my .vimrc which I found here:

set tabstop=4       " The number of spaces count for a TAB.
set softtabstop=2   " The number of spaces inserted when typing TAB. If not expandtab, type TAB twice, will get one TAB.
set shiftwidth=2    " The number of spaces when auto-indent.
set expandtab       " Use the spaces only.
set smarttab        " Insert appropriate spaces in front of line according to shiftwidth, tabstop, softtabstop.
set autoindent
set smartindent
Interesting: Now I need two tabs to have the correct indent for Markdown source code.

About the author

is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.