如何从命令行打开VS Code

I am writing this blog post because I am setting up a new Mac and I run into the little things that I take for granted but they are not available by default when you first install VS Code (my favorite editor!).

我写这篇博客是因为我正在安装一台新的Mac,我碰到了一些我认为理所当然的小事情,但是当您首次安装VS Code (我最喜欢的编辑器!)时,默认情况下它们不可用。

I am so used to typing code foldername in the terminal to open a folder in VS Code. Or code filename to open a file.

我很习惯在终端中键入code foldername来在VS Code中打开一个文件夹。 或code filename以打开文件。

Today I did this, automatically, but the command was not found!

今天,我自动执行了此操作,但是找不到命令!

I had to go into VS Code, press cmd-option-P (or from the menu, View -> Command Palette and I searched “command” and there it was:

我必须进入VS Code,按cmd-option-P(或从菜单中View -> Command Palette然后搜索“ command”,它是:

Shell Command: Install 'code' command in PATH

Shell Command: Install 'code' command in PATH

I pressed enter, and the command was now available in the terminal.

我按Enter键,该命令现在在终端中可用。

Happy coding!

编码愉快!

翻译自: https://flaviocopes.com/vscode-command-line/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值