Skip to content

Instantly share code, notes, and snippets.

@rtorr
Last active April 16, 2025 11:06
Show Gist options
  • Save rtorr/233bf6ffd81b6ecdf534 to your computer and use it in GitHub Desktop.
Save rtorr/233bf6ffd81b6ecdf534 to your computer and use it in GitHub Desktop.
Visual Studio Code fish shell shortcut

Put this in your config.fish

run

code path/to/project

function code
set location "$PWD/$argv"
open -n -b "com.microsoft.VSCode" --args $location
end
@odravison
Copy link

Visual code has a new way to add code into your PATH env, if you're not already using code as a command for other thing ....

  1. Open visual studio code;
  2. Hit + SHIFT + P (mac) or ALT+SHIFT+P (windows/linux);
  3. Then search for: "Install 'code' command in PATH" and hit ENTER;
  4. Authenticate yourself;

This should add code command into your PATH

source: https://stackoverflow.com/questions/29955500/code-is-not-working-in-on-the-command-line-for-visual-studio-code-on-os-x-ma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment