VS Code


As unfortunate as it is that Microsoft maintains it, VS Code is probably the best text editor out there right now. Below I document the tooling and setup I do to make the experience smooth and fast.

Extensions

Only a couple of extensions are really needed.

Remote-SSH
Enables connection to remote machines. As a poor sucker who has to use Windows I find this to be quickest way to escape to a Linux machine.

SSH-Agent

Visual Studio's own guide can be found here. The ssh-agent isn't really a VS Code thing. It's a fundamental tool available on every OS. However, it's very nice to integrate it in with VS Code.

On Windows, the ssh-agent has to be setup as a service. Fortunately this is easy in Administrator-enabled PowerShell. Simply input the following commands:

# Set up the ssh-agent service.
Get-Service ssh-agent | Set-Service -StartupType Automatic
Start-Service ssh-agent

# Verifies that it's running.
Get-Service ssh-agent

# Add key(s)
ssh-add PATH_TO_PRIVATE_KEY

Then run:

ssh-add -l
in the VS Code terminal to ensure that it's working. After that, you'll only have to enter passwords for that key once per session.

Writing HTML

CTRL+SHIFT+P >> keyboard It's nice to skip the closing tag that's auto-inserted when working with HTML in VS Code. This can be done by either finding the existing keycode for cursorLineEnd or setting a custom one. I like using shift+enter, which has some other default use that I don't personally take advantage of.

Rulers and Wrap

CTRL+, >> ruler They say it's bad to have lines of code longer than a certain length. The 80-character line is the traditional length, but screens have gotten better and I find 80 to simply be too short. My personal favorite is the 115-character line. Column 115 can be illuminated in VS Code by searching "ruler" in the settings and adding the width to the json.

This is especially relevant when writing long docstrings or HTML body text. Text wrap, however, has its own place even with rulers enabled. Lines of code should hard-wrap before the 115-character line limit is reached. However, when writing human-language text that might run onto multiple lines it's much more comfortable to use soft-wrapping.

CTRL+, >> wordwrap Soft-wrapping can be enabled by setting Editor: Word Wrap to wordWrapColumn and applying the character width to Editor: Word Wrap Column.

Experiments with Coloring

Below

Here I've drafted a little snippet that works with the Decorate Files extension to highlight code along hexagonal lines. This will color folders and descendants.

// A little experiment with highlighting hexagonal subsets.
"decorateFiles.filePaths": {
	// FD4836 : Red
	// 8DC17D : Green
	// D6981F : Yellow
	// 88A79B : Blue
	// EDDAB0 : Eggshell
	"adapters": "#88A79B",
	"blogic": "#D6981F",
	"domain": "#EDDAB0",
	"ports": "#8DC17D",
},
"decorateFiles.decorations.apply": {
	"enableFilePaths": true
}