开发者

How do I type a literal tab character in Eclipse?

I feel very silly asking this question, but here goes. :)

I've configured Eclipse to insert spaces instead of tabs, but I'm working on a Makefile, which requires literal tab characters (see Can you make valid Makefiles without tab characters? for a good explanation).

So how do I type one, short of opening the Text Editors preferences, unticking the "Insert spaces for tabs" option, clicking Apply, a开发者_运维问答nd then undoing all of that when I'm done editing the makefile?


Only way I can find to do it in Eclipse (version=Juno) was to type say XXX where I wanted the tab character and then do a find/replace. Switch on regexp matching in the find and put XXX as find with \t as the replace. Painful but works.


If you're using the Eclipse's built-in Makefile editor (included in the C++ package I believe), tabs should be literal.


Sorry, I don't appear to have enough points to comment on the accepted answer, but I wanted to add that although the Makefile editor allows tabs to be entered, it doesn't use tabs when indenting multiple lines with the tab key, or if you enter a tab in block selection mode. This made me think I couldn't enter tabs for a while (I should probably raise a defect report).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜