Aligning Multiline Edit Cursors With Visual Studio Code - visual-studio-code

With Visual Studio Code's multiline edit functionality, is there a way to easily align all cursors in a column at the end of a line if the whitespace doesn't already exist (similar to what is possible with Notepad++)?
From this:
To this:

There is this extension by Mike Moore
https://marketplace.visualstudio.com/items?itemName=yo1dog.cursor-align
First I install the above extension.
Test Test <- Space here
even longer test text
testing
Selected multiple cursor as shown by |
Test Test |
even longer test text|
testing|
Then in command pallet (ctrl+p) and (shift+>) I type Align Cusor. Else I use Alt+A. Giving you this desired result
Test Test |
even longer test text |
testing |

Related

Visual Studio Code select same position above and below not the whole line before and after (see image)

I'm using visual studio code and run into a weird problem. I'm not sure how I got here - I could have accidently pressed a shortcut unknowingly.
I'm trying to select a phrase, link or anything that crosses multiple lines (whether the lines are true lines or due to word wrap). When I select multiple lines, it doesn't automatically select the text at the start and end between the two points. Rather, it just selects the length of text for that line and repeats it in the subsequent lines. See the image below to understand.
Image of issue
As you can see, I am trying to select the words from "the" to the end of "sub". Instead of selecting all the words between the two, it selects the text "the instru" and selects every line with the same amount of characters/length.
In order to show what I am expecting, I have pasted the text into Notepad and done the same thing.
What I am expecting
As you can see, all the words between "the" and "sub" are selected.
If anyone has any idea about how to fix this, I would be greatly appreciative.
Below is a copy of the text if the images don't display.
Follow the instructions below for a click guide to retire and/or add 'School'.
Best practice if there is a change in 'School' structure would be to 'retire' any existing school setup that is no longer required and add the new sub school information. The reason why we don't just edit existing school names (typically) is due to leaving historical data intact.
Try using ctrl+shift+P and typing "Toggle Column Selection Mode"

How to disable a tip line in VS code with Rust program?

In the screenshot shown here:
VS code automatically added a tip line showing as "1 implementation" in the Rust code between line 14 and line 15.
My question is: how can I disable this gray tip line? and what is the official name for such tip lines inserted?
Assuming you're using rust-analyzer, in File | Settings | search for Rust Analyzer > Lens: Implementations and uncheck the box then restart VS Code.
The corresponding (boolean) JSON value is rust-analyzer.lens.implementations.
You can still find implementations by right clicking on the type anyway, so there's no real loss in setting it to false.

VS Code adds spaces between content when pasting

When I copy this, for example:
<AdmobComponent/>
It pastes as:
< AdmobComponent / >
Does anyone have any suggestions? I don't even know where to start to fix this.
From within the IDE:
Go to File | Preferences | Settings and then click Text Editor | Formatting.
The top option should be FormatOnPaste, make sure this is unchecked.
If you are using the Prettier extension, then this is a known issue.
For anyone having a similar problem in Visual Studio 2019 it can be fixed as follows:
Go to Tools | Options | Text Editor | {language}
Now depending on the Language the options that need to be changed could be in a few different places or missing. But for C# and JavaScript go to Code Style | Formatting
Once there there are a few options. If "Automatically format on paste" is unticked it will completely remove any reformatting on paste.
Or for a more limited impact go into the "Spacing" section and change "Set spacing for operators" to "Ignore spaces around binary operators". By doing this some automatic reformatting is lost but I think it's worth it not to have all those spaces inserted into stuff like Kebab case variables.

How to use $ in emmet

Hi I want to display $123,456.00 in a span. I tried with span{$123,456.00} and it is expanding to <span>,456.00</span> (I understand $ is used to render index in loop). How can I escape $ in emmet so I can get expansion <span>123,456.00</span>
Editor: Visual Studio Code
System: Mac OS Sierra
According to Emmet Docs,
The $ character is used for tabstops and variables, the | character it used to indicate caret position when snippet is expanded. If you want to output these characters as-is, you should use double backslash to escape them: \\$ or \\|
So ,
span{\\$123,456.00} should work.
It seems Visual Studio Code has a bug and I have raised an issue to track it.
Update
Seems to be fixed.
According to the developer:
A single escape will work in tonight's Insiders.
So, span{\$123,456.00} should work in the next update of the editor.

Out-GridView in PowerShell: How to change the initial size of the window?

I often work with the useful function Out-GridView in PowerShell. Sometimes I only have little data to show in the GridView but it opens in a very big window every time. Is there a possibility to change the initial size of the GridView window? A table with 3 columns and 4 rows should not be displayed in a window that is nearly fullscreen on a 1920x1080 display ...
PowerShell is a scripting language, not really a GUI language. It's possible to create GUI's with the help of tools like SAPIEN PowerShell Studio and others, by using Winforms or wpf.
In short, what you want is not possible I'm afraid, as there's no parameter for it.
I ran into the same issue and ended up using this "workaround" that autosizes.
$null = [System.Reflection.Assembly]::LoadFile('C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\Microsoft.VisualBasic.dll')
$words = #"
Line 1
This is the line after line 1
The third line contains the number 5.
"#
#if "words" is an array, change below to ($words | out-string)
[Microsoft.VisualBasic.Interaction]::MsgBox(($words),0, "Title")