命令行中的 Sublime 文本 [英] Sublime Text from Command Line
问题描述
我安装了 Sublime Text,想知道如何从终端打开其中的 rb
文件.我看到了 制作 Sublime Text 的命令是什么我的核心编辑器? 并且我看到我可以将 Sublime 设为我的核心编辑器,但我希望能够输入
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 see that I can make Sublime my core editor, but I want to be able to type
sublime file.rb
如何在 Windows 中执行此操作?
How do I do this in Windows?
推荐答案
From build 3065(发布日期:2014 年 8 月 29 日)以后的 Sublime text
包括一个命令行助手,nameley subl.exe
.它在 sublime 的安装文件夹中:将其复制到系统路径中包含的文件夹中.例如,在我的情况下,我复制了它
From build 3065 (Release Date: 29 August 2014) onwards Sublime text
includes a command line helper, nameley subl.exe
. It is at sublime's installation folder: copy it in to a folder included in the system path.
For example, in my case I copied it
来自 C:\Program Files\Sublime Text 3
到C:\Windows\System32
然后您可以在终端/控制台中使用 subl
作为打开任何文件的命令,例如在您的示例中:
You may then use in your terminal/console subl
as a command to open whatever file, such as in your example:
subl file.rb
或者你也可以修改你的系统 PATH
变量以包含 sublime 的安装文件夹,但我相信这涉及更多.
Or you may as well modify your system PATH
variable to include sublime's instalation folder, but I believe that is much more involved.
这篇关于命令行中的 Sublime 文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!