Eclipse indents new line with tabs instead of spaces - eclipse

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.

Related

How to enable again the tooltip/hint in VSC?

My VSC shows the wavy underlines when something's wrong with my code, but does not display the hint overlay when I hover my mouse on it.
This happens whatever the language used (from CSS to Typescript) and whatever the type of irregularity (e.g. notice, warn, danger)
I'd say that's a setting I may have changed at some point, but can't find which one. Any idea?
More details:
I do have the message displayed in the Problems tab besides to the Terminal, but it forces me to switch from tab to tab ;
I do have other overlays like autocomplete/autosuggest ;
No extensions in my setup could have led to that situation (only a few installed, widely downloaded, nothing fancy or dodgy).
Actual behavior (nothing happens):
Expected behavior (from google images)
Go to File > Preferences > Settings.
Search for 'hover.enabled' (See below photo).
Toggle it.
If your editor still does not pick up the change, close all tabs, close all VSCode windows, and reopen it.
If it's still not working, try uninstalling VSCode and reinstalling it (make sure you don't have setting sync on).
Also, this question has been answered in at least one other place (Disable tooltip hint in Visual Studio Code)

Lost column/line fields in the status bar using Eclipse

I used to see the line and column (character count) in the status bar of Eclipse (actually Precision32's version of Eclipse), but somehow it went away. According to the Eclipse UI guidelines it's supposed to be there:
Editors with source lines of text should show the current line and
optionally column numbers the status line. It's optional for the
editor to show line numbers for each line in the editor itself.
But I can't find anything that tells how to turn it on. I didn't update my editor, AFAIK.
Edit:
The editor is active.
I have no idea what happened, but it started working again. Might be when I installed Juno eclipse, maybe some register settings in common were touched? I hate doing a re-install to fix a problem as you lose settings and it isn't getting to the root cause, but for this round I'll have to accept it.

Notepad++ AutoSave issue

It looks like Notepad++ as of ver. 6.6.7 is now actively blocking the AutoSave (ver. 1.4) plugin.
Notepad++ will remove AutoSave when upgrading and re-loading AutoSave with the Plugin Manager now fails.
Live and die by the ability to make a quick .PHP script change and switch over to the browser window without having to remember to click on the Save file toolbar icon.
Any suggestions or alternatives?
OK, found the solution.
Rather than relying on the Autosave version downloaded by Plugin Manager, go to the link listed -- http://sites.google.com/site/fstellari/nppplugins -- and download v1.40 from there.
The zip file will have 2 versions of the dll (A for ASCII and U for Unicode ?). Copy the AutoSaveU.dll file to "C:\Program Files (x86)\Notepad++\plugins\" and you should be back in business.
Update: After running for a few days with Autosave enabled, found that automatic spell check and the ability to right click on a word or phrase would randomly disappear. Disabling "Auto Save when Notepad++ looses focus" solves that problem. For now, have decided that spell check and right clicking are more important than auto-saving.
I have found the best solution to this, if you install notepad++ and use 'Resource Hacker' (google it) to change the menu (cut it down) and the icon (change to notepad), and install the autosave plugin in notepad++, then you have something that looks almost entirely indistinguishable to classic notepad! And txt files have the notepad logo.
Also you need to go into settings and turn off a bunch of settings, including under editing tab, turn off line numbering, and change colours in 'style configurator'.
The only notable difference is that highlighted text remains black.
Check out this image to see how close it is, you could even cut and rename menu items to look identical but there is no need to be that pedantic.

all spaces replaced by tabs when ctrl+shift+f

working in eclipse,when I type 'tab',it insert 4 spaces,it works well.but after ctrl +shift +f to format,all the 4 space will been replaced by tabs.how to stop it?
Window->Preferences->Java->Code Style->Formatter: Edit Active profile->Indentation->Tab Policy: Select Spaces
You can't change the default profiles so you must provide a new profile name, then press the Apply button, then the Okay button. It may help to press the Apply button once you have returned to the Formatter screen. Go back and look at the Tab Policy again to verify that your changes were saved.
Including the above suggestions, I recommend searching for code style or style to get to the coding standard being applied with the user requests formatting of the code. It is possible that the code style uses tabs instead of spaces.
The only way that currently works is to use Ctrl-A Ctrl-X Ctrl-V on all code after using Ctrl-Shift-F. This will replace all tabs with spaces.
Don't know which version of Eclipse you are using but for
Eclipse 3.6 (for example) you may go to
Window->Preferences->General->Editors->Text Editors->Insert spaces for tabs
This will change Eclipse to use spaces instead of tabs
The place in the Preferences may be different depending on which version of Eclipse you use. If you load the preferences window you can use the search function there to find "Formatters" and set your preferences for different types of files, or generally.

Tab vs Space indenting (Dreamweaver vs NetBeans) problem

I use Dreamweaver at work and NetBeans IDE at home, but in both cases project is stored at github. My problem is that NetBeans seems to be constructing code indenting out of spaces and when opened in dreamweaver or exported to github, indenting here and there breaks (moves unexpectedly further then it was intended or vice versa), although when opened again in NetBeans, goes back to normal. It has been pain for some time already. Is there any resolution to this?
I should say that we at work (and me including) prefer tab indenting.
It depends on the IDE's definition of a TAB. There are usually options within the IDE to indent using a TAB but turn the TAB into a given number of SPACES. I usually indent using TAB but have the IDE turn that into 3 SPACES. This means that it doesn't matter what I (or anyone else) use to read my code later the indets are always the same.
In NetBeans you need to look in the Code Editor options but I have no idea where to find the settings in Dreamweaver.
Its been known that one should use double space rather than tab, because that fact that different IDEs define how the tab button works DIFFERENTLY.
For example, emberjs team require contributor to use double-space rather than tab for formatting the code.
It make sense that to use something recognized in common without an IDE, so that the code structure will not be a problem in a highly collaborated coding team environment.
HOWEVER, if customization of how a tab works in an IDE is enabled, tab will be a great time saver in this case-- Press twice the button cost 200% of the time to press one obviously :)
Hope that helps!