Why does VS Code allow only closing editors to the Right, but not to the left? - visual-studio-code

Why does VS Code allow only closing editors to the Right, but not to the left?
If one right-clicks an opened document tab in VS Code, then there will be an option to close all the tabs to the right, but not to the left. Why?

As to why this is I'm not exactly sure, Microsoft responded to a feature request posted in 2018 stating that they "try to keep VS Code lean" so perhaps they wanted to cut down on the number of items in that menu and didn't think it was useful enough to warrant having another menu item for this.
However, as of 2022, there are a couple of ways to get around this:
Press F1, search something like "close left" and select "Close Editors to the Left in Group" command.
Install this extension: https://marketplace.visualstudio.com/items?itemName=ctf0.close-tabs-to-the-left - this adds a menu item which simply executes the command in the first point.

Related

What is the equivalent shortcut for CTRL+D ("add selection to next find match") of VSCode in CLion?

Usually in Visual Studio Code, if I want to delete or modify a certain word from my file, I can highlight one of the words and then continuously press CTRL+D to highlight the rest of that same word in the file. But, in CLion, I am unable to find the equivalent shortcut.
I've Googled and searched here on StackOverflow but no luck. Maybe this shortcut doesn't exist in CLion? Can anyone confirm?
EDIT: It's also known as "Select next occurence" in other JetBrains products.
EDIT: The answer is ALT+J
it is alt+j in all of jetbrains products
So I just want to hit on a couple of options that you have, because I work with both CLion & VSCode as well, and needed the same exact keybinding in CLion.
KEYBINDING FUNCTIONALITY SEMANTICS
Unfortunately, it appears that no one cares about standardizing semantics when it comes to editor functionality/features, and keybindings. It can make moving from one editor to the next difficult, and flat out something many people just would rather not have to do.
Please Note:
_I am no expert on JetBrains IDE's, I am somewhat of an expert with VSCode though. I say this because, IDK how much JetBrains IDE's vary from one to the next, however, from having CLion, IntelliJ, and Access to Ryder I can tell you that in the standard IDE's the keymappings seem near Identical, but in Ryder, the keybindings are totally different.
DEV ENVIRONMENT
BOUND-KEYS (dev env's default)
SEMANTICS
CLion
ALT+J
"Add Selection for Next Occurrence"
Visual Studio Code
CTRL+D
"editor.action.addSelectionToNextFindMatch"
Visual Studio 2022 (IDE)
SHIFT+ALT+.
"Edit.insertNextMatchingCaret"
the The correct semantics for referring to the functionality you seek in CLion is contingent on the environment that its being implemented in. The following demonstrates how to correctly reference it in both JetBrains & Visual Studio Environments:
Add Selection To Next Find Match Ctrl+D editor.action.addSelectionToNextFindMatch
Once you know the semantics of the functionality that you want to customize, you no longer have to resort to using any editors default key mapping. You asked about, CLion, so I will demonstrate, in an image (or screenshot) below, how you can change the keybinding to be anything you want it to be.
To get to the window you see in the photo navigate by following the steps below.
Starting from the text editor, find the word 'FILE' on the 'MENUBAR' located at the very top of your screen.
Click on 'FILE' to drop open the 'FILE MENU'.
Scan through the __FILE MENU'_s ITEMS, until you see the selectable ITEM named 'SETTINGS' (it will have a wrench icon next to it).
4 Select 'SETTINGS' by left-clicking it, and you'll open the 'SETTINGS MENU' open.
Another 'LIST' will appear on the left side. There will be 'BOLD ITEMS' and regular weighted SUB ITEMS. Find the 'BOLD ITEM' that reads 'KEYMAP'.
Select 'KEYMAP'.
The image above shows the view in my IDE of the keymap menu. You can see a red arrow, as well as a green arrow, in the image.
GREEN ARROW
The green arrow shows where you can change the entire Keymap, as you can see in the image, mine is set to VSCode, and as far as I can tell, every keybinding is the same as in VSCode. You do have to download the VSCode keymap plugin though.
RED ARROW
The red arrow shows where the "Bound Keys" are listed. Right click on the keybinding and you'll see a menu that reads
Add Mouse Shortcut
Add Keyboard Shortcut
Add Abbreviation
"it may also have options for removing keybindings and mouse shortcuts, it all depends on how the keybinding you click on is configured"
To set the keybinding select Add Keyboard shortcut, and set it to what ever you want.

VS Code find result panel

Is there any way to print search results (Ctrl+Shift+F) to horizontal panel?
Current vertical view is really inconvenient for me as I see only small part of line. Thanks
Update: see Visual studio code - how to copy search results? The new search editor makes seeing and copying the results much more user-friendly.
And now you can just drag the Search view into the Panel.
v1.21 has helped this problem. See Horizontal panel search
// Preview: controls if the search will be shown as a view in the
sidebar or as a panel in the panel area for more horizontal space.
Next release search in panel will have improved horizontal layout and
this will no longer be a preview.
"search.location": "panel",
I don't think you can print those results yet but at least the view is much improved. I don't think you meant actually "print" but nevertheless...
EDIT: Functionality added after the original answer:::
You can now right-click anywhere in the search results and select "Copy All" to get all the search results into the clipboard. That context menu has some other options as well.
As of May 2020, the accepted answer is marked by VSCode as a deprecated setting, and no longer works.
Instead, use the Command Palette to find for "Open New Search Editor" to get a full-screen search experience. This option is not bound to a keyboard shortcut by default, and you'll have to do that separately (would be nice to have it as the default, IMO).

Eclipse - Close tabs to the right

Is there a plugin or some way to get a behaviour of close tabs to the right, like the chrome browser?
Close others allows you to keep only one single file open afterwards.
Close tabs to the right is essential, as it allows you to place files that are important on the left side, and then whenever you open tabs, you can still keep those that are important when closing the others, the right ones.
I don't think there's a plugin for that.
As an alternative, you could do CTRL+SHIFT+E to bring up the "Switch to Editor" dialog. From there, you could select all the editors to the "right" of your active tab and click Close Selected Editors to close them. It's not as fast as what you wanted but it lets you organize your tabs the way you want to (i.e. important tabs to the left).

Visual Studio variables/methods outline and dropdown options?

Eclipse has something like this showing you the outlines of method declarations, imports, variables...
Is there something similar in Visual Studio 2010? I can't seem to find it.
Another thing is the context menu dropdowns.
In Visual Studio, I have to click on the underlined word:
And wait for that little blue underscore to pop up then I have to carefully hover over it like so:
for the drop down menu to pop up. Then I have to click on it to bring up the options.
In Eclipse I can hover over the underlined word and get the options about half a sec later OR hover over it and press F2 immediately to get the options.
Does anyone know if such features are available in VS2010?
For your first question, there is a window called "Class View" that may be similar to what you want. You can access it via CtrlWC.
For your second question, if your cursor is on the identifier that is underlined, you can type either of the following in order to open that same context menu:
Ctrl. (that's a period or dot)
AltShiftF10

Navigating the Content Assist List in Eclipse

Here are the ways the Eclipse documentation states you can navigate the Content Assist list:
You can use the mouse or the keyboard
(Up Arrow, Down Arrow, Page Up, Page
Down, Home, End, Enter) to navigate
and select lines in the list.
But all of the options require you to move your hands significantly away from their natural place on the keyboard!
Are there any other, quicker ways I can navigate this list? Something like tab, or the j/k from vi?
This is a great feature, and you can implement it like so: bind movement keys in Eclipse's key binder and then use them in the content assist menu!
Preferences/General/Keys
Line Down: Bind to Ctrl+K
Line up: Bind to Ctrl+I
(both when 'Editing Java Source')
and then try moving with Ctrl-K/I when the content assist pops up!
In Kepler, as jed mentions in the comments, select "when editing text" instead and it should work.
If you try to fill in the content manually, Eclipse will move.
The search is quite advanced, e.g. "ArL" can match ArrayList, etc., so if you know what you are looking for, instead of navigation you could use search.
This is certainly not a solution for everyone, but if you switch to the Emacs keyboard layout you can just use the key bindings for the "previous line" and "next line" commands, e.g., Ctrl-P and Ctrl-N.