Does the textmate vertical selection feature exist in Flex Builder or Eclipse? - eclipse

In textmate on OS X there is a handy feature when you select text.
If you hold the option key down the cursor turns into cross-hairs and you can select a vertical column of text and paste it back as a vertical column with the lines rows preserved.
Does Flex Builder or Eclipse have the same feature? Not sure what to call it.
If so, what is the key combo?

In Eclipse it is called Block Selection Mode and available in the newest version 3.5 (Galileo). The key combination to toggle it is Alt-Shift-A.
In Emacs this is called a rectangle and the commands working on these are called *-rectangle, e.g. kill-rectangle.

Just same Alt-Left MB and drag a selection box

It should be possible from version 3.5 and above using ALT+SHIFT+A. See here.

Related

How to do multiple line editing?

I want to edit multiple lines in eclipse, but I can't find any short cut or Plugin. In Geany I just press ctrl+alt+up/down I can add / edit multiple lines.
Maybe this example can explain what I mean:
var text = "myname";
var addr = "myaddr";
var age = "myage";
I want to edit text above into:
var my_text = "myname";
var my_addr = "myaddr";
var my_age = "myage";
The text above is just a simple example, but sometimes I have many lines of words that I have to edit its prefix.
Press alt + shift + A to Toggle block selection (Toggle block / column selection in the current text editor), this will let you write vertically in eclipse, then you can easily do this.
Go to Window->Preferences.
Find for binding in text box surrounded by red box.
On OS X, the key combination for multi-line edits in Eclipse (or STS) is option/alt+command+A
You can try the following plugin,
https://github.com/caspark/eclipse-multicursor/releases
With this multiple occurrence of same text can be selected and edited. This is similar to multi select functionality available in editors like Sublime and Visual studio code.
The Eclipse 4.24 (June 15 2022) will integrate it (See https://bugs.eclipse.org/bugs/show_bug.cgi?id=576377):
Multi selection down relative to anchor selection (e.g. Ctrl-Alt-J)
Multi selection up relative to anchor selection (e.g. Alt-J)
End multi-selection (e.g. ESC)
Add all matches to multi-selection (e.g. Ctrl-Shift-Alt-J)
Multi caret up (e.g. Ctrl-Alt-Shift-Up)
Multi caret down (e.g. Ctrl-Alt-Shift-Down)
Thanks to eclipse contributor !
The Eclipse 4.22 (Q4 2021) equivalent of Geany would Alt+Click on the lines you want to edit in one go.
Eclipse now supports
Multiple text selection
Support for multiple selection has been added to Text Editors.
Multi selections allow most edit operations (text replacement or insertion, extend selection to next word or to next line, copy/paste...) to apply simultaneously on all ranges.
Multiple strategies are available to enable multi-selections:
Turn a block selection into a multi-selection using the To multi-selection command,
Add a caret with Alt+Click,
Use the new Select All button on the Find/Replace dialog.
So check if this would work in your case.
I know this is an old post, but I still want to share my way of multi select and editing. However this way is restricted to only the same variables across the file. Simply highlight the variable to edit, right click, choose Refactor->Rename. Then edit the variable and it will also edit the same variables across the file. Hope it helps..:)
Press key - { Alt + Shift + A } You will see A [+] symbol in IDE then use this symbol as drag

What's my current cursor position?

This is not an Eclipse-programming question, but rather a question about the Eclipse user-interface in general.
I am writing a verilog source-code in an Eclipse text-editor using the simplifIDE plug-in. I want to align my code so that variable names always start at offset 33 (32 spaces from the left margin)
Does Eclipse have an option for displaying the current cursor position in a status bar? I'd even be happy with a keyboard shortcut that would pop the current cursor-position up in an dialog.
In the absence of a solution, I'll set my tabs to 4-spaces, and put the following text at random places in my file:
//..5...9...13..17..21..25..29..33..37..41..45..49..53..57..61..65..69..73..77..81..
Some editors (such as the built in Java editor) display the current insertion point location in the status bar. However, if you use a third-party editor sch as SimplifIDE, you may have to check its own configuration for that option.
If you write your own editor, you could ask the editor to give you the selection provider, as the selection provider can also provide the current insertion point location.
Using Eclipse 3.5 with the SimplifIDE plugin, I am seeing the correct information for the line and column on a status bar on the bottom of the screen with a {line : column} format using either tabs or spaces.
thedeserthorizon, Are you using 3.5 and the version 1.0.26 of Simplifide.
There is a new API in 3.5 which allows you to listen to cursor movements (see this bug). Then, you can ask for the index of the first character in the current line and subtract that from the absolute cursor position. This gives you the offset in characters.
This is not accurate though; if your editor supports real tabs, then you must query the editor for the current line and count characters yourself (where the tab counts as 2..8 character positions).

Is there an Eclipse line-width marker?

I have a specific project where I need to wrap every code line at 65 characters. I have set up the eclipse Java code formatter properly for this. But what I really want is a vertical line to be drawn in the editor showing where the max line width while I am typing, not just when I run the formmater. I know this feature is available in some capacity because it is displayed in the code formatter property page.
I don't see any option in eclipse to turn this on and I didn't see any plug-ins that do it on Eclipse Plugin Central
Look in Windows / Preferences (at least on Windows - IIRC it moves around for different operating systems) then:
General -> Editors -> Text Editors -> Show Print Margin
Tick this and it should show the line.
As a quick way of finding this, use the search filter in the top and filter on "margin".
Notes from the comments - unverified by me, but I have no reason to doubt them:
It has changed somehow in 2016: For details see [here] (https://bugs.eclipse.org/bugs/show_bug.cgi?id=495490#c2) You have to set it in the formatter: From menu [Window]-->[Preferences], select [Java]-->[Code Style]-->[Formatter], and then edit your formatter profile. In the tab page [Line wrapping], you can find a setting named "Maximum line width". Change this setting, and the print margin in Java source editor will be changed too.
In Eclipse Luna (4.4):
Choose menu Window\Preference . Look at top-left corner, in search box type filter text, type: margin.
In section Apperance color option, Choose Print margin. Choose Show print margin. In text box Print margin column , type 65 as what you want.
#Jon Skeet's answer is incomplete.
(1/2) First, do what he said:
Window --> Preferences --> General --> Editors --> Text Editors --> check the box for Show Print Margin
Ticking this box will show the vertical line.
As a quick way of finding this, use the search filter in the top and filter on "margin".
However, this only shows the line, but under most situations the "Print margin column" value there is flat-out ignored.
To set the column number for where the line should be, do what #John Percival Hackworth mentions here:
(2/2) Go to:
Window --> Preferences --> C/C++ [or whatever language you are using] --> Code Style --> Formatter --> click Edit --> under the Line Wrapping tab set the value you desire for Maximum line width.
Side note:
Use Alt + Shift + Y to toggle soft line wrapping on and off. It will soft wrap (ie: no carriage return) at the end of the screen, however, not at the column you set above.
How do you enforce hard line wrapping at the column you set above (ie: that adds a carriage return)? I don't know yet. If you figure it out let me know. In Sublime Text 3 (a much better editor but with a much worse indexer/function definition finder :() it's Alt + Q.
Update: I think it may be possible with the "CppStyle" plugin, which uses clang-format, by using Ctrl + Shift + F to apply the auto-format, but I don't know the exact instructions to make it work yet.
Related:
Set tab width: Changing editor tab width in eclipse 3.5
After some months with Espressif, but also with other brands plugged-in Eclipse, I found how to enlarge maximum line width. I made a lot of attempts and show how to do for Espressif-IDE:
Right click a project->properties->C/C++ General->Formatter
->Enable Project specific settings->
New->Give your profile a name and base it on a built-in formatter: I choose BSD/Allman->Edit this new profile->within Line Wrapping tab type for example 200 for Maximum line width->Apply changes.
Format source files: you'll have long lines.
Before I did the same manouvres starting from:
Window->Preferences->C/C++->code Style->Formatter... : that never worked.

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

Double click text selection in CFEclipse

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.