Once you’ve got expandtab on as per the other answers, the extremely convenient way to convert existing files according to your new settings is:
:retab
It will work on the current buffer.
More Related Contents:
- How do I exit the Vim editor?
- How to replace a character by a newline in Vim
- What is your most productive shortcut with Vim?
- Why do Vim experts prefer buffers over tabs? [closed]
- How do I exit Vim?
- Indent multiple lines quickly in vi
- Make Vim show ALL white spaces as a character
- How do I use vim registers?
- Tab key == 4 spaces and auto-indent after curly braces in Vim
- How to paste over without overwriting register
- Move entire line up and down in Vim
- Copy all the lines to clipboard
- How to effectively work with multiple files in Vim
- Traversing text in Insert mode
- Best way to insert timestamp in Vim?
- Find and replace strings in vim on multiple lines
- Vim delete blank lines
- How do I fix the indentation of an entire file in Vi?
- Where is my .vimrc file?
- Search for selection in Vim
- Mapping in vimrc causes bizarre arrow behaviour
- Is there a “vim runtime log”?
- How to prevent the cursor from moving back one character on leaving Insert mode in Vim?
- Using vim’s f command over multiple lines
- Can terminals detect or ?
- What are the dark corners of Vim your mom never told you about? [closed]
- Multiple commands on same line
- How can you automatically remove trailing whitespace in vim
- Does Vim load plugins after loading vimrc?
- Paste in insert mode?