# VSCode (editor) 📝
Open source (Micro$oft) atlernative to sublimet-text. - VSCode / r/vscode
Frankly I find it complete nonsense to be using an editor in a web browser on an interpreted language, but you know what? People said the same of emacs in the ’80s and ’90s… - Making Emacs popular again
VS Code - What’s the deal with the telemetry? / HN
VSCode’s SSH agent is bananas - Unlike Tramp, which lives off the land on the remote connection, VSCode mounts a full-scale invasion: it runs a Bash snippet stager that downloads an agent, including a binary installation of Node.
# ☠️ powning VSCode ☠️
- I Almost Got Hacked in a Job Interview - througg .vscode/package.json
That’s the reason you have to trust the repo => remove .vscode folder
Stealth measures layered on top
- .vscode/settings.json:7 — “**/.vscode”: true in files.exclude hides .vscode/ from VS Code’s own file explorer. Victim never sees tasks.json while browsing the project.
- .vscode/tasks.json — fake “Welcome to Node.js v24.11.0” REPL banner as decoy output.
- AUTH_API in .env is base64-encoded to evade casual string search; the real attacker URL is also hardcoded inline in socket/index.js:73 for redundancy.
- server.js:39-45 — process.on(‘uncaughtException’) and unhandledRejection silently swallow all errors.
- async without await neutralizes the nominal “verification” guard.
# Isolation ⮺
# Launch a completely separate VS Code instance from the command line
$ code --new-window # when using nix-shell
# Use different VS Code profiles
$ code --profile "ProfileA"# VSCodium ⮺
Project exists so that you don’t have to download+build from source. This project includes special build scripts that clone Microsoft’s vscode repo, run the build commands, and upload the resulting binaries for you to GitHub releases. These binaries are licensed under the MIT license.
- Telemetry is disabled. - VSCodium
Install as .deb so update are managed by your system. congifure depot
$ sudo apt update && sudo apt install codium$ codium --extensions-dir ~/.vscode/extensions# Code-Server ⮺
Run VS Code on any machine anywhere and access it in the browser.
Note: this is not the same thing as Visual Studio Code Server, which has some licensing restriction like “hosting it as a service is not allowed”
Some restriction apply:
- note alls extension are working
- Cline does not work => use the cli instead.
# Nix/apt
This allows seamless integration with host: it share direct filesystem and tools in terminal like ninja/gcc, no need to customize the docker image.
$ nix profile add nixpkgs#code-server # Maybe old
# pick latest on github https://github.com/coder/code-server/releases
$ wget https://github.com/coder/code-server/releases/download/vX.X.X/code-server_X.X.X_amd64.deb
$ sudo apt install ./code-server_X.X.X_amd64.deb
$ code-server \ # default to 127.0.0.1:8080
--extensions-dir /home/yves/.vscode/extensionsRunning it as a systemd service
# /etc/systemd/system/code-server.service
[Unit]
Description=code-server
After=network.target
[Service]
Type=simple
User=yves
ExecStart=/usr/bin/code-server \ # default to 127.0.0.1:8080
--extensions-dir /home/yves/.vscode/extensions
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetTo activate
$ sudo systemctl enable code-server
$ sudo systemctl start code-server
#
$ journalctl -u code-server -f# Podman
Usuall pod restrictions apply…
$ podman pull ghcr.io/coder/code-server:latest
# start server with local socket only
$ podman run -d \
--replace \
--name code-server \
-v ~/DEV:/home/coder/project \
-p 127.0.0.1:8080:8080 \
-e PASSWORD="yourpassword" \
ghcr.io/coder/code-server:latest # SSH tunnel
This is the simplest way to securize access (auth+encryption)
# create ssh tunnel client <-> codeserver
$ ssh -N -L 8080:127.0.0.1:8080 yves-lab
# open browser on client at http://localhost:8080see also
# Feature
- Code Outline
- Code snippet allows to automate code generation. For eg generating lua class for pico8.
- Extentions
- profile - tailor specific usage (theme, font size, extensions, settings, keybindings,etc…)
★ : extension exist both in codium registry and vscode registry
# Customization
Synchronising Settings
- using your own github gist
- using microsoft / github account
# Useful extensions
- Peacock ★ - identify instance of vscode/project with unique color
- Back & Forth ★ - buttons for easier navigation through recent edit locations and opened files.
- EasyZoom - zoom with Ctrl-+/- or moose wheel
- ∑ Fast Unicode Math Characters² / github
-
Setting Cycler - add easy way to toggle commands.
- Toggle Column Selection - switch selection from normal/column mode -
Alt/Shift I
# Code Annotation ⮺
- Todo Tree - searches for comment tags like TODO and FIXME - require ripgrep
- Bookmarks - Mark/unmark positions in your code
# Others
-
ANSI Colors - display a file with ANSI color escape sequences
- Asciiflow2 - draw ascii diagram
- org-mode - from Emacs a mode for keeping notes, authoring documents, computational notebooks, literate programming, maintaining to-do lists, planning projects, and more
- Graphviz - graph visualization
- Cursorless - a plugin that integrates with voice control software to let you do AST level code editing with your voice.
# Markdown
# Dev
- Native Debug - integrated debugger
# Code Runner ⮺
Runs selected code snippets per click or keyboard shortcut.
- if cusomizing command make sure they are compatible with your current shell
- by default has its own telemetry on
Settings - make sure to enable these
- save all files before running
- Run In Terminal
- Clear Previous Output
- File Directory As Cwd - may/not be depending on your use
# C++ ⮺
- clangd - Provides C/C++ language IDE features for VS Code using clangd:
- code completion
- compile errors and warnings
- go-to-definition and cross references
- include management
- code formatting
- simple refactorings
- C++ TestMate - run unit Test inside VSCode
- Disassembly Explorer - an alternative to Compiler explorer
# Crystal ⮺
# Python ⮺
# shader
- Shader toy Show GLSL Preview” command.
- glsl-canvas
# Tips & Tricks ⮺
# Remote
Run inside chrome and work over ssh.
If you have Chrome installed, it opens the browser in app mode. That means there’s no keybind conflicts, address bar, or indication that you’re coding within a browser. It feels just like native VS Code.
prefer coder/code-server
Otherwise continue below
# VS Code Remote ⮺
- work over ssh
- on container
- on WSL (windows)
does not work with fish as default user shell => will cause a Timeout on VSCode client (though ssh work perfectly).
# Run over ssh ⮺
By default, sshcode will rsync your local VS Code settings and extensions to the remote server every time you connect.
#You can specify a remote directory as the second argument
go/bin/sshcode kyle@dev.kwc.io ~/projects/sourcegraph# Autocolor by Host ⮺
Using Peacock - it must be installed on both local and remote server (?). - doc
# Troubleshooting
- Github copilot extension - is doing rigrep => this can saturate cpu when opening home folder in remote. => disabling copilot extension solve it
# Install
# Theia ⮺
Runs VS Code Extensions