How to highlight the selection in Emacs keybinding of Eclipse? - eclipse

I have searched the Web for this, but with no luck. Any idea?
Thanks.

Try using the Emacs+ plugin available here:
http://www.mulgasoft.com/emacsplus
It provides a HUGE range of functionality - including the selection highlighting that you're looking for - that really helps the move from Emacs. I've only been using it for a couple of days, but it appears stable and integrates very well with the editor.

As described here, you can set emacs key binding to work in component editor in Eclipse
Go to Preferences -> General -> Keys.
Change Scheme to Emacs if you haven't done so already, so you can easily
spot the emacs key bindings.
Sort by Category and look at the "Text Editing" categories
Find the commands that you care about, e.g. Next Column, Previous Column
Select that command and click "Copy Command"
Set the binding to the key by pressing the keys, e.g. press Control-f to
generate "^F".
Change "When:" to "Editing Components".
Repeat for all the key bindings you care about.
So if, in emacs, selection is done by setting the mark (Control-Space) at the start of the region, then moving the point to to the end of the region, you could associate the appropriate shortcut to:
Text Editing > Select Text Start
Text Editing > Select Text End

Related

IdeaVim: Make Cmd-A (macOS) select all text in visual mode

I want Cmd-A (the macOS Command key, plus A) to select all text in visual mode, so I can e.g. indent or delete it using vim commands, Just like it does in MacVim. By default, it selects all text, but vim commands don't work on it.
I've put the following in .ideavimrc:
map <D-a> <esc>ggVG
And also removed the default Cmd-A shortcut in Preferences -> Keymap, because it seemed to override the vim one. But now Cmd-A just doesn't do anything.
I've found two workarounds so far, neither very satisfying. For both start out in normal-mode.
ggVG
press v followed by Cmd-A
<D-*> mappings are not supported in IdeaVim yet. Feel free to vote for VIM-758 and contribute a fix to https://github.com/JetBrains/ideavim.
Edit: You can check your effective mappings in IdeaVim via :map.
Edit 2: I've checked <M-*> mappings in IdeaVim 0.50 in macOS. They do exactly what you want, but with <M-*> instead of <D-*>. In my experiment, I've remapped dd to Command-A via:
map <M-a> dd
Important: the first time you open the IDE afterwards, there is a notification: "Using the shortcut from vim emulation. etc." Do not click the link in that notification, otherwise it will not use your shortcut defined in .ideavimrc.

Select text from keyboard in matlab

In emacs, it's possible to set a mark with c-space. The mark marks one end of a selection then when you move the cursor the other end of the selection moves with it.
For example, c-a, c-space, c-n, c-n selects two lines of text.
Matlab doesn't seem to have the concept of placing a mark. Is there any way to select text from the keyboard?
I'd like to do things like whack/yank a few words or comment out multiple lines without using the mouse.
I found this old question while trying to figure out the same problem. If anyone out there is still looking for how to do this, Matlab (as of version 2016a) supports keyboard selection shortcuts in the keyboard binding preferences (Preferences --> Keyboard --> Shortcuts). By default the text select functions are using the Home/End and Ctr/Shift + arrow keys to do this. I don't think the Emacs marking concept works but you could define a shortcut to your liking.
Matlab Emacs Keyboard Binding Defaults
At least you don't have to use the mouse :-)

Eclipse - multiline comment with asterisks doesn't work

I'm not able to use ani shortcuts for using comments with asterisk. Every key combination doesn't work. I tried with CTRL+/, CTRL+SHIFT+/, CTRL+C; all of these have the same output, i.e. a simple comment with // on every line. Other shortcuts like CTRL+\, CTRL+SHIFT+\ or CTRL+SHIFT+F doesn't work at all.
So, how can I have this shortcut?
These are the Comments options
Open Window>Preferences>General>Keys>type "add block comment" in the search box, you should see:
the type "remove block comment"
These settings are by default, but if the shortcut is not working on your machine, you must be missing these bindings, To create them, you need to mark the command "Add Block Comment", then click inside the "Binding" field and press CTRL+SHIFT+/, then press Apply. The same is for uncommenting.
I have a similar problem to the one you have: the / shortcut seems to trigger a folding operation (at least in the Java editor) that does not appear in the keys preferences table.
Modifying the key in the keys preferences table seems to work fine: setting the binding to Shift+Ctrl+Q for the "Add Block Comment" command sets the expected block comment.
The reason is clear to me: the Shift+Ctrl+/ binding is very difficult to reproduce in a Linux environment because Eclipse makes a clear difference Numpad_Divide and the '/'. The Normal '/' strike is being modified by the shift key (French keyboard).

Eclipse: Can You Hit A KeyBinding To Find The Command It Is Bound To?

I'm new to Eclipse. Is it possible in Eclipse to hit a keybinding and find the name of the command it is bound too?
For example, pressing Ctrl+Shift+R and have something like "open-dialog" come up in a list telling me that Ctrl+Shift+R is bound to the command "open-dialog".
Unfortunately, Eclipse doesn't make this easy. (Related note: IntelliJ IDEA does.) There are a few things that might help you out, though:
In the Eclipse settings for key bindings, you could do "Export to CSV". Then you can search that document for key combinations.
Also in the Eclipse settings for key bindings, you can sort the "Binding" column. The list is unwieldy to scroll through, but the ordering of multi-key combinations seems to be well defined so you could eventually find the key combination you're looking for.
If you want to look up a common command without going into the settings, you can assign a keyboard shortcut to "Show Key Assist". You can't sort the list by key combination, but it's at least a relatively short list to look through.
Windows > Preferences > General > Keys
You can TYPE ( not press ) the name of the keys, it will sort the list by the name of the keys
Going by the original wording,
pressing Ctrl+Shift+R and
have something like "open-dialog" come up
it sounds like the Show key binding when command is invoked -> Through keyboard option in the Keys preference page would at least partially do what you're looking for:
This will bring up a toast-like overlay each time you press a key combination that's associated with a command. It will show the command name and a more detailed command explanation, if available.
However, the overlay will only display for a few seconds and then disappear, i.e. an onlooker might miss it if they are distracted by other activities on the screen. I don't think that there is a way to display this information "in a list", i.e. in a more permanent fashion, but I think that this would be a great feature to help developers learn new keyboard shortcuts in a pair programming environment.

Eclipse jump to next/previous marked occurrence

As was asked previously, Eclipse has the nice "mark occurences" feature, which shows all occurences of the selected variable or method.
But I don't know any shortcut for jumping to the next/previous occurence in the editor.
The shortcut ctrl+k is not working, it solely works in conjunction with "incremental find" (ctrl+j).
I'm using Eclipse Indigo. Is there any shortcut or other solution?
Edit:
The answers and comments in the question linked above are now pretty exhaustive, I think.
It seems there is no all-in-one solution (at least for Java code editing):
I cant get Ctrl + (period) to work, at least in Java code where it finds the next problem. Even rebinding this to a different shortcut does not work.
Ctrl + K does text-based search only. If you want to find all occurrences of the variable i, it finds any letter i within any identifier and comment.
Renaming mode using Alt+Shift+R and then navigating through the occurrences using Tab and Shift+Tab comes close, but only works for identifiers you can actually rename for that source file. It does not work for library code (esp. JDK) for which no editable source is available.
Try Ctrl + , and Ctrl + .
Before that make sure you have checked Occurences in the small navigation dropdown:
You can change the key from Window -> Preferences -> keys:
It works for me.
You can find if your key bindings have changed by looking under Window -> Preferences -> General -> Keys and look for the command Find Next. You will see the binding in the column Binding and can also check if it's conflicting with something else in the list titled Conflicts: at bottom right corner of the dialog.