tags:

views:

139

answers:

2

I have an Ubuntu Linux development machine and a Macbook that I work on. On my laptop I use Textmate for PHP development on the go. The problem is that when I return to my Ubuntu dev machine and open my files in emacs, the formatting is off. I think it looks like one tab in Textmate is for some reason several tabs in emacs. So my code takes up the entire screen in emacs but only the left part of the screen in Textmate. Does anyone have any experience with this?

+3  A: 

It sounds like you need to set the tab size to be the same number of spaces in each program. For instance, if you want 4 spaces per tab then you need to make sure that Emacs and Textmate are both set up to use 4 spaces per tab.

Matt Ball
+3  A: 

Like Bears will eat you said, it seems like the two editors have differing opinions on how wide a tab is. Be default a tab character (\t) is 8 spaces wide on emacs. Maybe TextMate shows a tab as 4 spaces in your configuration?

You can set your tab-width in emacs (to 4 spaces in this case) by adding the following to your .emacs:

(setq-default tab-witdh 4)

I don't know anything about configuring TextMate.

Alternatively you can configure emacs to use spaces rather than tabs for indentation:

(setq-default indent-tabs-mode nil)

Again, I don't know how you do that with TextMate.

liwp