fish 使用函数 实现 命令行打开vscode

北战南征 提交于 2020-08-11 23:29:33

执行命令 

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!