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!
编码愉快!