- But actually VS Codium
- Built-in Browser
- Multiple workspaces
- Multiple Windows, one workspace
- Cursors, navigating, selection
- Important keyboard shortcuts
- Misc extensions of interest
- Networked VS Code
- Settings sync
- Editing prose
- Visualize weird stuff
- Various config one needs
- Bonus tips/gotchas
A code editor.
VS Code is something more powerful than a text editor, and less heavy than a classic IDE. It is Microsoft’s in-house competitor to the code editor Atom, with a similar technology stack, but somewhat cleaner and faster, last I checked. Also Atom might have been famous in this niche but now that Microsoft owns Atom and VS Code it is likely that Atom will gradually bitrot then evaporate into nothing.
I am not clear on the relationship between VS Code and the older, flabbier Visual Studio. Some shared branding without any particular shared code? I don’t care enough to ever find out.1
Anyway, VS Code is OK, it turns out.
But actually VS Codium
VS Codium is the pure community distribution of VS Code. Despite the editor being mostly open, Microsoft inserts some creepy code into the packaged version which VS Codium excludes. Why and how you should migrate from Visual Studio Code to VSCodium.
There are some things that might not work everywhere; does GitHub Copilot work in vs codium? 🤷♂️
In that case, one might want the mainline microsoft version.
# Ubuntu-esque wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \ | sudo apt-key add - echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' \ | sudo tee --append /etc/apt/sources.list.d/vscodium.list sudo apt update && sudo apt install codium # Windows choco install vscodium # Mac brew install --cask vscodium
This should work more or less identically to Microsoft’s version, except that Microsoft will know less stuff about you.
xdg-mime default code-insiders.desktop text/plain # X sudo update-alternatives --set editor (which code-insiders) #everywhere
Just download that from the download page
Running Visual Studio Code on Linux mentions auto-update workflows, e.g. the following one for ubuntu:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/ sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list' rm -f packages.microsoft.gpg sudo apt update sudo apt install code # or code-insiders
On pop os there is already a packaged version of VS Code which you can install from the Pop!shop app.
Simple Browser: Show runs a minimalist local browser.
I use extension to colorize the windows differently to avoid confusion.
Multiple Windows, one workspace
NB: some of this section is probably outdated.
Almost obvious but to get maximum value you have to learn a couple of extra things.
Multiline search expressions
require you to type
That’s for vanilla string matching.
For regex matching if I want to match
multiline search I need to explicitly add newline characters to your character classes, i.e.
NB I think this has changed now?
To replace regex groups you do the usual thing -
$1 is the first group etc and
$$ is a dollar sign.
Putting this together, if you wished to replace latex equation bracket syntax with latex
dollar syntax, you would replace
\\\[ *([\s\S\r]+?) *\\\]
interact with search usefully.
General multiple cursors are made by
There are many keyboard shortcuts to use them to automate menial chores.
See VS Code Python.
Important keyboard shortcuts
Tab switching is not obvious.
There are a lot of tweaks you could do, but short story:
Ctrl PageDown (Windows/Linux) or
⌘ ⌥ → (Mac).
Pane/editor switch is not obvious either:
⌘ 2 work.
See VS Code for LaTeX.
Misc extensions of interest
emoji and unicode
Insert Unicode is a handy tool for inserting arbitrary unicode by searching in various elaborate ways, including full emoji support. Alternatively, Unicode Latex converts from LaTeX character macros to unicode.
Eerily handy, and possibly insecure.
Networked VS Code
See networked VS Code.
There are two options to keep your fancy and elaborate VS Code customisations shared across various computers.
VS Code built-in settings sync
Microsoft itself supports a built in settings sync which works pretty well.
OG settings sync
If don’t want to sync everything, I can use sync pragmas, which look like this:
// @sync os=linux host=work-pc // @sync os=mac host=home-pc
See VS Code for prose.
Visualize weird stuff
vs code data preview is a tabular data visualiser/analyser for vs code.
Various config one needs
You config is in a JSON file, which is quaintly retro but does mean that 3rd party config is at least not purely abysmal. The location is the following:
But you can coordinate across OSes by using settings sync.
Hover/tooltip/hint/autocompletion things are too intrusive
There are a lot of features which huddle under the opaque umbrella of intellisense, because they let someone in marketing get too near the product. But they all need tweaking, so you have to work out which is which. First, which is hover, which is hints etc?
The thing that appears when you mouse over a character is
It probably does something useful in statically-typed languages, but often ends up
To clam it for all languages, perhaps
so it activates after 3 seconds instead of RIGHT NOW LOOK AT ME OH SORRY WERE YOU TRYING TO READ SOMETHING ON THE SCREEN.
The hints are probably also being annoying, right? because instead of letting you finish a line it wants to insert some wacky argument? disable that.
"editor.acceptSuggestionOnEnter": false, "editor.acceptSuggestionOnCommitCharacter": false,
That can be toned down by language for e.g. markdown.
How about bracket closing? (brrrrr) I am offended by every implementation of bracket closing I have yet seen, so I put this in my config:
Alternatively, I might want to use AI-assisted IntelliSense which is possibly less needy? :
Outline view in python is mostly imports
"symbolOutline.topLevel": [ "Class", "Module", "Constructor", "Function", "Method" ]
AFAICT the built-in one doesn’t do this.
Which language is that file?
Horizontal scrolling despite wordwrap
There is a bug built in to VS Code which causes the browser scroll horizontally to see a whole bunch of nothing on the RHS of the screen. AFAIU this is an attempt to let me see ghost text from temporary inline annotations. For me which was fixed by disabling this line blame in gitlens but I believe other add-ons can cause the problem. Beware inline text stuff.
git config --global core.editor "code-insiders --wait" # insiders
Launching VS code from command line
At one point I want to launch the command line for fish shell on macOS and needed to do this:
set -U fish_user_yaths \ "/Applications/Visual Studio Code.app/Contents/Resources/app/bin" \ $fish_user_paths
VS code seems to do it by magic rn.