0

I'm not really sure if I should post this as a web browser question (or nginx), but I compose in VIM so here it is!

Because I don't like 8 character tabs in my documents, I set by tabstops to 4, shiftwidth to 4 and turn on autoindent so that when I do bullets things are the way they do them.

set shiftwidth=4
set tabstop=4
set autoindent

If I dump my txt file on a web server (like nginx) and open the text file served out by the webserver, I noticed that my tabs are interpreted as 8 characters and not 4.

Can somebody explain to me exactly what is going on, and how I might (if there even is one) modify my VIM settings (or nginx?) so that the text that is rendered looks like what I see in VIM when I am editing or viewing?

thanks!

2
  • Welcome to Vim. If you have the solution to your problem it is best to leave your question and post an answer such that other can follow or answer on their own. May 7 at 17:36
  • 1
    Yea thanks I’ll do that!
    – Danathar
    May 7 at 19:28

1 Answer 1

0

Problem Solved. Seems that the action of posting a stack exchange article was all I needed!

The answer is to use set expandtab so that tabs are ALWAYS spaces. I hope somebody somewhere finds this useful!

3
  • You probably only want to change tabstop if you are using literal tabs; it affects (mostly) the display width of the tab character. For spaces, shiftwidth + expandtab + softtabstop is a better combo
    – D. Ben Knoble
    May 7 at 22:48
  • I’ve didn’t know about softtabstop. What does that do?
    – Danathar
    May 8 at 0:00
  • Try :help 'softtabstop' :)
    – D. Ben Knoble
    May 8 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.