VS Code Setting
VS Code provides two different scopes for settings:
- User Settings - Settings that apply globally to any instance of VS Code you open.
- Workspace Settings - Settings stored inside your workspace and only apply when the workspace is opened.
Workspace Settings
A VS Code "workspace" is usually just your project root folder.
settings.json in the workspace root.
Workspace settings as well as debugging and task configurations are stored at the root in a .vscode folder.
File > Preferences > Settings (Ctrl+,)
Terminal env variable
%APPDATA%\Code\User\settings.json
{ "terminal.integrated.env.linux": { "GIT_AUTHOR_NAME": "888" } }
Managing extensions
Hotkey: Ctrl + Shift + X
Extension: Remote-SSH
Install the "Remote Development extension pack"
By default, the "VS Code Server" is installed and maintained by the Remote
Set the "remote.SSH.configFile" property in your User settings.json file
configFile
Host remotehost.yourcompany.com User yourname HostName another-host-fqdn-or-ip-goes-here IdentityFile ~/.ssh/id_rsa-remote-ssh
Setting
Ctrl+,
remote.SSH.remotePlatform
"Always installed" extensions#
If there are extensions that you would like to always have installed on any SSH host, you can specify
which ones using the remote.SSH.defaultExtensions property in settings.json.
"Remote.SSH: Remote Server Listen On Socket"
/etc/ssh/sshd_config
AllowStreamLocalForwarding yes
Remote Env
# Default 有以下 Env TERM_PROGRAM=vscode
Fold & un-Fold
Fold All: Ctrl + k, 0
Unfold All: Ctrl + k, j
Ctrl + k, 1: namspace
Ctrl + k, 2: class
Ctrl + k, 3: methods
Ctrl + k, 4: blocks
Ctrl + k, [ or Ctrl + k + ]: current cursor block