Double click text selection in CFEclipse - eclipse

In CFEclipse, I do a lot of double-clicking to select text. The standard behavior is to select all text within the nearest word boundaries. This is problematic when editing code where the original editor didn't use camel-case; for example, they wrote "myObject" as "my_object".
Is there a way to change the double-click selection behavior to include '_' as a valid word character?

In the latest version of CFEclipse, there is now the option to define what characters are considered word boundaries when double-clicking, and also the option to use different characters when using alt or shift keys.
In Preferences, goto CFEclipse > Editor > Text Selection to update this:
(source: bpsite.net)

CFEclipse does not recognize either the underscore or a period as a character for selecting text with a double-click. There is no way that I know of other than rolling your sleeves up and hacking the editor code to change it. I doubt that this will be changed any time soon with the impending release of Bolt from Adobe.

On eclipse 3.4.1 Ganymede, it seems to select the nearest boundaries including the '_' (at least in the java file I am using)
What eclipse version are you using ?
This blog even reports that eclipse3.3 does select word as you are expecting it...
vs.

Related

Add parentheses around C-expression in Eclipse

Is there a way to select a C/C++ expression in Eclipse and put a bracket around it with a single keyboard shortcut? IDEs usually have this but I couldn't find a way in Eclipse.
For Java Code, there is a more or less good workaround described in Parentheses over selected words in Eclipse, but this does not work for C-Code - after bringing up the template list for the selection, the suggested templates are empty.
As far as I know, exactly that is not possible. You might report it to Eclipse CDT as a feature request.
But as workaround a template like the following can be used:
(${line_selection})${cursor}
If you hit Shift+Alt+Z the Surround With Quick Menu shows all templates containing ${line_selection} and with a number key a templated can be selected.
The key Shift+Alt+Z can be changed, but unfortunately no key can be defined to select the template directly. Also unfortunately, this does not work for multi-line selections because everything in the template in the line before ${line_selection} will be applied to each selected line.

Unicode support in Eclipse GGTS IDE editor (how to input unicode math symbols)

I would like to deal with floral formulae by my DSL coded in groovy, so I need some special symbols such as female sign and Superscripts and Subscripts.
Thanks to the great answers that I found on stackoverflow questions like this now I'm able to
insert special unicode symbols in source code in VIM (MacVim) this way:
CTRL+V. U 2 6 4 0.
However, I would like to be able to do the same in Eclipse IDE (I'm trying to use Groovy/Grails Tool Suite Version: 3.1.0.RELEASE to develop a grails project)
Question: How can I insert in the Eclipse editor a 4 digit unicode symbol by knowing the encoding ( without cut & paste from another source) ?
There appear to be a few ways to get the unicode characters on a Mac. The first few don't appear to be what you want exactly, but included for completeness.
1) Make sure System Preferences->Keyboard "show keyboard & character viewers in menu bar" is selected. Then you can click on that (normally accessible via option+cmd+T, but not in eclipse) to get the Character Viewer. You can then double-click a special character you want and it should insert at cursor.
2) Under the default setup, you should be able to click Option + key to get an alternate character. Use the keyboard viewer from #1 to see what maps to what. Note you can switch to some more mappings using Shift at the same time. This will only get you a subset of unicode characters.
3) From here: Under System Preferences->Languages & Text, go to Input Sources tab. Select the Unicode Hex Input source. You may need to assign switching input sources (under System Prefs->Keyboard->Keyboard Shortcuts->Keyboard) to a hotkey combo (default probably conflicts with spotlight, so change to something else). After that, you should be able to use said hotkey combo to switch to the Unicode Input Source - in that mode, you can hold Option down and enter a hex 4-digit key code, which will result in the character being placed at cursor.

Configure Eclipse word-boundaries so 'Next-Word-Key' skips whole identifier

If I have a piece of Code
MyIdentifierIsNice(OtherThingAlsoNice isBetterThen);
I'd like to change the behavior of Ctrl-Left in Eclipse from stopping here:
My|Identifier|Is|Nice|(|Other|Thing|Also|Nice is|Better|Then|);|
to here:
MyIdentifierIsNice(|OtherThingAlsoNice |isBetterThen);|
...or at least just not so often. Other variants would be also fine, like:
MyIdentifierIsNice|(|OtherThingAlsoNice| isBetterThen|);|
Mainly it should stop considering a CamelCaseIdentifier to consist of several words for navigation via Next-Word, and such like.
I use SpringSourceSuite Version 2.5.1, which is Eclipse 3.6, I guess.
Try and unselect the option:
Preferences / Java / Editor / Smart caret positioning in Java names
And see if that enhances the user experience in term of cursor positioning.
If this is not Java, you have a similar option in:
Preferences / General / Editors / Text Editors / Smart caret positioning at line start and end
It is usually selected, meaning if the cursor still stops at every word, that may suggests another setting for a specific language is overriding it.
Coming to Eclipse from XCode, I found the default navigation annoying. In Eclipse, Alt+Left and Alt+Right move to the next camelcase segment, and Ctrl+Left/Right does nothing. In XCode, Alt+Left/Right moves between words and Ctrl+Left/Right moves between camelcase segments. This allows you to control how fine-grained your navigation is.
How I fixed this for myself was by going into Preferences > General > Keys, searching for "Word", and changing the "Next Word" and "Previous Word" bindings from Alt+Left/Right to Ctrl+Left/Right. Then the Alt-navigation is by word and the Ctrl-navigation is by camelcase segment, as in XCode.
I thought this might be useful to some.
Edit:
As I continue to use these new settings, I've found another point:
Although navigation works as advertised, selection has some funky behavior. Namely, Shift+Ctrl+Left/Right can sometimes select large blocks of text instead of just the next camelcase component.
To fix this, again go to Preferences > General > Keys, search for "Select".
Set "Select Next/Previous Word" to Shift+Ctrl+Right/Left.
Unbind "Select Next/Previous Element" (there are three "Whens" to pick from, I unbound all 3).
Voila.
If you want a very simple way to select a entire word without the need to disable smart caret positioning.
You can use at the beginning of word or inside the word:
Shift+Alt+Right
At the end or in the middle of word:
Shift+Alt+Left

Eclipse: Can you put your cursor on all lines?

In IDEA you had the possibility to put your cursor on all lines.
Is this possible in Eclipse?
Eclipse 3.5 should have a column mode (which is what I think you're asking about) - use Alt+Shift+A:
http://update.eclipse.org/downloads/drops/R-3.5-200906111540/eclipse-news-part1.html#Text
I haven't tried this since I'm stuck at version 3.4.1 for the time being. There's a patch that claims to work for 3.4.0 (http://tkilla.ch/column_mode/), but it's not working for my 3.4.1 install.
If you refer to the ability to select a group of lines (like a all function), you can use the outline view
alt text http://publib.boulder.ibm.com/infocenter/radhelp/v7r5/topic/org.eclipse.jdt.doc.user/whatsNew/images/drag-and-drop-outline.png
From there, you can move/rearrange/delete all block of text.
If it is about column mode, see my answer here.
alt text http://update.eclipse.org/downloads/drops/R-3.5-200906111540/images/block-selection-mode.png

Hungry Backspace in Eclipse?

In some editors there exist plugins implementing a feature called "hungry backspace" or "hungry delete".
If this mode is active in a text editor then one hit to the backspace key will automatically delete all whitespace chars backwards from the current cursor position up to the first non-whitespace character.
For example, this feature exists for Emacs and IntelliJ IDEA.
Does anyone know if it is also available in Eclipse?
Alt-Del is probably as close as you're going to get without writing a plugin yourself. Others have asked for this feature (coming from intelliJ) but so far it doesn't exist, or it's not published.
-Adam
CTRL-backspace is pretty close too: delete previous word:
function(); (4 spaces)
+ CTRL-BACKSPACE gives:
function
Other than that, AnyEdit plugin can convert trailing spaces into tabs (but also into "", effectively removing them)
Ctrl+Shift+Left, Backspace always works for me. works in notepad, web browsers, everywhere.
Stick to the standards :)
In SciTE, and Eclipse (3.4), Ctrl+Shift+Del with the caret after the last visible character will delete these spaces. Ie. it deletes from caret to end of line.
Actually, in SciTE I don't need to do that, since I have set it up to automatically remove these trailing spaces when saving.
Note: In Preferences > General > Keys, there is a Remove Trailing Whitespace binding (without key assignment by default) which seems to apply to File.
From eclipse Windows menu/Preferences
Search for Keys and filter to "Delete Previous Word"and Bind it to the Ctrl+Backspace