我正在尝试使用 v8 插件在 javascript 中为 sublime text 2 编写插件。有一个名为 test.js 的演示 javascript 文件,它似乎是一个完整的测试插件,但我不知道如何激活它。
有没有人设法使用 javascript 为 sublime text 2 编写插件?
还有其他方法可以解决这个问题吗?我主要想将文本发送到 javascript 以供我的各种库处理,然后发回文本。
编辑: 我正在使用这个项目让 v8 与 sublime 一起工作:https://github.com/akira-cn/sublime-v8
最佳答案
你可以试试这个插件https://github.com/akira-cn/SublimeJS
按照示例:
/** package.json **/
{
"name": "JSDemo",
"description": "demo plugin powered by SublimeJS",
"version": "0.1.0",
"author": {
"name": "akira-cn",
"email": "akira.cn@gmail.com"
},
"main": "index.js",
"licenses": [{
"type": "The MIT License",
"url": "http://www.opensource.org/licenses/mit-license.php"
}]
}
/** index.js **/
defineCommand("Hello", require("hello.command"));
/** hello.command.js **/
module.exports = function(view, edit) {
view.insert(edit, 0, "HelloWorld");
}
关于javascript - 使用v8插件实现sublime text 2的js插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9154078/