I have visual studio code.
How do I see and navigate through the functions list in rails?
I don't see any methods in the "outline view". Also, when I use ctrl + shift + o, I get the following message: "the active text editor does not provide symbol information".
Is there an extension that need to be installed? Or is it something in settings?
See discussion thread about possible options here: https://github.com/rubyide/vscode-ruby/issues/40
At the time of writing, I think the best option is to add the ruby-symbols extension here:
https://github.com/MiguelSavignano/vscode-ruby-symbols
Note also that for Windows, it's Ctrl + Shift + O.
And for Macs, it's Cmd + Shift + O.
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.
Is there an equivalent of Ctrl + Shift + L (show shortcut references) from Eclipse in IntelliJ IDEA?
I am switching to it from Eclipse but I have to check the keymaps frequently and I would like to have access to the quick reference of shortcuts instead of opening the settings to do it.
Learning shortcuts: I switched from Eclipse, too. Initially I started with the Eclipse key bindings, but then decided to switch completely. I used KeyPromoter for about 2 days, it is annoying but increases the learning curve heavily. Help->Find Action... (Ctrl+Shift+A) helps, too.
Reference card: After that I printed my own shortcut reference. Took one hour, but it was worth the time, because I have adapted some shortcuts and some shortcuts are displayed incorrectly in IntelliJ Idea. Here's a Word template.
Command + Shift + A displays a field that performs a search on an action or option name. Shortcuts along with their corresponding keymap are displayed during the search.
I think Ctrl + Shift + L (show shortcut references) from Eclipse must do "Introduce variable..." In Idea it is Alt + Shift + V or with menu Refactor/Introduce variable...
May be useful to somebody(begginers like me :) ).
The correct answer is Ctrl+Shift+F to search text everywhere in the project.
I usually use "Shift Shift" that it searc everywhere shorcuts included.
So for example if I need to search "Optimize import" I do
Shift Shift and write "import" or "optimize" and it appear.
My coworker keeps insisting that I make the switch from IntelliJ to Eclipse. I'm considering relenting, mainly because the compile/deploy time it takes for my Android project seems to be considerably less in Eclipse than IntelliJ (I imagine Eclipse does some sort of incremental compilation, etc. that IntelliJ can't do for Android).
However, there are a few shortcuts that I feel are essential and I don't want to do without, and I'm wondering if anyone knows of a way to do them in Eclipse (perhaps add via a plugin?):
Ctrl-W (select word, and then expands selection to include statement,
block, method, class... this should work in XML and other types of code as well)
Ctrl-D (duplicate selection, if selection, or otherwise line)
Ctrl-Shift-V, paste from history (pops up a list of recently copied text)
Go to Symbol (searches through all methods, fields, etc in your project)
I'm sure there are a bunch of others I'll really miss, but these are the main ones I use all the time.
about the go to symbol thing
there are the following functionalities available
ctrl + shift + r - open resource
ctrl + shift + t - open type
ctrl + alt + g - find the selected text in workspace
ctrl + shift + g - find references in workplace (as selected by caret)
ctrl + o - quick outline, all methods in class
there is also a plugin calld instaSearch that you can easily install, it offers a complete project active search.
I believe IntelliJ is a much better IDEA, but you asked..
ctrl+w
Alt Shift Up Expand selection to enclosing element
ctrl+d
Ctrl Alt Arrow Duplicate line(s) up or down
ctrl+shift+v
Not that I have seen
ctrl+shift+a
No, and that is a truly amazing feature.
Does Eclipse have a hot key to comment a block? and to uncomment a block?
Ctrl-/ to toggle "//" comments and Ctrl-Shift-/ to toggle "/* */" comments. At least for Java, anyway - other tooling may have different shortcuts.
Ctrl-\ will remove a block of either comment, but won't add comments.
Note: As for Eclipse CDT 4.4.2, Ctrl-Shift-/ will not uncomment a "/* */" block comment. Use Ctrl-Shift-\ in that case.
EDIT: It's Ctrl on a PC, but on a Mac the shortcuts may all be Cmd instead. I don't have a Mac myself, so can't easily check.
There are two possibilities:
Every line prepended with //
ctrl + / to comment
ctrl + \ to uncomment
Note: on recent eclipse cdt, ctrl + / is used to toggle comments (and ctrl + \ has no more effect)
Complete block surrounded with block comments /*
ctrl + shift + / to comment
ctrl + shift + \ to remove
For Eclipse Editor
For Single Line (Toggle Effect)
Comment : Ctrl+Shift+c
Uncomment: Ctrl+Shift+c
For Multiple Lines (Toggle Effect)
(Select the lines you want to comment)
comment : Ctrl+Shift+c
Uncomment: Ctrl+Shift+c
It is for all html , css , jsp , java .
It gives toggle effect.
I came here looking for an answer and ended up finding it myself, thanks to the previous responses.
In my particular case, while editing PHP code on Eclipse Juno, I have found that the previous commands won't work for me. Instead of them, I should press Ctrl+ 7 (on the superior number key) to obtain the double bar comment ("//"). There's no way I can comment them with the previous mentioned key combinations.
As other answers pointed out, the following shortcuts are defined by default (I'm referring to editing java source - shortcut bindings can be found in eclipse Window>Preferences, under 'General'/'Keys', search for 'comment'):
to add a block comment, the shortcut (binding) is: Ctrl + Shift + /
to remove a block comment, the shortcut (binding) is: Ctrl + Shift + \
Unfortunately, these shortcuts did not work for me (on Eclipse Java EE IDE for Web Developers, version: Juno Service Release 2).
The reason, I think, is my keyboard layout (QWERTZ keyboard layout used in Germany - see here for further information), where '/' actually has to be written via 'Shift + 7'.
I therefore had to change the shortcut bindings for comments (just did it for editing java source) in the eclipse preferences (under 'General'/'Keys') as follows:
Change the binding of command 'Add Block Comment' (when 'Editing Java Source') from 'Ctrl + Shift + /' to 'Ctrl + Shift + 7'
Change the binding of command 'Remove Block Comment' (when 'Editing Java Source') from 'Ctrl + Shift + \' to 'Ctrl + Shift + 8'
Unbind the binding 'Ctrl + /' for command 'Toggle Comment' (when 'Editing Java Source'); instead of assigning a new binding, I simply unbound this shortcut, as there already was one with Ctrl+7 and one with Ctrl+Shift+C (which both work for me)
I have Eclipse IDE for Java Developers Version: Juno Service Release 2 and it is -
Every line prepended with //
ctrl + / for both comment and uncomment .
In addition, you can change Eclipse shortcut in Windows -> Preferences -> General -> Keys
For single line comment you can use Ctrl+/ and for multiple line comment you can use Ctrl + Shift + / after selecting the lines you want to comment in java editor.
On Mac/OS X you can use ⌘ + / to comment out single lines or selected blocks.
for java code
if you want comments single line then put double forward slash before code of single line manually or by pressing Ctrl +/
example: //System.Out.println("HELLO");
and for multi-line comments, Select code how much you want to comments and then press
Shift+CTRL+/
Now for XML code comments use
Select code first and then press Shift+CTRL+/ for both single line and multi-line comments
For JAVA :
Single line comment:
// this is a single line comment
To comment: Ctrl + Shift + C
To uncomment: Press again Ctrl + Shift + C
Multiple line comment:
/* .........
.........
......... */
First, select all the lines that you want to comment/uncomment then,
To comment: Ctrl + Shift + C
To uncomment: Press again Ctrl + Shift + C
I hope, this will work for you!
It depends upon the version of OS - for me it works with Command + 7
Using Eclipe Oxygen command + Shift + c on macOSx Sierra will add/remove comments out multiple lines of code
Using Eclipse Mars.1 CTRL + / on Linux in Java will comment out multiple lines of code. When trying to un-comment those multiple lines, Eclipse was commenting the comments. I found that if there is a blank line in the comments it will do this. If you have 10 lines of code, a blank line, and 10 more lines of code, CTRL + / will comment it all. You'll have to remove the line or un-comment them in blocks of 10.
Eclipse Oxygen with CDT, PyDev:
Block comments under Source menu
Add Comment Block Ctrl + 4
Add Single Comment Block Ctrl+Shift+4
Remove Comment Block Ctrl + 5
I have Mac ,I was also facing problem to comment multiple line in STS
I have tried
single line comment:
command+/
Multi line comment:
control+command+/
Multi line uncomment:
control+command+\
And it was success
For single line comment just use //
and for multiline comments use
/*
your code here
*/
Select the text you want to Block-comment/Block-uncomment.
To comment, Ctrl + 6
To uncomment, Ctrl + 8