博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
命令行subl_使用Subl.exe从命令行打开Sublime文本(Windows)
阅读量:2509 次
发布时间:2019-05-11

本文共 3908 字,大约阅读时间需要 13 分钟。

命令行subl

was recently updated to Build 3065. If you're not on the bleeding edge , you won't see updates too often. When they happen, though, there's always some fun stuff in the update.

最近更新到了Build3065。如果您不是最新的 ,您不会经常看到更新。 但是,当它们发生时,更新中总会有一些有趣的东西。

In this latest update, two things stood out. One is having , and the other is geared towards Windows users. Windows users now have a command line helper in subl.exe!

在此最新更新中,有两点引人注意。 一种是有另一种是针对Windows用户的。 Windows用户现在在subl.exe具有命令行帮助subl.exe

Mac users have had this for a long time (subl) and it's great to see the equivalent come to Windows.

Mac用户已经有很长时间了( subl ),很subl看到Windows出现了这种情况。

什么是Sublime命令行助手? (What is the Sublime Command Line Helper?)

For those of you that don't know what it is and why it's so great, let's talk about how we currently add files and folders to Sublime.

对于不知道它是什么以及为什么如此之大的那些人,让我们谈谈当前我们如何向Sublime添加文件和文件夹。

The options that were available were to:

可用的选项包括:

  • Drag and drop a file/folder into Sublime

    将文件/文件夹拖放到Sublime中
  • Use the Open commands in the menu

    使用菜单中的“ 打开”命令

Now with the command line helper, we can add files/folders to Sublime straight from the command line!

现在有了命令行帮助器,我们可以直接从命令行向Sublime添加文件/文件夹

Let's take a look at how we can get everything set up. Go ahead and update Sublime Text to make sure you have the latest Build 3065 (Help -> Check for Updates). After the update, you may be able to go into your command line and type:

让我们看一下如何设置所有内容。 继续并更新Sublime Text,以确保您具有最新的Build 3065( 帮助 -> 检查更新 )。 更新之后,您可以进入命令行并键入:

subl.exe

subl.exe

This should open up Sublime Text.

这应该打开Sublime Text。

subl-not-found

If you get the error command not found then we'll need to set some things up.

如果您收到未找到的错误命令,则需要进行一些设置。

向您的路径添加崇高 (Adding Sublime to Your PATH)

The command wasn't found because Sublime Text isn't in your PATH. The things in your Windows PATH are accessible via the command line so we'll need to go ahead and add it. We will need to go into our Environment Variables settings. Do this by going to:

找不到该命令,因为Sublime Text不在您的PATH中。 您可以通过命令行访问Windows PATH中的内容,因此我们需要继续进行添加。 我们将需要进入我们的环境变量设置。 为此,请执行以下操作:

System Properties -> Advanced System Settings -> Advanced -> Environment Variables

系统属性 -> 高级系统设置 -> 高级 -> 环境变量

A nice shortcut to do this is to open up your command line and typing sysdm.cpl. That will open up the window we need.

一个不错的捷径是打开命令行并输入sysdm.cpl 。 这将打开我们需要的窗口。

Create a New System Variable Create a new system variable called SUBLIME that will point to the folder of your Sublime installation.

创建一个新的系统变量创建一个名为SUBLIME的新系统变量,该变量将指向Sublime安装目录。

subl-environment-variable

Add the System Variable to Your PATH Add the following to the end of your PATH variable: ;%SUBLIME%

将系统变量添加到PATH中将以下内容添加到PATH变量的末尾: ;%SUBLIME%

subl-windows-system-path

Now if you restart your command line (I'm using a mixture of ), then you should have the subl.exe command at your disposal!

现在,如果您重新启动命令行(我使用的是的混合物),那么您应该可以使用subl.exe命令!

subl.exe进入新的Sublime窗口 (subl.exe Into New Sublime Window)

You now have the ability to open a file or folder in a new Sublime window. Just find the one you want and type:

现在,您可以在新的Sublime窗口中打开文件或文件夹。 只需找到您想要的那个并输入:

subl.exe file_name or subl.exe folder_name

subl.exe file_namesubl.exe folder_name

subl.exe进入相同的Sublime窗口 (subl.exe Into Same Sublime Window)

To open files or folders into the current Sublime Text window, just add the --add modifier to your subl.exe command.

要将文件或文件夹打开到当前的Sublime Text窗口中,只需在您的subl.exe命令中添加--add修饰符即可。

subl.exe file_name --add or subl.exe folder_name --add

subl.exe file_name --addsubl.exe folder_name --add

结论 (Conclusion)

With every version, Sublime Text just keeps getting better and better. With the addition of subl.exe this brings a long wanted feature that was on Mac to the Windows users.

在每个版本中,Sublime Text都在变得越来越好。 通过添加subl.exe这为Windows用户带来了Mac上早已想要的功能。

For more Sublime Text goodness, check out these articles:

有关Sublime Text的更多信息,请查看以下文章:

Sublime Text logo used in the Featured Image by

的精选图片中使用了Sublime Text徽标

翻译自:

命令行subl

转载地址:http://cnywd.baihongyu.com/

你可能感兴趣的文章
为什么 Redis 重启后没有正确恢复之前的内存数据
查看>>
No qualifying bean of type available问题修复
查看>>
第四周助教心得体会
查看>>
spfile
查看>>
Team Foundation Service更新:改善了导航和项目状态速查功能
查看>>
WordPress资源站点推荐
查看>>
Python性能鸡汤
查看>>
android Manifest.xml选项
查看>>
Cookie/Session机制具体解释
查看>>
ATMEGA16 IOport相关汇总
查看>>
有意思的cmd命令
查看>>
js正則表達式语法
查看>>
Git学习系列-Git基本概念
查看>>
c#多个程序集使用app.config 的解决办法
查看>>
Linux+Apache+PHP+MySQL服务器环境配置(CentOS篇)
查看>>
Linux下获取本机IP地址的代码
查看>>
(C#)调用Webservice,提示远程服务器返回错误(500)内部服务器错误
查看>>
flex布局
查看>>
python-----python的文件操作
查看>>
java Graphics2d消除锯齿,使字体平滑显示
查看>>