Exact duplicate shortcut from Eclipse in Intellij IDEA - eclipse

I am an eclipse-only programmer.
Now the time has come that I want to try out intellij IDEA to see if it may even suit me better than eclipse does now.
I have some essential shortcuts which I need to work exactly the same as I am used to. And as far as I see, that's not possible. But maybe you guys know it better.
1) Moving lines up and down
In Eclipse I use ALT + UP and ALT + DOWN:
the alt up/down could be done by IDEAs "move down/up" commands in "other":
but they behave differently. Unfortunately "too smart" I'd say... as they keep track of blank lines and skip these, and even carry comments with it. I simply want to move only the selected line, up or down, simple as that.
Example:
results in
and when moving it up or down in Eclipse. In Intellij IDEA this happens:
2) Duplicate Lines up and down
In Eclipse I got these shortcuts, on copying up and the other copying down:
In Intellij IDEA I'd use the "Duplicate Entire Lines" under "Editor Actions", and this suits me very well. BUT: I only can use one direction, up or down, as this command only exists once. I need both... :(
Thanks for any help!

IntelliJ IDEA has Move Line Up/Down and Move Statement Up/Down actions. The latter is smart, the former is dumb. Assign shortcuts and use whatever you prefer.
Vote for this request or use this third-party plug-in.
Plugin for IntelliJ IDEA to allow copy lines and block of code like in
Eclipse IDE (Ctrl+Alt+UP and Ctrl+Alt+Down).

Related

How do you make Eclipse not edit all the occurrences found by "Find Next"?

When I use Cmd+K to go to the next occurrence of the selected word, Eclipse leaves behind these red "cursors" right before the copies of the word that I navigate through. If I then edit the last occurrence that I find, Eclipse "helpfully" edits all the occurrences that I've navigated through in the same way. This leaves corruption in parts of my file that I'm not currently looking at, which is really infuriating.
I want to disable this "feature", but I haven't got a clue what to call it, so I don't know how to find the setting that turns it off. Searching the Eclipse preferences for "occurrence" only gives various versions of "Mark Occurrences" for each editor plugin, which doesn't disable this behavior when unchecked.
EDIT: Here's a video displaying the behavior I'm talking about: https://youtu.be/8xeKRLyGSLg
This isn't really given by PyDev, it's a feature added by LiClipse (http://www.liclipse.com/multi_edition_video.html).
After the link is done with Ctrl+K, you can press ESC to remove those links if you don't want the multi-edition to happen (so that when you edit one occurrence you don't edit the others).
I must say this is the first request to have that turned off... I'm pretty certain as I just took a look and there's no setting to do that -- so, unfortunately, until the next release, you have to either live with it, remembering to press ESC if you don't want the multi edition to happen or use a plain Eclipse install with PyDev, but you'd also be without other LiClipse benefits, such as textmate bundles, vertical indent guides, theming integration, etc.
Still, note that ideally, I'd say you should get used to it as it can be a real time-saver -- although I'll implement the setting to turn it off for the next release anyways, as it's something that should really be there ;)

Eclipse keyboard shortcuts won't work

I am using Eclipse Juno, and none of my keyboard shortcuts (e.g. Crtl + *) function at all. I checked in preferences and they're all still set they just don't do anything. This is really annoying, particularly with very commonly used ones like undo and redo. Does anyone have any ideas on how to possibly fix this? Thanks!
The problem's solution ended up being pretty simple, kind of similar to the question linked by #Apprentice but not quite, apparently whoever had been using the program before me linked CTRL+Z to another command as well as undo, so I went to (Window->Preferences->General->Keys) and unlinked it manually, now it appears to work.
One of the common issues (if you're using Windows) is accidental swtich of keyboard layout by pressing [ctrl]+[shift]. You can try using this combination again to see if it helps.
If it doesn't, you may want to have a look at this question: Undo shortcut not working in Eclipse

Why is the "Mark Occurrences" feature in Eclipse automatically disabling itself?

I never had this issue with Eclipse before (Eclipse Classic 4.2.2, Indigo) but it started happening on my new iMac recently, that it stops highlighting similar occurrences or variable names, etc. Then it automatically starts working just fine.
Needless to say its a pain when it doesn't show the multiple occurrences of variable names and I have to find them using Find.
I was wondering if there is a sequence of keys which I press by mistake which causes it? I haven't find an answer to this anywhere else yet.
Attached is the screenshot from the Preferences. As I edit this question, again the Mark Occurrences is greyed out and I'll have to check it again to make it work.
A work around for this is to click on e.g. the Outline view, and then click back on the editor. The mark occurrences should start working again. I don't know of a long term fix.

Eclipse Quick Fix "I am feeling lucky"

I absolutely adore Eclipse's Quick Fix functionality.
It is so useful, so smart, just so well implemented.. it could use a "final touch of nicety" as far as I am concerned: an "I am feeling lucky" shortcut.
If COMMAND/CTRL 1 gives me a menu of Quick Fixes to choose from.. I'd like for something like COMMAND/CTRL SHIFT 1 (I need to think a proper shortcut for this) to immediately choose the first (highest likelihood of being right) fix and implement it for me.
Can I already do this with existing features that allow keyboard shortcut customisation?
This is inspired by just how good the current guessing and ordering of options is. It is so good for me that most of the time I wanna choose the top option. I think any "I am feeling lucky" which can be undone by COMMAND/CTRL Z is a good candidate to being done with one click? I would exclude, of course, the changes that bring up a "choice dialog", like previewing source code changes with potential adverse side-effects..
That's not possible with Eclipse built-in tooling. There are some workarounds, that might fit your needs:
Use some kind of keyboard macro tool (independent of Eclipse) to play the Ctrl1, Enter sequence when you hit your combination of choice.
Some quickfixes can be assigned a keyboard shortcut in the keyboard preferences of Eclipse. So you could choose certain quickfixes directly (but not as the top suggestion).
Some quickfixes are also available as save actions (for example "organize imports"). You should activate all those in the save actions, as you can then run them by just saving the file.

Validate Autocomplete in Eclipse

Coming from Visual Studio and starting a project in Java, I realized I couldn't cope with having to press ctrl+space to have the autocomplete panel show up. An easy workaround was to set all keyboard characters to be trigger characters for autocompletion.
My only problem is that, when presented with autocomplete suggestions, a single press on the space bar will write the first proposition. In situations where I'm happy with the suggestions, that's just fine. In situations where I actually want to use what I wrote down initially, I have to press 'escape' first to remove the autocomplete panel before I can press 'space' safely.
Netbeans doesn't use the space bar as a validating key for autocompletion (only 'enter' does that) and I like that behavior. Any way to replicate it in Eclipse?
Thanks in advance for your answers!
EDIT: I should have mentioned I'm using Eclipse on the Mac.
Guillaume
I have the same problem with Eclipse Indigo on Windows XP actually. Coming from intellij idea, I also felt the need to set the whole keyboard to trigger auto-complete.
A quick proof that SPACE key does accept suggestions : type inte on a new line. If the auto-complete menu shows, press SPACE. It goes for Integer.
If anyone knows how to set the SPACE key to "ignore suggestions", it would be great, because the escape key on my keyboard is also too far away :)
Thanks
Edit : actually the best would be to have only the ENTER key validating, because ';' and '(' also seem to validate
I just tried to reproduce your behavior, but couldn't. Here is the configuration I have (and the steps I have done to reproduce):
I have installed Indigo (current version of Eclipse, version number 3.7).
I did not change any configuration there, this is what is the default:
Under Window > Preferences > Java > Editor > Content Assist, I have the following settings:
Completion inserts (instead of overwrite)
Insert single proposal automatically (which is ok most of the time)
not insert common prefix automatically
I have a simple class, go down to a method, and do the following steps:
Enter this.no and wait some time. Sometimes I have to press CTRL + SPACE, sometimes not.
Proposal pops up which includes notify and notifyAll.
I press SPACE and a space is inserted in the text, the autocomplete suggestions are closed without inserting anything.
I do not know if older versions of eclipse have the same behavior.