Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change Eclipse to use spaces instead of tabs in Javascript editor?

Tags:

I use the Eclipse JavaScript plugin, I have my text editor settings to "insert spaces as tabs" this works fine until I select a block of code and tab it or shift tab it, run JSLint and AARGghh! "Mixed spaces and tabs." is there something I am missing, is this possible?

like image 872
Damen TheSifter Avatar asked Jan 24 '12 20:01

Damen TheSifter


People also ask

How do I change tabs in eclipse?

CTRL - F6 in Eclipse, like ALT - TAB (on windows), brings up a list of tabs/windows available (if you keep the CTRL / ALT key depressed) and highlights the one you will jump to when you let go of this key. You do not have to select the window.


1 Answers

I am not exactly sure where you set the editor property "insert spaces as tabs". To set the tab policy you need to go to Window > Preferences > Javascript > Code Style > Formatter, create a new profile, edit it and set the Tab policy to "spaces only". Now when using the tab key spaces are inserted.

like image 194
Hauke Ingmar Schmidt Avatar answered Oct 12 '22 00:10

Hauke Ingmar Schmidt