Eclipse shortcut "go to line + column" - eclipse

Does anyone know if there is the shortcut "go to line + column" in Eclipse?

Ctrl+L Jump to Line Number. To hide/show line numbers, press ctrl+F10 and select 'Show Line Numbers'
There is no way to go to a particular column according to my knowledge.
On OSX, the shortcut is ⌘ + L
It you want more short-cuts, refer http://www.shortcutworld.com/en/win/Eclipse.html

As you are aware CTRL+L goes to a particular Line, there is also CTRL+Q to go to the last edit location. The is no key combination in Eclipse to go to a particular Line and Column.
You can use a Keyboard Macro (available as hardware in some keyboards and included as software with some other keyboards). An explanation for Microsoft is here: http://support.microsoft.com/kb/237179 .
A Program like Autohotkey http://www.autohotkey.com/ can also be used.

You can use Ctrl + L to jump to specific line number
You can find a large list of eclipse shortcuts here: http://javatutorial.net/eclipse-shortcuts

You can use 'Command' + L to find line number in eclipse.

You can use CTRL + forward or backward key to jump to the next dot in the same line.
for example, in System.out.println("test"); you can switch between System, out and println by using CTRL + forward and backward key.

Related

How to select current word in Visual Studio Code (VS Code)?

How to select the current word, that is where the caret is at.
Note: I am looking for the shortcut for Visual Studio Code(VS Code), the text editor, and not Visual Studio IDE.
On Mac OS: Cmd+D
On Windows & Linux: Ctrl+D
Above solved the purpose for me.
But ⌘D is defined as "editor.action.addSelectionToNextFindMatch", so if you press it more than once, it will try to search and select same word in the file which then can be used to do "multi word editing".
You are looking for Shrink/Expand Selection.
Trigger it with Shift+ Alt+Left and Shift + Alt+Right
Update:
This is now called Smart select API.
This feature uses semantic knowledge to intelligently expand selections for expressions, types, statements, classes, and imports.
It is Ctrl + D that works for me in latest Visual Studio Code on Windows.
Go to File -> Preferences -> Keyboard shortcuts, you will find this:
If you want to ctrl+w to behave the same as in Idea just go keyboard settings
Search for Expand selection. Set new shortcut cmd+w or ctrl+w depending on your OS.
Also re-bind other commands that use ctrl+w to use another shortcut that you want, for example cmd+f4
You can edit keybindings.json to avoid using UI.
Shift + Alt+Right Arrow if the word is in camelCase then you will have to click Right Arrow again to select the whole camelCase. Every time you press Right Arrow again while still holding Shift + Alt down you will select a further part of the code.
so:
first the word.
then if it's part of a camelCase then the camelCase.
then if it is in a string the whole string.
... (many other posibilities)
the whole line.
everything inside the parentheses code block
the whole file
at any given time you can go back to the last selection by clicking Left Arrow instead of Right Arrow
I don't know about CTRL + w in the old Visual Studio Code but in the JetBrains IDE's this is the equivalent to CTRL + w by holding down CTRL and clicking w to select more and holding down CTRL + Shift and clicking w to unselect.
Another possibility which helps to avoid selecting only one word in camelCase is CTRL + d this will just select the whole camelCase. This will however have the side-effect of also changing the current "find" criteria.
thanks Chandan Nayak for this extra shortcut.
An unpopular opinion: you can now have Resharper keybindings, if you come from Jetbrain's camp.
The Ctrl+W expansion grow and shrinks is different from expansion selection.
On "File/Preferences/Keyboard Shortcuts" I deleted the shortcut "Ctrl + W" to close the current tab action, because for this "Ctrl+F4" works for me.
Update (14 days later): Yesterday I installed VSCode 1.34.0 - I think since then the functionality is "Ctrl + D". I was very suprised.
For any editor, you can use the below shortcuts. These shortcuts work for every text area also.
Ctrl + Shift + LeftArrow/RightArrow - this will select text word by word
Shift + UpArrow/DownArrow - this will select text line by line
Ctrl + BackSpace - this will delete text word by word
Additional
in intellijIdea
Ctrl + w - use for the select current word, after giving second Ctrl + W it will select the second word also. Like that you can select the whole line.
Ctrl + d - you can duplicate current line.

Find Replace Hotkeys In Eclipse

Anyone know of a set of hotkeys that can perform a find/replace in eclipse?
Currently the flow looks like:
Select line or lines
Ctrl+F
Type phrase
TAB
Type replacement
And then I have to do the unthinkable and grab my mouse, choose selected lines and then click on replace. It doesn't sound like much, but it seriously disrupts my flow when i'm doing a bunch of word replacement. I wish their was a way to choose "selected lines only" and "replace all" using keystrokes only besides having to hit TAB 12 times. Or maybe i'm using the wrong tool within eclipse for this sort of thing...
Using Ubuntu and Eclipse Luna 4.4.2
Using Find/Replace for refactoring seems like a smell. You should instead use the refactoring operations
Rename : Alt + Shift + R
Extract constant : Alt + Shift + K
Extract method : Alt + Shift + M
Extract variable: Alt + Shift + L
Inline : Alt + Shift + I
Change method signature : Alt + Shift +C
Introduce indirection
Introduce parameter object
and so on, which all do a kind of replacement by themself, but always work on the syntax tree and not on the text. However, the refactoring support depends much on the language used in the project, and while Java has really good support in Eclipse, this might not be the case for other languages.
I had been trying for this for a long time and ended up in multiple pages without help. I figured it out myself after playing around
For the first time, you need to do the below
Ctrl + F - to open the search box on the top right corner of the IDE (as in image)
You might have to drill down (using the small icon on the left of the search box) to see the replace text
This setup stays from now onwards.
Now you can simply use
Ctrl + F, Tab, Alt+Shift+Enter combinations to do the search and replace
I use eclipse 2020-03 on windows. I am pretty sure many of the previous releases had the same functionality on linux as well.
Screenshot of the feature:
I found thath ctrl+K works in my ide (Neon.3 Release (4.6.3) on windows)
First use Ctrl+f to set a term for search, then use ctrl+K to move to next.
If you need to replace something, keep in the clipboard the text and use ctrl+K, ctrl+v.

Eclipse, shortcut to navigate, jumping by multiple lines

In Eclipse, I'd like to have a keyboard shortcut that allows me to navigate up or down by some number of lines (in Emacs I can jump by # lines by pressing Ctrl + Arrow). Does such a shortcut exist? Currently, I can only move by one line at a time using the arrow keys. The closest shortcut I'm aware of is Ctrl + Shift + Arrow which jumps to the next function definition (at least in PyDev).
with the shortcut Ctrl + L you can enter the line number you want to navigate
You can define your own shortcuts under window > preferences > general > keys.
In addition, you can switch to an Emacs scheme in that same window.
However, as far as I know you won't get what you are looking for just by switching to the Emacs schema. For the ability to jump lines like C-u 10 C-p you will need the Emacs+ plugin found here.
Also note you can jump to lines by using Ctrl + L.

A quick way to select a line in netBeans

I am looking for a quick way to select a line in netBeans.
For example for copy and paste. (in vim editor yy yank current line)
Most GUIs, including Netbeans, allow you to select a word by
double-clicking on it and an entire line by triple-clicking on it.
OR
selection-end-line (Shift+End)
selection-down (SHift+Down) for as many lines as you want.
I've been using Netbeans for a few months.
Ctrl + c will copy the entire line without selecting it.
Ctrl + e will delete the line without selecting it.
Ctrl + Shift + down or up arrows will duplicate the line.
I am late comer to this post, but with a solution. In netbeans 8.x, go to Tools -> Options -> Keymap. In that, search for Select Line. You will get an entry there. Under the field Shortcut, you can give your convenient shortcut. There is no shortcut by default

Is there a keyboard shortcut to "untab" (move a block of code to the left) in Eclipse or Aptana Studio?

It's so easy to select a block of code and tab out, but how about the reverse?
Currently, I just search and replace for white space at the beginning of the line. Is there anything faster?
In Visual Studio and most other half decent IDEs you can simply do SHIFT+TAB. It does the opposite of just TAB.
I would think and hope that the IDEs you mention support this as well.
Shift-tab outdents again :)
The standard shortcut keys are covered in Standard Accelerators.
You'll find many of the more esoteric ones on FAQ What editor keyboard shortcuts are available?.
Here is a general answer for untab:
In Python IDLE: Ctrl + [
In Eclipse: Shift + Tab
In Visual Studio: Shift + Tab
In general, Shift + Tab works for any environment.
This workaround works most of the time. It uses Eclipse's 'smart insert' features instead:
Control + X to erase the selected block of text, and keep it for pasting.
Control + Shift + Enter, to open a new line for editing above the one you are at.
You might want to adjust the tabbing position at this point. This is where tabbing will start, unless you are at the beginning of the line.
Control + V to paste back the buffer.
I hope this helps until Shift + TAB is implemented in Eclipse.
Shift + Tab does that in Flex Builder (based on Eclipse), so it hopefully should work in regular Eclipse :)
In PyCharm, just use Shift + Tab to move a block of code left.
You can do this by going to the Window menu → Preferences, and then open the General list. Choose Keys.
Scroll down the list of keys until you see "Shift Left". Click that. Below that, you'll see some boxes, one of which lets you bind a key. It won't accept Shift + Tab, so I bound it to Shift + `. Apply Apply and Close, and you're all set.
Yes, in PyCharm: Shift + Tab works fine.
You can also change the shortcut. Use the Command + K, Command + S shortcuts to open the Keyboard Shortcut menu. Search for the "tab" and find the "outdent" in the list.