How to call VS Code Editor from terminal / command line

前端 未结 21 1488
别那么骄傲
别那么骄傲 2020-12-04 06:22

The question says it all.

How can I open VS Code editor from

  • windows cmd
  • linux and mac terminal

e.g. for notepad++ I write

21条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 06:42

    VS Code is a must have code editor for 2018

    For Windows 10 users a lot is possible, the same way the Mac OS users type code . .

    Look for you VS Code \bin folder path e.g C:\Program Files\Microsoft VS Code\bin . The bin folder includes a file called code.cmd

    Follow the steps below and be proud of the OS you use.

    1. Search for "Advanced System Setting" from Start.

    2. Click on Environment Variables

    3. On System Variables choose "path" from Variable tab and click on Edit.

    4. Click on New on the right side of the popup window.

    5. Copy your path from the Explorer's breadcrumb path and paste it into the new opened path in step 4, example:- C:\Program Files\Microsoft VS Code\bin

    6. Click Ok on all the open windows to confirm changes and restart your cmd

    7. Go to your cmd and navigate to you working directory on server and type code .

    C:>cd wamp64\www\react-app> code . to open with VS Code on Windows.

    Visual Studio Code also includes a command prompt (terminal) window and you can open one or more of them with
    Ctrl + ` on your keyboard.

    Hope this helps some one like it did to many of us.

提交回复
热议问题