Sublime Forum

Newbie: couple of questions

#1

First of all, Sublime Text is amazing. Period.

I am kinda new to this app though, so I have some tiny questions:

  1. How do I make every new file I make have its default syntax theme (and type) set to PHP? (not it’s plain text)
  2. Is there a way to preview PHP files (just like Dreamweaver’s F12 preview thingy) with Sublime?

Thank you.

0 Likes

#2

Can’t do it right now, or at least I am not aware of this feature… Good news is that:
it is possible with a plugin. Hook into onNew(view) event and set syntax as PHP, shouldn’t be too hard (but then again you being new to sublime I guess it makes it hard :frowning:)

If I recall correctly f12 in dreamweaver previews current file in default browser… if that’s the case yes you can do that in sublime, just right click on the file and select “open in browser”, in sublime almost everything is configurable so of course you can bind that to f12 if you wish so, the command is openInBrowser put that in your user keybindings

<binding key="f12" command="openInBrowser">
0 Likes

#3

Currently you’d have to write a plugin, but I’ll change the ‘new’ command in the next beta so that you can give it a syntax file to use directly.

0 Likes

#4

this is working for HTML files, but for some reason it’s not sending PHP files to my browser. any ideas?

0 Likes

#5

Thanks for the reply(ies) and please excuse my typos.

Another thing that I can’t figure out if it’s an options thing or a default behavior thing is the fact that the project’s file selector dialog wont show the NEW files being made after the project was last opened.

The only workaround is to actually close the project and re-open it.

I am sure auto-populating the dialog with the new files would also come in handy.

Again, great app, thanks for making it.

0 Likes

#6

add this to your user keybinding:

<binding key="ctrl+shift+r" command="scanProject"/>
0 Likes

#7

Thanks @vim.

By the way, a tiny bug I just came upon:
Selecting using shift+cursor_down won’t scroll the window - as excepted - when the selection’s bottom row exceeds window height.

0 Likes