Sublime Text from Command Line

前端 未结 27 2209
时光说笑
时光说笑 2020-11-27 08:37

I installed Sublime Text and wanted to know how to open rb files in it from the terminal. I saw What is the command to make Sublime Text my core editor? and I s

27条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 09:37

    I just ran the Command Prompt program as an Administrator, and executed the following command.
    Simple, but works for me.

    echo "c:\Program Files\Sublime Text 3\subl.exe" %1 > %systemroot%\system32\subl.bat
    

    Of course, you can call the bat file whatever you want. From then on, as any user you can simply use:

    subl myfile.txt
    

提交回复
热议问题