What are the shortcuts keys for Netbeans code folding? - netbeans

Does anybody know a shortcut to fold/unfold (collapse/expand) all classes/methods in a php file using netbeans?

To Collapse: Ctrl+Shift+Minus (on the keypad)
To Expand: Ctrl+Shift+Plus (on the keypad)
This works regardless of what language your using, (Tested on PHP, HTML, CSS & Javascript)
But you can find out the keyboard shortcuts easily yourself, and even change them:
Open the Options Dialog (Tools -> Options)
Then Select Keymap
Enter "Collapse" into the input field labelled "Search" and all shortcuts for that action are displayed. You can do the same for "Expand All"

I found the Collapse All function to be a pain because it even collapses the nested blocks inside of your methods. There seems to be no collapse methods shortcut.
If you are like me and just want the methods and comments collapsed by default this can be configured in the preferences.
Under Editor->Folding in your Preferences click on the language dropdown and select PHP.
Check the 'Functions and methods' checkbox.
Check the 'PHPDoc documentation' checkbox.
This will probably yield the result you are looking for.
I also like to uncheck the 'Show summary' checkbox to reduce visual noise.
You can still use the Expand All shortcut key as described in the other post if you wish to see everything.

Related

Can I see, and individually disable, keyboard shortcuts for extensions, such as the Sublime Text Keymap extension?

When I started using VS Code, I installed the "Sublime Text Keymap and Settings Importer" extension, to make it act more like Sublime, because that is what I was familiar with.
Now, I would like to use the default shortcuts. I want to switch gradually, maybe by disabling a few Sublime shortcuts at a time, or by at least knowing which shortcuts are coming from the Sublime extension, so I can train myself to stop using them.
Is there any easy way to see which shortcuts are coming from the Sublime extension, and ideally disable some, but not all, of them?
If I look at the "Keyboard Shortcuts" list, it shows the default shortcuts and the Sublime shortcuts mixed together, with no hint as to which is which, as far as I can tell. Example:
It shows both Command+P and Command+T as shortcuts for workbench.action.quickOpen, both with a source of "Default". But I know that Command+T is coming from the extension, because if I disable the extension, I don't see it (but I still see Command+P). Disabling the extension and restarting VS Code is kind of inconvenient, so I would like an easy way to see which shortcuts are coming from the extension.
You can see a comprehensive list of all keybindings the extension includes in the "Contributions" tab of the extension itself:
I'm not aware of any options to display this in the keyboard shortcuts UI directly. However, you could put the two tabs side-by-side for easy comparison:
Here is an updated and better method to filter the Keyboard Shortcuts editor to show which keybindings are contributed by a specific extension. See Specify which extension provides a specific keyboard shortcut. And here is an example where I search for one of my extensions, Toggle Line Comments to see if it contributes any keybindings.
And then it would be easy to disable or re-bind any of those keybindings.
Also you can click on the Extension gear icon in the Extensions list. That will bring up a menu with an Extension Keyboard Shortcuts option. Which will open the Keyboard Shortcuts editor with a search already completed for any keybindings contributed by that extension.
Keep an eye on this PR https://github.com/microsoft/vscode/pull/95713 (Show keybinding source in GUI). Looks like it may be included in vscode v1.45. It would allow you to filter the "Keyboard Shortcuts" by user-defined or extension. From the above link:
Filters examples:
#user - shows user defined keybindings
#default - shows default keybindings
#extensions - shows all extension contributed keybindings
#extensions:"${EXTENSION_NAME}" - shows keybindings contributed by
${EXTENSION_NAME}
#extensions:${EXTENSION_NAME} - same as above only without quotes
(spaces are invalid for this one)
Searching with filter and text also works:
#extensions:bookmarks list - shows keybindings from bookmarks
extension that contain the word "list"
And then with such a filtered list it would be easy to disable whichever commands you wished.

How do I disable brace highlighting in JetBrains RubyMine?

I want to disable brace contents highlighting in RubyMine. It's very distracting. Instead of having the entire string highlighted I only want the braces themselves highlighted and if that is not possible I need it disabled. Is this possible?
Things I've done already to no success:
Enabled/disabled all highlight options under Settings/General to no
effect. I'm running RubyMine v8.0.3.
Read the documentation.
jetbrains.com/idea/help/highlighting-braces.html?search=highlighting
I've also read this document that states how to disable highlighting
of usages by simply pressing escape - it does not work.
jetbrains.com/idea/help/highlighting-usages.html#3
current brace highlighting that I need disabled
Your file type seems to be HAML.
In Settings, go to Editor > Colors & Fonts > HAML. In the lower right area, you see demo code in HAML. Look for the right spot in the code and click on it.
You will probably click on the second line because there is some code in braces. In this case, RubyMine will select the entry Injected code in the list. The check box Use inherited attributes tells you that this settings is inherited.
Now you have to choose:
If you want to change the setting for Editor > Colors & Fonts > HAML - Injected code, switch off Use inherited settings, then switch off "Background".
If you want to the settings for injected code in all languages: Click on the link "General" (on the right). RubyMine will switch to Editor > Colors & Fonts > General - Injected language frament. Now switch off "Background"
Before modifing anything, you have to create a new scheme. The default scheme is read only. Click on Save As..., choose a name and press 'OK'.
Open the Settings/Preferences dialog.
In the Editor page of the IDE Settings, select the check box Highlight usages of element at caret to enable automatic usage highlighting.

Autocomplete in Netbeans

I use Netbeans 7.2.1, when I type private String a(Java code), the IDE shows a tip window aString which asks me to name a variable with its type as postfix. In addition, when I continue to type ;, it completes the code with private String aString;. Actually, I do not like this naming style, so, how to change the settings?
For windows :
Go to Tools > Options > Editor > Code Completion
Select Language Java from dropdown
Auto pop-up on typing any Java identifier part
You can take help from the images below:
Under Preferences -> Editor -> Code Completion is where you can find the auto complete properties. You can disable the 'Auto Popup Completion Window' to keep it from automatically popping.
You can bring up the auto complete popup with the hotkey: control+space
Also while the completion window is displayed, pressing the esc will close it without inserting an autocomplete value.
Go to: Preferences -> Editor -> Formatting.
In the drop-down box "Language", choose "Java".
There are many other categories you can choose from and you can customize your code formatting style there.

Eclipse help box

I am using Eclipse to program Android apps and I love how the little helper box thing comes up when you start to type and suggests things to you.
However, this only happens sporadically and I was wondering if there was a way to keep it visible for longer or, even better, a key combo I could press to bring it up. If I start to type something, it either helps me by suggesting things or doesn't appear.
Try Ctrl+Space. The feature is known as "content assist," "code completion," "auto-complete." In the Visual Studio world, I think it's called "Intellisense."
If you want the suggestions to appear immediately (I prefer this) you can change the delay by going to Window → Preferences → Java → Editor → Content Assist and change the Auto activation delay to 0. In my version of Eclipse (Helios for Java EE), that field is third from the bottom.
An easier way of finding this preference screen is to use the search box in the upper-left-hand corner of the prefs (as before, Window → Preferences), and typing completion. From there you can see all of the different content assist preferences that Eclipse offers. Mine has Java, JavaScript, CSS, HTML, JSP, and XML - most of those because I'm using a fancier version of Eclipse.
By default, when writing Java code, the . (period) key triggers auto-activation of content assist. You can change this setting in the same screen as the auto-activation delay.
I think its Control+Space for Code completion. Try that
Also go easy with the code completion popup delay. Dont set it to 0, i remember a strange behaviour in Eclipse where there was no popup at all.
Ctrl+Space is the shortcut for Content Assist.
Ctrl+1 is the shortcut for Quick Fix.
Ctrl+2 is the shortcut for a menu of Quick Assists. (Ctrl+2, F is the shortcut for Quick Assist - Assign to var/field, and in place of F you can also type L or R for other options.)
To see and/or modify available shortcuts you can go to Window > Preferences > General > Keys.

How to Display Current Function in Eclipse

I miss a certain functionality in Eclipse. I would like to know the name of the current function the cursor is currently inside. This is useful when browsing unknown code using the search function, for example.
Any idea how to show it? Maybe a plugin?
I'm using the "Toggle Breadcrumb" option from toolbar:
It shows a nice breadcrumb, ending with current function name.
It's quite handy for me, as Outline becomes cumbersome to use if you have zilions of functions.
It produces the following structure above your Java Editor (truncated at the picture below):
The "Outline" view shows the current function.
It may be necessary to enable the 'Link to Editor' option in the Outline View dropdown menu. This might be off by default for CDT.
I was looking for something similar (Xcode-like bar at the top showing the current function, where you can also go to another function by clicking on it to open a popup list of functions). Here is what I settled on with Eclipse 3.5.1 CDT:
I moved the Outline view to the top, resized it to make it a 1-line horizontal strip (don't make it too narrow), and selected "Link With Editor" in its menu, so that it always shows the current function. However, this doesn't open a popup list like Xcode. For that functionality, I assigned a shortcut to the "Show Outline" command which does open a popup list of all functions.
The Eclipse function 'show outline' will pop up a list of outline objects, and it will highlight the object your cursor is inside in grey. It's typically bound to 'ctrl-o' (the letter 'o', not zero), but you can re-bind it as you see fit. I'm running Eclipse with the CDT plugin and it works pretty well for me.
To enable the breadcrumb invoke Toggle Java Editor Breadcrumb in the toolbar or press Alt+Shift+B in the Java editor.
You can also display the Quick Outline (ctrl+o). This way you see the context quickly without having to have a permanent Outline Window linked to the Editor.
Use the "Link With Editor" option on the outline menu
Press Ctrl+o (cursor is currently inside a function at a particular line).
It highlights the current method, or name of the class if the cursor is outside the method body.
You can click on highlighted method.
It has got inline search feature ...start typing name of the method to navigate to the specified method or method with matching search pattern.
If you press again Ctrl+o to shows the inherited members/methods.
Using outline with "link with editor" option worked also for me, thanks!
Just an addition, you can move outline pane in to the same window group as search, progress etc. saves the space in your perspective instead of keeping it at another group.