Next / Last Edited Position Eclipse Shortcut - And Netbeans? - java

I remember in Eclipse there were buttons in the toolbar that took you to the last edited position in a document.
This was great cause you could write some code, click on a method to go check out the code there, and then click "back" to get back to where you were coding.
Any idea if this can be done in Netbeans?

Certainly, it's unbound by default but you find the setting in Tools -> Options -> KeyMap. Search for last for instance to find the setting.

Related

Is there a way to open two tabs for the same file in IDEA?

Sometimes I need to look at one piece of code already written and write another piece in the same file. When the code is too long, for beauty or other reasons, I have to write for a while and then slide to the piece of code I want to see, and then slide it back to write again. Is there any good way to avoid this trouble?
thanks a lot
You don't have to use a mouse to do it! Remember everything in IDEA is configurable so my keyboard shortcuts may not work for you though you can configure them in the keymap.
There are two ways which you can open multiple files in IDEA:
The first method would be to split the editor:
search by action cmd shift A on mac
type split and choose how you'd like to split
The second method would be to open the file in a new flowable window:
Select on a file in the project window
Use shortcut shift f4 or search by action cmd shift A on mac
Type open source in new window and hit enter
right click into tab name, and select split vertically or horizontally
if you are using git. then find "local changes". it will compare your current changes with the origin
https://www.jetbrains.com/help/idea/viewing-changes-information.html#comparing_local_changes
In Android Studio I see "Split Vertically/Horizontally" options when I right-click on the tab name which do exactly what you want. Since AS is derived from IDEA the functionality might be there too.
If you use JetBrains IDEA, the form can be split vertically by right-clicking
If you use Eclipse, you can ctrl + shift + [

How does one type an upside-down question mark in IntelliJ on a Mac?

On my Mac, I can usually type an upside-down question mark (¿) by typing Shift + option/alt. However, in IntelliJ, doing this types "public" instead. I could not find any "public" shortcut in the Key Map under Preferences. Short of typing this character in another application, copying it and pasting it into IntelliJ, is there any way around this?
There is a key combination attached to that action already in IntelliJ IDEA. That's why you would get a different result than the one expected from the operating system in question.
Head over Settings > Keymap. Click on the magnifying glass icon (with three boxes on it) named Find Actions by Shortcut – all they way to the right. Once you click on it, execute the key combination that you are looking for, if there is something overriding it, the IDE should give you the action(s) attached/registered to it.
UPDATE: That combination is attached, by default, to Code Completion | Cyclic Expand Word (Backward). Clear that out and you will be on your way of typing ¿ again in IntelliJ IDEA by pressing Shift + Option + ?

Disabling Eclipse auto-complete but keeping auto-activation

I use Eclipse for Java development. I like the auto-activation feature because I can add all the letters and numbers so I can see class members while I'm typing; making it behave similarly to Visual Studio. If I don't add all of the letters and numbers to the auto-activation list, it will only pop up with class information when I'm typing the first letter after the '.' delimiter, and then it disappears.
The real problem arises when I'm typing in a variable name or something else. As soon as I hit space, the auto-complete types a bunch of crap following what I've typed in attempt to complete it. It's driving me crazy!
Any way to turn this off?
The checkbox you have to check is: "Disable insertion triggers exept 'Enter' "
(under Java -> Editor -> Content assist)
I'm on Eclipse 2018-12 and C_H's answer had no effect on the behavior:
I believe what you'll want is to deactivate "Insert single proposals automatically"
EDIT: It seems this answer is now outdated. It may work for old Eclipse versions. For any more recent versions refer to #ChrisP's answer from 2019.
Open menu Window, then Preferences. Follow path Java -> Editor -> Content assist. Now mess around with the settings to find your ideal setup. I believe what you'll want is to deactivate Insert single proposals automatically.
If anyone wants to know how to stop the auto-complete for brackets:
Toggle off: "Edit --> Smart Insert Mode"
Version: Eclipse Photon
In continuation to #G_H's answer :
This worked for me although I am sure there is another and a better way.
Window -> Preferences -> Java -> Editor -> Content Assist -> Set Auto Activation Delay(ms) : 200ms from 0ms in my case.
You may want to increase/decrease the value 200 depending on your typing speed.
The reason this worked is because of the hitting of "Spacebar" before the delay arrives.

How to show two or more editors at the same time?

Eclipse allows to show more than one code editor at the same time... so you can have something like this:
Can I do something like that using IntelliJ Idea?
There are two ways to do it:
Click the tab header, then split vertically/horizontally. (works prior to IDEA 10).
Just click the tab header and holding left mouse button move the tab out of the window (separate editor will open). (IDEA 10). (See Detachable tab editors section on the features page.)
When using the second option I find that global history (CTRL+ALT+arrows) is spammed. See bug IDEA-64656 Navigation (Back & Forward) works incorrectly in the case of splitted editors and it is finally fixed in the 103.190 EAP build
Right click on a tab with file name and select 'Split Vertically'/'Split horizontally'

How can I duplicate (clone) a tab in IntelliJ Idea?

In Eclipse I just click above the tab and click on "New Editor". In NetBeans is "Clone". In IntelliJ Idea I didn't find this option yet. What I do now is split vertically but it is not what I want.
You can't have multiple tabs for the same file without using split
mode (vertical or horizontal). If you want a copy of the file, use
Refactor | Copy.
To quickly split the view and make the same file visible in 2 splits hold Ctrl and drag the tab into the editor area.
UPDATE: feature request added, please vote.
Split Vertically
Drag second tab to another Window/Monitor
You can do this simply by Holding CTRL button and drag the tab to the empty space or another monitor.
Use Shift + F4.
Ctrl + F4 to close it.
You can drag the tab "out" of IntelliJ to create a new window with open tabs. Then reopen the file in main window.
See this video
This requires the new IntelliJ IDEA 10.
Yeah, split (vertical or horizontal) is the only option that I have found. You will find the IntelliJ support people really helpful, though, worth asking this question there: http://www.jetbrains.com/support/idea/index.html
Shift-Enter will open the file in a floating window.

Categories