1

Is there a plugin or a macro, that creates a tar ball or a zip of all opened files / tabs in Sublime Text 2.

If not, how to make a plugin that does that?

I was checking the API of Sublime Text 2, only to know that there is no method that gets the full path of all open files.

However, I see that we have an option when we right click in any file - "Copy file path".

Which method it calls? Can I replicate the method to all tabs switching one by one? If yes, then how to cycle through open tabs one by one using the API?

4

1 回答 1

1

您可以使用window#views来获取所有视图(作为列表)。然后迭代每个视图并用于 view#file_name获取文件。至于创建 zip,请查看zipfile库。

对于您的特定情况,我将创建一个窗口命令。然后,您可以将其绑定到组合键或将其添加为命令选项板条目。最后,要设置可见视图,您可以使用window#focus_view. window#focus_group如果您有多个组,您可能还需要。

于 2013-08-30T02:56:32.150 回答