eclipse: spaces instead of tabs, .project file - eclipse

It's our policy to use spaces instead of tabs. There are quite some postings for this topic but the following hasn't been answered yet. I use the following settings:
General > Editors > Text Editors. Check “Insert spaces for tabs”
Java > Code Style > Formatter. Create a new profile. Go to the Indentation tab and set “Tab policy” to “Spaces only”
Ant > Editor > Formatter. Uncheck "Use tab character instead of spaces"
Yet, Eclipse still uses tabs in .project files. If that can be prevented, how?

The .project file is in internal Eclipse file which you should not be editing. Because it is an internal file it does not use any of the preference settings.
The file is actually written using the org.eclipse.core.internal.resources.XMLWriter class. This is hard coded to use tabs.

Related

How to I edit the default "formatter profile" in eclipse neon? (wanting to use spaces instead of tabs for all code types)

So I am trying to use spaces instead of tabs for my code. On Java and Javascript preferences (Java/Javascript => Code Style => formatter) both are using the built-in Eclipse profile.
So for the javascript one, I created a new profile (I called it "mine") based on the default and then changed the indentation settings to use spaces instead of tabs. The issue is that when I went to the Java preferences, I cannot find the new "mine" profile. I need to create another one and change it.
Instead of creating individual profiles for each code type, how can I edit the default profile so it uses spaces instead of tabs?
On General => Editors => Text Editors, I have enabled "Use spaces instead of tabs".
Thanks!
ps. I'm using a Mac but I believe the preferences are similar to the other OSes.
There is no common setting for this. The Java and Javascript code formatters are completely separate and you have to edit the settings for both.
The 'General > Editors > Text Editors' setting is used when you are typing on code yourself. It is not used by the code formatters.

Eclipse / PyDev - Remove path from editor tabs when two files with same name are opened

I'm currently using Elipse Luna, and I'm trying to figure out how to remove the path name from the editor tabs when multiple files with the same name but different directories are opened (see screenshot).
So, in other words, keep the file name, but remove the path name inside the parentheses.
I've done this in the past with previous versions of Eclipse, but I can't for the life of me remember how I did it. I just find that path names take up a lot of real estate in my editor and it doesn't take long before tabs are hidden away.
You're correct that this is a Pydev setting.
Go to Preferences -> PyDev -> Editor caption/icon
and change Django modules handling: to
"Show as a regular module"

Eclipse indents new line with tabs instead of spaces

I've followed all the suggestions here.
When I press return, I get a new line that is indented with tabs instead of spaces.
If I backspace to clear the tabs, and then press TAB a series of times, it correctly indents with spaces.
I'm pretty sure I have all my settings set up correctly. I created a new Code Style > Formatter policy for every language in the project, and specified to always use spaces. It seems as though these settings are partially active (ex: when I press tab), but inactive when I use return. I tried restarting Eclipse. I'll try restarting the computer now...
I'm using Mac OS X 10.9.2 and a Liferay Developer Studio (1.6.3.v201312111844) version of Eclipse (not sure which Eclipse build its based on though).
Can anyone think of another setting/solution to ensure that newlines are created with spaces instead of tabs? I recently saw http://editorconfig.org/, and I'm wondering if there's some interference.
Thanks for any suggestions
If the file has existing lines that are using tabs, then Enter will respect that and try to create new lines in a similar way (see this comment by topchef for a solution). Also, it could be something in Liferay Studio's proprietary settings is overriding Eclipse standard preferences (as suggested by user John).
Keep in mind that each type of editor in Eclipse can have its own preferences and perhaps that's what you're running into here. You can try to find them all by opening Preferences and searching for "indent" in the search field. That will show all the preferences pages where indentation can be configured.
Also note that the Formatter settings don't have any affect on as-you-type formatting; that's for when you select a file or group of files or part of a file and choose Source > Format from the menu.

.scss.erb extension syntax highlighting for scss in aptana/eclipse

If I have some eRuby in a scss file, I need to make the extension *.scss.erb. However, doing so causes the sytax highlighting for *.erb rather than *.scss. Is there any way to get eclipse to determine the syntax highlighting more intelligently or at least allow manual syntax assignment like in notepad++?
The only workaround I've found so far is to rename the file *.scss, open it, then rename it back to *.erb so it gets processed correctly later on.
There should be.
What you would do is go to Preferences > General > Editors > File Associations and set the default editor for your *.scss.erb extensions, however there's a bug in Eclipse that prevents file associations with more than one period:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=168573
The way I get around the issue is by right clicking the source file in Project Explorer and going to Open With > Other... and selecting Sass Source Editor from there.

How to disable MyEclipse visual HTML designer

My computer lags for several seconds when I open an HTML file in MyEclipse, or make a major change to a file that's already open. I suspect that the WYSIWYG part of the visual HTML designer is responsible; is there a way to turn that off but retain the color-coded text editor/formatter? I also don't care about the "preview" feature, if that makes a difference.
I have faced the same issue. Go to Window > Preferences > General > Editors > File Associations and pick the file extension for which you would like to disable/enable the designer. Hope that works for you.
Make Default MyEclipse Jsp Editor for opening jsp files without Visual Designer
Go to
WIndow > Prefs > General > Text Editors > File Associations
1-Click on File Associations -
2-select file type for whom you want to change Editor-
3-Select Myeclipse Jsp Editor as default
Same way you can adjust any files types Editors
adjust the default editor for the file types like .jsp, .jspf, .jspx and so on to use the non-visual editor.