Home Download Buy Blog Forum Support

PHP Code fold when opening file

PHP Code fold when opening file

Postby jverdeyen on Wed May 09, 2012 1:32 pm

Hi!

I really like the code folding feature in Sublime, anyone knows if it is possible to automatic code fold my php files when opening them?

Thx!
jverdeyen
 
Posts: 5
Joined: Wed May 09, 2012 1:30 pm

Re: PHP Code fold when opening file

Postby agibsonsw on Wed May 09, 2012 2:01 pm

A first attempt is

Code: Select all
def on_load(self, view):
   if view.match_selector(0 ,"source.php"):
      view.run_command("fold_by_level", {"level": 1})
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 23 guests