Different tab width for render and insert



I’m currently using vim with tabstop=8 softtabstop=4 shiftwidth=4 which translates to tabs being 8 on display but on insert and indent being 4. This is a vim hack used for ages (using a combination of tabs and spaces) but can’t be easily translated to modern day editors.

Is it possible to have Atom:

  • render tabs as 8 (easy)
  • and at the same time use 4 for insert and (auto)indent?


Distiguish between tab size and indentation size

This isn’t something that Atom currently supports, no. You could possibly make it work with some sort of process that happens on save? You could tell Atom your tab width is 4 and to use spaces for indentation, then when you save have the process change any multiple of 8 leading spaces turned into the appropriate number of tab characters?

Is that essentially what you’re looking for?


Not exactly, I need tabs to be displayed as 8 as otherwise previously written code (lots of it) will not be displayed properly. Cannot convert all tabs to spaces as well.

I was thinking of remapping tab key to do 4 spaces instead of \t but that would not resolve autoindent problem which would still do 8 spaces.


Did you ever find any solution to this?

I’m having exactly the same problem with lots of legacy code written with hard tabs and tab size 8, while I generally write code with soft tabs and tab size 4.