【问题标题】:Running the selected code in Sublime Text在 Sublime Text 中运行选定的代码
【发布时间】:2016-02-09 22:48:54
【问题描述】:

我在 Sublime Text 3 中创建了一个“构建系统”,如下所示:

{
    "cmd": ["node", "$file"]
}

我有一个文件 foo.js 包含两行:

01    console.log('foo');
02    console.log('bar');

如果我突出显示第 1 行。我可以在构建系统中只运行该行吗?

【问题讨论】:

    标签: javascript node.js sublimetext3


    【解决方案1】:

    也许这正是您所需要的: http://www.sublimetext.com/forum/viewtopic.php?p=29006

    BuildParts 插件允许您只运行选定的代码段,但现在不支持多选。

    【讨论】:

    • 请在您的回答中总结链接的相关部分。如果链接更改或不可用(正如 Sublime 论坛通常那样),这个答案将毫无用处。请参阅Meta Stack Exchange 上的this discussion,了解有关仅链接答案的更多信息。
    • 这个答案已经过时了。 BuildParts 在过去 7 年没有更新,并且似乎不适用于 Sublime Text 3。
    • 我于 2019 年 7 月 11 日在 Sublime Text 3 中使用了 BuildParts,效果很好。
    猜你喜欢
    • 1970-01-01
    • 2015-02-25
    • 2014-10-08
    • 2014-08-05
    • 1970-01-01
    • 2012-05-20
    相关资源
    最近更新 更多