各位,我装了jsFormat这个插件,jsFormat把自己加入了右键菜单里面,还设置好了快捷键!
我想问下,怎么把Pretty Json这个插件也加入右键菜单里面,同时设置快捷键?
各位,我装了jsFormat这个插件,jsFormat把自己加入了右键菜单里面,还设置好了快捷键!
我想问下,怎么把Pretty Json这个插件也加入右键菜单里面,同时设置快捷键?
编辑/Packages/default/Context.sublime-menu文件
[
{ "command": "copy", "caption": "复制" },
{ "command": "cut", "caption": "剪切" },
{ "command": "paste", "caption": "粘贴" },
{ "caption": "-", "id": "selection" },
{ "command": "select_all", "caption": "全选" },
{ "caption": "-", "id": "file" },
{ "command": "open_in_browser", "caption": "在浏览器中打开" },
{ "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"}, "caption": "打开所在的文件夹..." },
{ "command": "copy_path", "caption": "复制文件路径" },
{ "command": "reveal_in_side_bar", "caption": "在侧边栏显示" },
{ "caption": "-", "id": "end" }
]
在{ "caption": "-", "id": "end" }之前添加一行,command字段设置你需要调用的插件名称。
也可以在Packages/User/目录下新建文件Context.sublime-menu
[
{ "command": "prettyjson", "caption": "Pretty Json" },
{ "caption": "-", "id": "end" }
]
那个是在开发插件的时候做了右键处理,你可以去找一下如何开发sublime插件的一些资料看看
这里有篇 sublime api 中文版,有兴趣可以看下~
http://mux.alimama.com/posts/549