Jack Hayhurst

Getting started with vscode

First point, and most important point:

Use what editor suits you. Every damn time.

I happen to like VSCode, and this is my starter’s guide for it.

Install VSCode

There is the download page here. If you want, you can do that. But meh I’ve moved away from windows because update managers should be a thing.

So use one of the below commands!

brew install visual-studio-code
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 install apt-transport-https
sudo apt update
sudo apt install code # or code-insiders
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum check-update
sudo yum install code

Launching VSCode

Once you have installed vscode, you also want to + shift + p and run the command:

Shell command: Install code command in path

This lets you install extensions from CLI.

THis also lets you open a cwd in shell in a VSCdoe window with code .. Or you can add a cwd to the last selected VSCode window with code --add .

VSCode Workspaces

Over time, I have multiple code folders (multiple projects) that I open in the same window. Any window with multiple folders is a workspace. I have a folder in my personal repo that contains all of these workspaces.

This allows me to easily jump back into a “system” area, such as:

Keyboard Shortcuts

Keyboard shortcuts are kindof a big point. I do have some modifications.

Panels

File navigation

Preferences

I have heavily modified VSCode over time. I like my configuration. It does have some warts though, I could clean it up.

My live settings file is decently well documented.

Extensions

VSCode ships with support for Javascript built in. Support for other languages is added with extensions. I’ve listed the ones I use below, broken by language. Honestly, most of these don’t even load unless you open the filetype.

You can also paste these names into the extension pane. Open the extension pane with + shift + x.

Via CLI, you can install with things like:

code --install-extension <extension-name> <extension-name>

pbpaste | xargs code --install-extension

Or to just install everything I recommend:

curl -SsL https://raw.githubusercontent.com/jakdept/jakdept/main/dotfiles/vscode-install.list | xargs code --install-extension

VSCode Theming

VSCode ships with some default themes. To change your theme, run:

Preferences: Color Theme

Additional themes are just extensions. Search for theme extensions with @category:themes. I use this theme myself.

code --instal-extension gerane.Theme-WarpOS

Vim Mode

I am hooked on vim. VSCode does not natively support vim keybindings. I do miss that from Sublime. But this extension almost makes up the gap perfectly. Except your editor now needs half a second to load.

code --install-extension vscodevim.vim

VSCode Live Share

This extension is the second most important extension to me. I never use it, I am sad that I do not. It allows you to join someone else’s editor. It also allows someone else to join yours. It’s like Google Docs for VSCode.

code --install-extension ms-vsliveshare.vsliveshare

Do note, Vim does make this more interesting. Also, you have to sign into Github and follow some prompts.

GitLens

One of the big heavy VSCode extensions is GitLens. GitLens also drastically modifies your code window, dynamically as you move. GitLens also keeps pushing for access to Github, and Gitlab, even if you disable most of it.

With those two extensions, and the Git support built into VSCode, I avoid gitlens.

Other Extensions

I’ve got a ton others to go through, I will just list the rest and their use.

Editor Helpers

Application Extensions

Honestly, with kubectl and docker I more often just run the commands. But if you do not know them, the extensions can be more friendly.

General Format Extensions

Major Languages

Shell Languages

System Config Management Languages