Is there a shortcut to jump between views inside the explorer (e.g from Files to NPM Scripts or Timeline) - visual-studio-code

Couldn't find a command in the Keyboard Shortcuts list that focuses next or previous view in the explorer.
I know there are commands available to directly focus certain views (e.g npm.focus, timeline.focus, workbench.explorer.fileView.focus) but that would require binding a unique key for every view.
I need a shortcut to focus next/previous view in the list.

Switching Focus between Lists in the Sidebar
The TAB key is your best option.
You can't specify a specific list switch focus on, but you can cycle up & down the list.
To Toggle one Group "DOWN" use: TAB
To Toggle one Group "UP" use: SHIFT + TAB
To toggle through the groups list items, like open editors in the open-editors section, logged file-saves in the local history section, files in the file explorer, and/or the many other groups/sections available in the sidebar...
use the UP & DOWN Arrow Keys.
This is how all html lists work. VS Code is written in HTML FYI (you probably new that, but I threw it out there for clarity's sake). When interacting with a page that has been rendered from an HTML document, the TAB key will always switch focus between base elements, and will never cycle through an elements children. If you cycle through elements, such as an ordered list (<ol>), or an unordered list (<ul>), you can cycle through their list items (<li>) using the UP & DOWN Arrow Keys.
VS Code is no exception, in fact the entire editor can be cycled through using the keyboard. There are many disabilities that this functionality accommodates.
And FYI, your theme, if well developed, should highlight where focus is at. I find many developers will remove that highlighting to create the desired visual effect, but doing so is naive, as its there for a reason.

Related

Add hotkeys to Eclipse

I use IBM Rational Developer for i, which is based on Eclipse, to develop applications for IBM i. During development, I constantly use my mouse to send the source code to the IBM i server and start compiling it. To do this, right-click on the project, select Remote Actions and Submit Build in the submenu. This is very exhausting.
Could you configure a hotkey to perform this action?
There are a few strategies for this.
In Preferences and "Keys", you can list key bindings, assign new bindings, and clear existing bindings. It's convenient to sort by the "Binding" column so you can see functions bound to the same sequence right next to each other, to check for possible key sequences to bind functions to.
A general approach is that I bind several functions to key sequences beginning with "Ctrl+;" (control-semicolon). Nothing else uses that prefix, so it doesn't conflict with anything. You can use any prefix that is convenient for you.
The "right-click" operation is actually a specific function, called "show-context-menu". I bind "Ctrl+;, ." (control-semicolon, then period) to this function.
Once the context menu is visible, you can use down-arrow and up-arrow to move through the menu. Up-arrow on the first item goes to the last item. Also, when the context menu is visible, each menu item will have one letter underlined, which is the "accelerator" for that menu item. If you press that key while the menu is shown, it will execute that item, or simply select it if it has a submenu. If there are multiple items with that same accelerator, it will go to the first one, and the next one if you press it again. If it has a submenu, right-arrow will open the submenu.
In your situation, you would have to have the project selected in the project or package explorer. You could do that with the mouse. I'm not aware of good strategies for directly selecting a particular project in the explorer.
Another thing you'll want to do is look in the "Keys" list to see if the function you want to execute is defined, so you could bind a key sequence to it, but you'll still likely have to have the project selected when that sequence is pressed.
This process of exploring functions and keys is much more convenient if you use the "Emacs+" plugin (no elisp knowledge or use required). It provides functions for showing what key sequences are bound to which functions, and vice versa.
Well, you could always use a more general hotkey facility that isn't specific to RDi. If you're using Windows, I recommend AutoHotkey. This would let you assign keystrokes or mouse movements/clicks to any key combination you like.

PhpStorm - How to show files in alphabetic order?

In NetBeans 8.2 all files are shown in their alphabetic order, this is very useful because I can find a file extremely fast.
However, in PhpStorm this is not the case as you can see here:
How can I enable this feature?
Those are editor tabs and they are listed in that drop-down list in the same order as you arrange them.
If you want alphabetical order -- choose Sort Tabs by Filename from Editor Tab context menu (right clicking on editor tab).
Note: this will be applied to ALL tabs and not only those that are currently hidden (my impression from NetBeans screenshot).
There is no option to sort only hidden tabs in alphabetical order.
Possible alternative to managing tabs/navigating between the files is to use View | Recent Files (Ctr + E using Default keymap) and/or Navigate | File/Class....
This depends what you prefer/how you used to manage your files.
These popups can be used even with Editor Tabs hidden (e.g. when you need maximum space for editor to see your code).
Some useful links to check:
https://confluence.jetbrains.com/display/PhpStorm/Navigating+through+a+PhpStorm+Project
https://www.jetbrains.com/help/phpstorm/2016.3/managing-editor-tabs.html
https://www.jetbrains.com/help/phpstorm/2016.3/navigating-through-the-source-code.html

how to change the view of open files list in netbeans 7.3.1

When I open, say a 10 or more file in Netbans 7.3.1 (windows 7), Netbeans puts each opened file's name in a a tab and all tabs are listed horizontally above the code eduitor. And at the end of that horizontal list, Netbeans provides clickable arrows (>,<,V ) to kind of navigate that list.
Since many times, the file that I want to get into is not visible in that horizontal tab list, and I need to navigate to the left or right, I usually end up clicking on the down arrow (v) and that gives me the full list of all the open files. At that time, it's a simple click to go to that file. I wish that list was available to me in a vertical fashion without an extra step.
Is there a way to see that vertical list at all times? For example, where the HTML navigator is...
I don't believe NetBeans can do this as you describe.
However, what you may find useful is Ctrl-Tab - pressing this once brings up the open file list and pressing Tab repeatedly iterates through these files. Ctrl-Shift-Tab iterates in the other direction. Letting go of Ctrl selects the currently selected file. This is similar to the Alt-Tab feature in Windows.
Hope this is useful.

Is it possible to hide/remove arbitrary context menu items in Eclipse (3.6)

My question can be split into three:
Is it possible to hide/remove arbitrary context menu items in Eclipse (3.6) by ...
standard UI?
some existing plug-in?
custom plug-in?
I failed to find ways to do this by methods 1 and 2. If the only option is creating custom plug-in, could anyone push me towards the right direction where to start (I have some experience in Java, but not in Eclipse plug-ins).
You can hide menus or menu entries through the standard GUI: see help
To hide a menu item or toolbar button:
Switch to the perspective that you want to configure.
Select Window > Customize Perspective....
Open the Menu Visibility or Tool Bar Visibility tab.
Find the item you want to hide.
Uncheck the check box next to the item. Uncheck a menu to hide all its children.
Click OK to cause the changes to take effect.
But that will hide this entry from all the menus (contextual or not) in which it is present.
So it may not be as fine-grained as you want through the GUI.
You can also try it through a plugin (see also Menu contribution)
The first steps are pretty standard for using extensions in Eclipse.
Open the plugin.xml file and add the org.eclipse.ui.activities extension.
Then create an activity node and give it a unique ID.
Then create an activityPatternBinding node and use the unique ID for the activity to find the pattern node to the activity node.
The activityPatternBinding node requires that you supply a regular expression for the ID string of the UI element that you wish to hide.
The problem is that there appears to be at least 3 ways that menu items and toolbar buttons are added to the UI.
The first way is through the newer Command/Menu Extensions.
The second way is through the older ActionSets Extension.
Then there are other UI elements that appear to be hard coded into the Workbench and do not have ID strings and cannot be hidden using the Activities Extension. Luckily there are few of this third type of UI element.
Considering you are talking about the latest Eclipse, I will copy only the first way:
1/ Use the Plug-In Spy
The first way is to use the Plug-In Spy.
Press alt-shift-F2 and click on a menu item or toolbar button that you want to be hidden.
If there is an ID string under the heading "active action definition identifier" then you are in luck.
This item has been added using the Command Extension and you can use this ID as the pattern argument for the Activities Extension.
But not all items that have been added using the Command Extension present their ID string to the plug-in spy.
As a side note, the ID strings are period separated.
For instance the ID for a button might be "org.eclipse.ui.navigate.backwardHistory".
Regular expressions use the period to stand for any character. Luckily the period used as a wild card matches with actual period characters so you don't need to escape them if you don't want to. I find it makes it a bit easier to read if they are not escaped and it is highly unlikely it will cause any ambiguous matches.

How can I go to the next Eclipse marker (e.g. build error) using the keyboard?

Suppose I make a method signature change that breaks several callers, and I want to review the call sites manually to update them.
Once I change the signature, my "Problems" view shows, say, a dozen errors.
What keys can I hit to navigate through them while leaving the keyboard focus in the editor for fast fixups?
(It's been a while, but I think the Visual Studio equivalent is F8.)
Note that this question does not duplicate Eclipse: How to go to a error using only the keyboard (keyboard-shortcut)?, as that one seeks to navigate only between markers in the current file. In this case, I want to go to the next error regardless of which file it's in.
("Marker" is the general Eclipse term for errors, warnings, etc.)
The best I've come up with so far is Ctrl + F7 to flip to the Problems view, then ↓ to pick the topmost error, then Enter to go to it (which returns focus to the editor).
Here's a way to move to the next error, regardless of editor, in one keystroke. It's not perfect, but it works until it's fixed in Eclipse.
Open a "Markers" view. Click the down arrow at the top right, and choose "Configure Contents". Uncheck the show all box, and create the view to show only the problems you want to see. You'll probably want to deselect "warnings" and "errors" as well. Save it.
Click the same "Markers" down arrow, and choose "Group By". Select "None". This is important because you don't want the parent tree level nodes to show, otherwise some of your "next" actions will take you to those, which don't represent an error.
In Eclipse -> preferences -> keys, search for "Markers". If there is not a keystroke bound to the Markers view, create one. I use Ctrl + Shift + M
Get a keyboard hotkey tool like AutoHotKey (for PC's) or iKey for the Mac. I'm using iKey, but there are plenty of other Mac tools you can use. In your hotkey tool, define an action for the keystroke you want to use for "next error". I chose the standard CMD + .
For that keystroke/action in your hotkey tool, generate 3 keystrokes in the following order:
Ctrl + Shift + M
Down arrow
Enter
Of course, you'll want to change the first one to whatever you picked for yours. You'll probably want to restrict that action to be executed only when Eclipse is the current application.
Save that, create some compile errors, and test it.
Try Ctrl + 3 for Quick access popup window.
If the "Markers view" is not already visible, then type in "markers", in the searchbox on the popup window. Once you have selected it, it should stay available, when you press Ctrl + 3 the next time around.
I just had the same problem, after refactoring some parts of code. I had a lot of errors in different files and i had to go through all of those.
I used the following solution:
Mark all (relevant) entries in the Problems view.
To do this switch to the Problems view using Ctrl+F7 and select the entries with Shift+↓/↑
You can also select all entries using Ctrl+A
Open the marked errors by pressing ↵.
Every file containing at least one marked error will be opened.
The cursor will automatically select one error/file, as if you open only this specific entry
Fix the errors in the opened file.
Here you can use Ctrl+. to navigate to next error inside this file
Close the file using Ctrl+W when your done.
Eclipse will automatically focus the next file and you can go back to step 3
In my case this solution was much faster then switching to the Problems view each time.
There's an Eclipse bug entered for this that has an attachment that looks like it does what you want.
You could use AutoHotkey:
save the mouse position, send a mouse event to click on the arrow in CDT console and then return the mouse back to it's original location. Record the mouse coords with window spy or use autohotkey's search by image function (first capture the images of two arrows with printscreen into bitmaps).