VS Code: How to move selection horizontally - visual-studio-code

In VS Code's github a move selection left and right sort of action has been proposed and implemented back in 2016.
Here's the issue on GitHub.
But I couldn't find the command.
The attached GIF shows clearly what I mean (I'm unfortunately still not allowed to upload images so here's the link)

Try set keyboard shortcut searching for Caret:

Related

zen mode visual studio code — highlight only current function and blur the rest

There was a plugin for vim that would blur out everything in the current file except for the function your cursor was on or in the body of. I've googled every combo of query that describes that and looked through git commits of my old vimrcs but can't find it anywhere!
If you would scroll down or up into another function/body it will "reveal" that and blur everything else. It would also center with horizontal margin.
Regardless, is there an edit to zen mode or a plugin that could achieve this? And if not the blur effect, then is there a way to limit the characters visible to a number?
Something like the image halfway down in this article.

right click context menu in vs code executes immediately

When I right click in the editor, vs code executes whatever menu item the cursor happens to be over. It happens far too fast for me to make my actual choice known.
I have already spent 30 minutes trying to find a solution. If you search for "right click" in the Command Palette, you are told there are no matches. You don't get any hits in the docs, either. Please advise. Thank you.
It has been reported that the situation you mentioned is a bug in the repository on GitHub. It is reported that Visual Studio Code works fine when zoom is disabled.
You can update the following setting to override this behavior:
"editor.mouseWheelZoom": false
Or you can update the mouseWheelZoom setting from the pop-up window by using the shortcut CTRL + , to go to Settings.
It's crazy, but this is still an issue for Linux users after so many years. Especially, when using a Laptop with touch-pad it makes VSCode frustrating to use. The problem occurs when you use "native" window style (you can tell, because the theme will not be applied to context menus) and have a non-default zoom.
The GitHub issue that #sercan linked to has a few solutions. In order to save you some time, there is basically two things that I found work and make sense:
Set your zoom level to default / 0. In settings.json add: "window.zoomLevel": 0 This works with all window styles, but obviously is not always viable
Change the title bar style from native to custom. In settings.json add: "window.titleBarStyle": "custom" This will change how the title bar but also the context menus look. Setting this, you can zoom in again

How to hide/unhide comments with Microsoft VSCode?

I have a code with many comments, how can I hide these ones, but no delete, I need them after.
I need to hide all the comments in one click, not a simple collapse one
Can't find such feature as well.
Read this issue from GitHub - https://github.com/Microsoft/vscode/issues/46505
Seems like that VSCode can't do it (from the box) and all people waiting for that feature.
I was looking for a way to do that too as I put way too many comments making it hard to debug... and I came across this https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hide-comments it makes all the comments invisible, but it leaves special characters in place. There are also commands to toggle show/hide.
Hide Comments - Visual Studio Marketplace
We now have an extension for that. On the editor title, a toggle action is available to show/hide the comments quickly.
You can download from inside Visual Studio 2022 called unobtrusive code and it will hide all comments and put "+" symbols on the collapsed line to the left of your code that you can open or close them with. It works great.
*** TO GET THE EXTENSION: ***
I went to the Extensions menu at the top of VS 2022 and chose manage extensions.
Then in the manage extensions window that opens up, choose online then Visual Studio Marketplace. In the search at the top right of the manage extensions window type in unobtrusive code. download it and then exit Visual Studio. You should see a window pop up to install it.
When you start VS 2022 again and open a C# script, it should have all the comments minimized to the "plus symbols" to the left of the code!
Hope it works for anyone wanting to hide their comments.

Middle click in Visual Studio Code for scrolling?

I'm checking out this Visual Studio Code but when you middle-click for scrolling as you would everywhere else it selects code instead of scrolling. Not exactly like a left click but still, annoying for me. Is there a way to solve this issue?
No, unfortunately not (yet). But you can contribute here on github to make it happen.
Since the issue has been reported but not fixed for 5 years, you should upvote that issue, and then use the autohotkey workaround:
https://github.com/qooqu/vs-code-mbutton-scroll-ahk
(You have to hold the middle-button down in vscode and drag the mouse up or down to autoscroll, and it scrolls one line at a time instead of smoothly, but it's much better than nothing.)
(To use: Install AutoHotkey, then you can download and run the linked .ahk file)
There's an extension that allows this kind of behaviour in Visual Studio.
Visual Studio Marketplace Link

How to enable this Visual Studio Code vertical line?

This line appears when typing.
Screenshot of the image from an online video below.
Those are referred to as "diff decorations". You can control them by opening up your settings and searching for "diffDecorations".
You'll want to verify that scm.diffDecorations is set to either all or gutter. Additionally, as mentioned in the comments, you'll need to be using an SCM tool.