How do you use the Explorer tree is VSCode? - visual-studio-code

I find the explorer tree to be unintuitive. Opening a file on single click was annoying, so I set "workbench.list.openMode": "doubleClick". Now I have to click twice on the expand/collapse triangle just to make the tree expand or collapse (in code outline view, gitlens, and other views).
Shouldn't single click on the twisty open/close?
Why can't you type letters to navigate in lists/trees?
Why is the item you clicked on one color, but the item you navigate to with arrow keys another?
What is the point of the other highlight, as the context menu only seems to apply to the highlight with less contrast?
How do I open the selected item with the keyboard?
What is happening in the explorer when you press ESC? Seems like focus moves to the tree itself, but what does that achieve?

Shouldn't single click on the twisty open/close?
I've seen an open issue about that
Why can't you type letters to navigate in lists/trees?
That issue exists too
Why is the item you clicked on one color, but the item you navigate to with arrow keys another?
IDK. Usually, after you click that file is open in editor. (Selected list item - active editor(easier to spot?); Focused list item - where the focus is)
What is the point of the other highlight, as the context menu only seems to apply to the highlight with less contrast?
You can change the colors if you want to.
How do I open the selected item with the keyboard?
Enter? I assigned arrow right→ though.
What is happening in the explorer when you press ESC? Seems like focus moves to the tree itself, but what does that achieve?
What did you expect it to do?

Related

Access mouse over hover in VSCode

Is there a way to access the mouse over popup in VSCode via Keyboard and navigate in it?
I often use the mouse over to get the namespace of function or variable ...
So I want to place the cursor on "bar", popup the hover (Show Hover Ctrl+k Ctrl+i), focus it, mark some text (eg. namespace::functioname), copy and close the hover.
namespace foo{
void bar();
}
First problem, the hover doesn't get the focus and I don't know how to focus it. But there is another feature "Show defintion preview hover", which actually gets focused. So far so good. But I still cannot mark or copy text inside the hover via keyboard.
Show hover (not focused):
Show definition preview hover (focused):
But I still cannot mark or copy text inside the hover via keyboard.
That should change with VSCode 1.68 (May 2022):
Lock hovers to more easily mouse over them
Some custom hovers cannot be moused over and others are tricky to mouse over without hiding it because of other things in the way (eg. like a scroll bar).
Holding alt while a hover is active will now "lock" it, giving it a wider border and preventing moving the mouse outside of the hover widget or whatever triggered it from hiding it.
This is primarily an accessibility feature to make hovers play nice with screen magnifiers but it is also useful for copying text from certain hovers.
Note that this feature only applies outside of the editor because editor hovers can always be moused over unless specified otherwise via a setting.
This will be helpful for other views (debug, terminal, ...) where variables with their popup can appear as well.
In the editor, see microsoft/vscode issue 63296
ctrl+K ctrl+I to show the hover and focus it
ctrl+A to select all the hover content
ctrl+C to copy to clipboard
It does indeed work for me (on windows) for the first two steps, however ctrl+C does not copy the text selected with ctrl+A.
It seems like there are two different selections possible in the hover:
ctrl+Aselects everything with a dark blue.
When selecting some text in the hover with the mouse (i.e. press the left mouse button while near/over a char, move mouse, release left mouse button) the selected text is shown in a lighter and brighter blue.
The two selections can coexist.
ctrl+C always copies the text selected with the mouse, or nothing if there's no such selection, no matter whether a ctrl+A selection also has been done.
If there's only a ctrl+A selection, ctrl+C doesn't copy anything.
The two selections can be selected in any order. The order doesn't change the behavior.
Think I found out what you were after.
The shortcut is: Ctrl+K Ctrl+I
See: Trigger advanced hover information with keyboard
please try control + mouse click
it may be help you

VS Code - toggle search icon in Activity Bar, move from panel or back

I accidentally removed search icon in Activity Bar and don't know how to add it there again. If I click on Activity Bar, I don't see this option any more.
Update: v1.44 you can now simply drag many of the views, including "Search" from the sidebar to the panel and back. See https://code.visualstudio.com/updates/v1_44#_increased-view-placement-flexibility and https://stackoverflow.com/a/55981465/836330
Update: v1.42 added a context menu option
Move to Panel/Move to Sidebar
to certain typically sidebar views like Search, Outline and custom views. So you wouldn't have to use a setting to move the Search view back to the sidebar. Here is a demo:
Also notice that you no longer right-click in the empty space below the search inputs in the sidebar but on/near the Search header itself to bring up the toggle option.
As part of the v1.42 release the search.location setting mentioned below will be deprecated.
Your setting should migrate automatically, but you will need to use
the new generalized method to move the Search view going forward. You
do not need to enable the experimental preview setting above in order
to move the Search view with the new context menu entry.
So I don't think there is a setting anymore, you just right-click on the header text "Search" whether it is in the Panel or active in the Sidebar to move it. See the demo below.
Right-click on the "Search" header if you have it in the sidebar to "Move to Panel".
If Search is in the panel, right-click on the word Search to "Move to Sidebar".
To enable moving the Output view at this point, you need to enable workbench.view.experimental.allowMovingToNewContainer.
There is a new unbound command workbench.view.search.moveView which you can use to toggle the search position between the panel and sidebar. But note that in my testing it only works a couple of times because it focuses the panel when you move search to the sidebar - I'll file a bug.
Previous Answer::
You may have modified the setting:
"search.location": "sidebar",
which is the default to the alternative
"search.location": "panel",
which would put the search widget into the terminal panel as another tab.
As of vscode v1.35 or so, you can now right-click in the empty space below the search view (i.e., in the sidebar under the open search inputs) and you will get an option to Toggle Search View Position.
This context menu switch of the search view is persistent. It will automatically add this setting to your settings.json:
"search.location": "panel",
The only way at present (but see edit just below) to move the icon back to the activity bar (and thus the search across files functionality to the sidebar) is to change that setting to the sidebar option. Or look for this setting in the settings editor:
Search: Location
Controls whether the search will be shown as a view
in the sidebar or as a panel in the panel area for more horizontal
space.
EDIT: More recently, vscode added the abilty to right-click in the search area when it is in the panel to toggle it back to the sidebar.
In windows
file--> preferences-->settings
In mac
preferences -> settings
vs-code version 1.30.2
Step 1: Click on Edit from Navbar
Step 2: Find in Files
.
.
You can easily search for anything in the side paanel
or else if you want anything to search inside files then
Step 1: Click "Ctrl+F"

Using Visual Studio Code how can I jump to the next found item from the active editor?

If I search something in Visual Studio Code with Ctrl+Shift+F, the result appears in the SEARCH pane.
If I click or push Enter on an item, it will be opened in the editor window.
How can I jump to the next found item if the editor window is active, without using the mouse?
F4 and Shift-F4 will traverse your search results even if an editor window has focus.
If the search pane has focus the arrow keys will tab down to each found entry below the search widget and the file and location will be opened and highlighted as you go up and down. If the folder is closed, the right arrow will open it. And the left arrow will close it again. It is pretty slick actually.
And Ctrl+Shift+F gives focus back to the search pane and you can scroll through your old results (with the arrow keys or F4) even if another term was selected and populates the search input - as long as you don't hit enter - which would perform the new search.

Eclipse toggle show/hide panels

Is there a way to show/hide various panels in Eclipse?
For example, shift-alt-p opens the Package Explorer panel in my setup, but then to close the panel I have to mouse over and close it manually.
Ideally one could toggle show/hide panels in Eclipse with keyboard shortcuts set via prefs > general > keys
Tough on the wrist to go keyboard-mouse-keyboard-mouse all day.
Perhaps I'm missing some magic combo, please enlighten if you have the Nirvana to spare.
Press Ctrl+F7 you will get below pop up.
Traverse or cycle through the views you want to close by pressing F7 key. After selecting the view to be closed in the above pop up release Ctrl key.
Then the view to be closed will be activated.
Go to Window->Preferences type keys in the search box. Check whether any short cut key is assigned to close part. Refer below picture,
In my case it is assigned to Ctrl+W. Once the view is activated press this short cut key to close the view. If any short cut key is not assigned to close part then you can assign new short-cut key for this.
Click on Binding text box(Refer second picture) and assign your own short cut key.

What menu is called by Alt-Shift-S in Eclipse?

What menu is called by Alt+Shift+S combination in Eclipse? How to call it from main menu? It is mostly resembles Source menu but has some differences.
Source menu
Source menu looks same but not exactly:
It is Source menu. If you do a right click in java editor you can see key combination for it and if you hover over Source you can see it is the same.
About the visual difference: If it is invoked from the main menu, disabled menu items stay visible (but grayed), because you would be very confused if the vertical position of the same menu item changed all the time (depending on how many other menu items above are disabled).
Context menus on the other hand are invoked at arbitrary places of your screen, so you don't notice a certain menu item offset "jumping" relative to the complete context menu. That's why many menu items are not just disabled in the context menu, but set to invisible.
That's the Source menu, Alt + Uppercase S