- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 SublimeText 2 来编写我的处理草图,但是每次我需要运行程序时,我都必须切换到处理并单击运行按钮,Textmate 有一个包可以自动执行此过程,我想用SublimeText 但我不知道如何
顺便说一下,我正在使用 Mac OSX Lion
最佳答案
感谢早午餐 Storm 的建议!我修改了你的方法,以便在 Sublime 中打开的处理文件可以直接发送到处理应用程序。首先,我下载并安装了 TextMate 处理包,以便 .pde 文件在 Sublime ( http://www.onebitwonder.com/projects/processing ) 中被正确识别为处理文档(并突出显示语法)。如果您浏览该 tmbundle,则必须修改一个 TextMate 语言定义文件 (Processing.tmbundle/Syntaxes/Processing.tmLanguage)。在该文件的底部附近有一行:<string>source.java-processing</string>
此行必须更改为:<string>source.pde</string>
保存 Processing.tmLanguage 后,您可以将整个 Processing.tmbundle 包放到 Sublime 包目录中。现在在 Sublime 中打开一个 .pde 文档。在 Sublime 窗口的右下角是一个文档类型标识符,可能会说“纯文本”。单击该标识符并选择“以当前扩展名打开所有内容...”并选择“正在处理”,它现在应该在列表中。我写了两个 AppleScripts 来启动和运行 Processing 和一个 shell 脚本来驱动它们(这是我让 AppleScripts 按顺序从 Sublime 正确启动的唯一方法)。
如果第一个脚本尚未运行,则它会启动 Processing。此步骤是必要的,因为如果 Processing 未运行,则必须在 Processing 注册击键之前插入延迟(启动期间会出现几秒钟的闪屏)。 3 秒的延迟适用于我的系统,但您可能需要根据您的硬件延长延迟。也许其他人可以想出一种更优雅的方式让 AppleScript 等待处理通过启动画面。
第一个 AppleScript(我命名为“first_processing.scpt”):
--check to see if Processing is running
tell application "System Events"
set x to (count (every process whose creator type is "Pde1"))
end tell
--if Processing is not running, open Processing and delay
--for three seconds to allow time for splash screen
--to disappear and to allow keystrokes to be
--registered
if x is 0 then
activate application "Processing"
delay 3
end if
tell application "Processing"
activate
end tell
tell application "System Events"
--deliver the "run" command
delay 0.1
keystroke "r" using command down
--hide Processing; delay is necessary for reliable hiding
--you may want to turn off hiding to see error messages
delay 0.2
keystroke "h" using command down
end tell
osascript ~/Documents/AppleScript_Library/processing/first_processing.scpt
open -a Processing $1
osascript ~/Documents/AppleScript_Library/processing/second_processing.scpt
{
"cmd": ["sh", "full_path_to_shell_script/launch_processing_file.sh", "$file"],
"selector": "source.pde"
}
关于build-automation - 如何制作 Sublime Text 2 快捷方式来在 Mac 上运行处理草图?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9364483/
我可能遗漏了明显的,但似乎无法解决这个相当简单和典型的案例(在 Debian 或 XP 上使用 v3 build 3022,以防万一): 启动 Sublime Text 打开一个项目“myprj”,在
在 Sublime 的精神中,我知道即使您以后不将更改保存到一个文件中,也可以从上次中断的地方开始。在保存文件之前,我在sublime中打开了一个新标签,并关闭了该应用程序。升华是否将临时文件保存在计
我有两个关于 Sublime Text Editor 2 的问题。 我的第一个问题是,我在 Packages/User 文件夹中保存了几个不同的 .tmLanguage 文件(例如:Console.t
我在 Mac 上。 另外,需要注意的是,路径段为“Packages/Solarized Color Scheme/Solarized (Dark).tmTheme”的文件在文件系统上任何地方都不存在。
我正在使用第三个 Sublime 版本,我想使用这个 CSS 梳子:https://github.com/vitaligo/CSScomb.sublime-settings/blob/master/C
我正在尝试创建一个 Sublime Text 3 插件,它从 .html、.css、.js 和 .php 等文件复制代码,然后将其粘贴到 txt 文档中。 我的问题是,有时当我从包含大量代码的文档中复
使用 Anaconda IDE package 运行 Sublime Text 3在 Mac OS X 上,当我编辑 .sublime-project 文件时,由于某种原因,某些更改将在一段时间后被删
这是我的 Preferences.sublime-settings文件: { "bold_folder_labels": true, "highlight_line": true,
我正在寻找一种方法来右键单击 Windows 10 中的文件,选择“打开方式”->“Sublime Text”,然后出现一个新的 Sublime Text 窗口。 如果 Sublime 已经打开,默认
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
我根本不想要它们,更喜欢 git 命令行,但它们被添加到我的命令中,就好像它们已安装一样,即使我从未安装过 sublime merge。 有没有办法从 sublime text 命令面板中完全删除它们
我根本不想要它们,更喜欢 git 命令行,但它们被添加到我的命令中,就好像它们已安装一样,即使我从未安装过 sublime merge。 有没有办法从 sublime text 命令面板中完全删除它们
我在 Ubuntu 12.04 LTS 上。调用 sublime foo.txt 通常会在 Sublime Text 2 中打开 foo.txt。最近我安装了 Sublime Text 3 .除此之外
有没有办法在Sublime Text Build中使用Windows变量?我有一个S搭建的系统:。有没有办法在Sublime Text Build中使用Windows变量?我有一个S搭建的系统:。我会
当我在 Sublime Repl 控制台 (Python) 中输入并按回车键运行命令时,我得到了 super 烦人的自动完成接管并更改命令。 如何在 SublimeRepl 控制台中关闭此功能? 谢谢
我需要从 sublime text 2 迁移到 sublime text 3,以获得与我在 sublime text2 上安装的所有相同的配置/插件。 我安装了 sublime text 3,但它没有
Sublime Text 2 无法打开。我不断收到此错误: (Error trying to parse file: Unexpected character, expected a comma or
只是尝试在 Windows 8.1 上为我的 OpenGL 编码设置 sublime-build。 这就是我所拥有的: { "cmd": [ "gcc -o \"$file\" \"$file_bas
所以我有一个错误,当我尝试构建时,命令行显示: grunt-cli: The grunt command line interface. (v0.1.13) [Finished in 0.1s wit
我正在尝试安装 https://github.com/alek-sys/sublimetext_indentxml在 Sublime Text 3中。我读了 In Sublime Text 3 - c
我是一名优秀的程序员,十分优秀!