DEV Community

Discussion on: Tabs v. Spaces: Let’s decide this

Collapse
 
silvether profile image
silvether

Its also possible for users to configure their editor/ide to accept a tab character as a series of individual spaces. I can't understand why more folks don't do this. They can still press their single button, but have the precision of the spaces in play.

VIM:

config file: ~/.vimrc

set tabstop=4 " The width of a TAB is set to 4.
" Still it is a \t. It is just that
" Vim will interpret it to be having
" a width of 4.

set shiftwidth=4 " Indents will have a width of 4

set softtabstop=4 " Sets the number of columns for a TAB

set expandtab " Expand TABs to spaces

Collapse
 
sergix profile image
Peyton McGinnis

Yeah, in VSCode my tab key = 2 spaces. I don't use vim as much but I'll be adding that to my config. 👍🏼

Collapse
 
iamscr1pty profile image
Biswajit Pramanik

Didnt know that, saved me some effort😋