执行命令
echo 'set -g fish_user_paths "/Applications/Visual Studio Code.app/Contents/Resources/app/bin" $fish_user_paths'
或者 自己写入文件
在~/.config/fish/config.fish中添加
set -g fish_user_paths "/Applications/Visual Studio Code.app/Contents/Resources/app/bin" $fish_user_paths
好像也没有zsh方便....
code ~/.config/fish/
如果没有对应的文件, 需要自己新建一个
function code
set location "$PWD/$argv"
open -n -b "com.microsoft.VSCode" --args $location
end
function ..
cd ..
end

来源:oschina
链接:https://my.oschina.net/ahaoboy/blog/4462859