Are there shortcuts to go back and forth between current and last selected tab with vscode ?
Like I used to be able to do with webstorm.
Yes there is Ctrl + Tab. This will switch between current and recent tab.
You can also switch to any of open tabs by holding down the Ctrl key and hitting Tab repeatedly until your desired tab is highlighted from the tab selection dialog like that would appear upon first press of Ctrl + Tab keys,
Ctrl + Shift + Tab would do the same but it will start navigating to the tabs from opposite direction.
There is an extension for this Window Switch by Victor Zhang (yeannylam).
https://marketplace.visualstudio.com/items?itemName=yeannylam.window-switch
Change extension shortcut for windowSwitch.switchToLastOpenedFile.
Related
When working with multiple tabs what is the keyboard shortcut to close all other tabs excpet the current tab. There is way to do this from right clicking tab and clicking "Close Others"
Close Others from clicking
As of 2023 there is no need for an additional macro.
Press: ctrl + k + ctrl + s to open Keyboard Shortcuts, search for Close Other View: Close Other Editors in Group -> bind it to whatever you want. I liked my RStudio shortcut of ctrl+shift+alt+w
PS: there are also other interesting options like close all saved other tabs
I was trying to figure out how to toggle the side bar, and apparently ctrl + b is the way to do it, but when I perform it, it opens up the that input bar in the middle of the top portion of the editor, just below the menu bar, with "edt " (including the space) typed in.
My keybindings.json file shows that I should ctrl+b should indeed toggle the side menu.
If I delete the "edt " and press ctrl+b, it just regenerates it.
Anyone know how to fix this? Nothing shows up on Google either.
ctrl + b is bound to Add Function Breakpoint by default. You can edit the shortcuts from File->Preferences->Keyboard Shortcuts.
File > Preferences > Keyboard Shortcuts will show you a list of shortcuts.
You can search for Toggle Side Bar Visibility or workbench.action.toggleSidebarVisibility to see what the current shortcut bindings are, and edit them.
Mine were also showing the edt behavior you described, and were set to accept Ctrl + \ as well as Ctrl + K Ctrl + B for toggling the side bar visibility. Ctrl + \ may be worth trying out if you do not want to go through the hassle of finding a new non-clashing key combination to set as the shortcut.
If you see edt, it is because ctrl+b is bound by default to View: Show All Editors By Appearance.
As others have mentioned, use File > Preferences > Keyboard Shortcuts (or find it in the command palette with ctrl+p), then search for "Show All Editors By Appearance" and remove that key binding.
You may also remove any other ctrl+b bindings there, if they're in your way by searching for "ctrl+b".
Ctrl+B is normally worked in toggling sidebar in Visual Code, but some extensions prevent it, because ctrl+b is used in these extensions as a shortcut.
To solve this problem:
You should go to
File > Preferences > Keyboard Shortcuts
and then, you will change the shortcuts used as ctrl + b
View: Toggle Side Bar Visibility
The latest VS Code supports the Grid Layout
In the normal view if you have multiple files open they appear in tabs at the top. You can switch between this tabs by Holding down CTRL + TAB.
How can I do the same in the new Grid Layout?
What I know so far:
-It looks like when you use the Grid Layout the files get split up in to groups.
Once you have a new group you can add additional open files to that group and you have multiple tabs within that group and you can toggle between them with the CTRL + TAB.
-I have found that using CTRL + # (Where # is the group number) toggles you to that group
--Although this is close, it is not the same as the Ctrl + Tab
There is a "Focus Next Editor Group" action, I think this is what you are looking for. It has no keyboard shortcut set by default, you can assign one with these steps:
Open Keyboard Shortcuts Editor by pressing CTRL+Shift+P and searching for "Keyboard Shortcuts"
Search for "Focus Next Editor Group"
Click on "+" button on its left side
Press the shortcut, then press ENTER to save it
This is an extremely stupid question... but how do I close/toggle the search box in vscode?
I hit [ cmd + shift + f ] to do a global search, but then I need to reach for my mouse to actually close the box to allow for more screen space.
I've searched through their issues, and there seems to be another user in the past who also experienced something similar --> https://github.com/Microsoft/vscode/issues/32613 , but the solution provided of cmd - b only works for closing the sidebar.
My developer speed has drastically dropped since this issue, and I'm certain there's been a fix.
Please help. :(
**added in picture here -->
Press CTRL + SHIFT + E. It will switch to and focus the explorer.
Your search results are appearing in the panel, not the sidebar.
To toggle the panel:
pc/mac: ctrl + ` (backtick)
mac: ⌘ + J
However, if you want your search results to appear in the sidebar (which I think is the default behavior), then add this line to your settings:
"search.location": "sidebar"
Similar to what Vijey has mentioned, you can use the Toggle Panel keyboard shortcut which will do the job for me. On A mac the shortcut is
⌘ Command+J
I'm coming from sublime where the search results appear in a new tab - making it much easier to close the results (just like closing an other tab)
The best way to get rid of the search panel is by doing the following: -
On a windows computer, press and hold CTRL + Q
A window will then pop up, you can then release Q when the window pops up but you still have to hold down the CTRL key to keep the pop up open
3.Now use your mouse to click on the option called explorer and the search menu is now gone
There is no keyboard shortcut to close the search panel. However, you can create a shortcut yourself as shown in the attached image.
1) Go to File > Preferences > Keyboard Shortcuts.
2) Search for the command 'Close Panel' and set it to your convenient keyboard shortcut.
In the image below, I set it to Ctrl+F8.
If the search box displays in the sidebar (see Amr Noman's answer on how to set that up if it isn't already), How do you close the search box and go back to your project folders? In this case, there is no tab you can close with a click of the mouse. One way is to set up a keymap shortcut, e.g.
{
"key": "cmd+'",
"command": "workbench.files.action.showActiveFileInExplorer"
},
You can figure this out by going to Preferences -> Keyboard Shortcuts and searching for sidebar. One of the hits is described as "File: Reveal Active File in Side Bar"
More generally, any action that hides your project folder view in the sidebar can be cancelled by this shortcut.
I am wondering if there is any way to have a keyboard shortcut to a tab. Like for example Firefox having Alt+1 / Alt+2 / Alt+3 to go to tab 1 / 2/ 3 etc...
Cheers,
You can use F12 to go to the current editor and Ctrl + E to get a list of open editors. Then you can type a couple of characters to narrow down the list. The currently visible tabs are at the end of the list (use End or Up to jump there)
Ctrl + PageUp and Ctrl + PageDown select the previous and the next tab.
Ctrl + Q goes to the last edit position.
Alt + Left and Alt + Right go back- and forward through your editing history (like the back button in your browser).
Also, use Alt+PgUp and Alt+PgDown to shift between graphical layout and xml code inside android graphical layout editor for xml files.
for right side move CTRL+ page Down
for left side move CTRL+page Up
Using CTRL+F7 to navigate between two currently used views back and forth (kinda ALT+TAB in Windows).