Sublime Forum

How to execute a package command within another package

#1

Hi !

I’m currently working on my own indenter package.
I would like to know how can I execute in my package a specific command that comes from another package.

In short my package should do:
Part 1: Run php_fmt command on the current file (the php_fmt command comes from package php_fmt)
Part 2: Then customize the result to my taste.

I have achieved the part 2, I’m just missing the part 1, I guess it’s easy.

Thanks for any help.

0 Likes

#2

There are many ways you can do it. A fast way would be

sublime.active_window().run_command('php_fmt')

Start reading the API page https://www.sublimetext.com/docs/3/api_reference.html and look on other packages as example.

0 Likes