0

I use MacVim to edit my code. The indents look pretty good in Vim,Emacs and textedit. But they look horrible in Textmate2, textwrangler.

How to make the indents by Vim look consistent in other software?(e.g.. Textmate, textwrangler)?

This is my vim setting about tap:

"auto indent of new line accoring to the previous line
set autoindent 
"smart indent for c program
set smartindent
" add tab of new line
set smarttab
" define smarttab length
set shiftwidth=4

vim emacs textedit textmate textragg

code4j
  • 4,208
  • 5
  • 34
  • 51

1 Answers1

3

It looks like those programs don't all interpret tabs in the same way. The easiest way to make sure it looks the same in all texteditors is to only use spaces:

set tabstop=4
set shiftwidth=4
set expandtab

You might also want to use :retab. Checkout Converting tabs to spaces for more info.

Daan Bakker
  • 6,122
  • 3
  • 24
  • 23
  • I always use these settings. When you program in a language where indentation has a meaning (such as python, haskell), different kinds of tabs can lead to bugs. – chtenb Jan 08 '13 at 15:47