Live Edit in PhpStorm

Live Edit gives you an opportunity to see all the changes instantly in the browser without refreshing the page. Just install the browser extension, and as you edit HTML, CSS or JavaScript in PhpStorm, Live Edit will reload the corresponding browser pages and highlight the elements you are working on. Completion lookup is also live.

Just have a look at this screencast to understand why Live Edit is one of the main productivity-enhancing features for front-end web developers:

Live Edit configuration and usage workflow has been significantly re-worked for PhpStorm 7 / WebStorm 7. To make its behavior more predictable, we are now enabling Live Edit only within a JavaScript debug session, so a Run/Debug Configuration should be configured first.

You can automatically create Run/Debug Configuration and run Debug Session for any HTML file by clicking Debug file_name item in the file context menu (or in the context menu of the editor when the file is opened). Run/Debug configuration will be created, file will be opened in the browser.

Otherwise, you can create Run/Debug Configuration manually.

By the way, Live Edit also provides a Reload in Browser action. Map it to a hotkey and reload any page in your browser you are working on right from the IDE (including PHP pages or Smarty/Twig templates).

Please read the full tutorial on Live Edit in PhpStorm.

Give PhpStorm 7 EAP a try. And as always, let us hear your thoughts in the issue tracker, through the comments below or in our forums!

Develop with pleasure!
– JetBrains PhpStorm Team

This entry was posted in Cool Feature and tagged , , , . Bookmark the permalink.

31 Responses to Live Edit in PhpStorm

  1. jv says:

    Gee I hope it isn’t available ONLY in this new context. I REALLY LIKE the way live edit works now and would hate to have to configure one more thing to get it to work.

    Two of the best features of phpstorm are zero config xdebug and LiveEdit. Please allow a choice of whether we want this new behavior or not.

    (a three year purchaser of phpStorm licenses)

  2. Thorsten says:

    I agree with jv

  3. Arno.Nyhm says:

    very impressive the video, but: why you not add the used shortcuts as overlay captions so i can see which shortcuts are used? whithout this i can not learn the shortcuts :(

  4. Andrii Dieiev says:

    Any chances to get Live Edit to work in Opera 15+ since it is very close to Chrome and allows to install same extensions?

  5. Henning Kvinnesland says:

    +1

  6. Andrii Dieiev says:

    Any chanses to get Live Edit to work with Opera15+?

  7. Tom says:

    Please add a configuration option to restrict the live edit feature to selectable filetypes!
    In V6 live edit forces an reload on every change in php files, what causes a lot of problems. It is uncomfortable to switch live edit on/off, when switching from a html template to a php file!

    • Tom says:

      PS: Ohh, forget my hint. If I have understood correctly, the plugin forces just reload, if a template files has been changed. So the php part is executed every time. I hoped that the live edit changes the dom of the document, like the debugger in firefox do!!

      • Mikhail Vink says:

        It changes the dom of the document when you are working with HTML/CSS/JS, but if you are working with template engine (eg Twig, Smarty) you should re-execute it (there is PHP behind that after all).

  8. Pingback: | wsp-web

  9. jv says:

    Well, I truly hate the way Live Edit requires additional setup in PHPStorm7… glad I didn’t overwrite PHPStorm6… There’s lots to like about phpStorm7… but the new implementation of Live Edit isn’t one of those things…

    • Mikhail Vink says:

      @jv Could you please share your ideas on how to make Live Edit in PhpStorm better and what in particular you do not like? JS Run/Debug configuration now is created automatically when you hit “Debug …” in the context menu. It makes the entire workflow much more stable. We would be glad to hear your ideas on how to improve it! Thank you!

  10. RiderSx says:

    Totally agree with jv, it’s now impossible to live edit CSS if it included somewhere in Symfony2 templates, hidden deeply in you project bundle. Why the hell i should start Javascript debug session to edit css in a most comfort way? Uh, i wish i wouldn’t upgrade…

    • Mikhail Vink says:

      JS run/debug is the most comfort way now, as we also answered in your HabraHabr comment (http://habrahabr.ru/company/JetBrains/blog/198510/#comment_6920160) – Live Edit has been reworked in order to make it more stable and predictable.

      The most comfort way now is to create these JS run/debug configurations invoking “Debug …” in the context menu of HTML files. As for twig templates, for example, you can easily create this JS run/debug configuration for the actual file you are going to use Live Edit for.

      Feel free to share any ideas on improving the workflow. Thank you!

  11. VIRUXE says:

    I’ll just jump on the live edit sucks on v7 bandwagon and say i’m reverting to v6 just because of this.

    • Mikhail Vink says:

      Could you please tell us why? Have you tried following this tutorial – http://confluence.jetbrains.com/display/PhpStorm/Live+Edit+in+PhpStorm ?

      The only one major change in the PhpStorm 7 Live Edit workflow is that now you need to run JS Debugger to use Live Edit, but this JS run/debug configuration is created automatically when you select “Debug ..” from the context menu of the HTML file. And it makes Live Edit much more stable.

      We will be very glad to discuss all the issues you experience with new Live Edit. Thank you!

  12. nullpeter says:

    Live Edit for CSS doesn’t work anymore for me in PhpStorm 7. Changes in PHP or Twig files are triggering a page reload in a JS Debug Session. But changes in CSS-Files don’t show up anymore until a manual page reload.

  13. agon says:

    Doesn’t work on Webstorm 7 either, but worked fine on 6 with just HTML and CSS. I am trying to live edit my HTML and the CSS that’s being compiled from SCSS and it’s not working. I’m downgrading to 6 but this is a great inconvenience.

  14. Andrew Luhring says:

    Here’s my setup and results:
    JavaScript Debug:

    Url:
    http://localhost:5000/test/
    Browser:
    Chrome

    Remote URLs of local files (optional):
    File/Directory (structure):

    node_modules/
    public/ Remote Url : http://localhost:5000/
    routes/
    views/
    server.js
    Gruntfile.js
    controller.js

    Node.js:

    Node interpreter:
    /Users/me/.nvm/v0.10.21/bin/node
    Node parameters:
    Working Directory:
    /Users/me/Sites/website
    JavaScript file:
    controller.js
    Application parameters:

    Environment variables:

    Run with CoffeeScript plugin (unchecked).

    Before launch:
    External tool ‘derp/scss’

    derp/scss:

    Name: scss
    Group: derp
    Description: scss
    Options:
    Synchronize files after execution (checked)
    Open console (unchecked)

    Show in:
    Main menu (checked)
    Editor menu (checked)
    Project views (checked)
    Search results (checked)

    Tool settings:
    Program:
    + scss
    Parameters:
    + –style expanded –sourcemap –watch $FileDir$/style.scss:$FileParentDir$/stylesheets/style.css
    Working directory: $ProjectFileDir$

    Browser / Live Edit

    Open browser:
    After launch (Default [which is chrome]) (checked)
    with JavaScript debugger (unchecked)
    ^^^Unchecked because opening Chrome’s Dev tools kill the Live edit.

    JetBrains Plugin in Chrome

    IDE Connection:
    Host: 127.0.0.1
    Port: 63342

    Force CORS (Access-Control-Allow-Origin: *)
    http://localhost:5000, http://localhost:5000/*, http://localhost:63342/*,

    Start Node.js Debug Session (by clicking on the little bug icon.)
    Chrome launches to the correct page.

    Start JavaScript Debug Session (by choosing it from the debug drop down and then clicking the little bug icon.)
    Chrome page now has the ‘”JetBrains IDE Support” is debugging this tab’ message.

    Go to View and insure Live Edit is checked.

    Open up style.scss.
    Add
    *{
    border: 1px solid black;
    } # Wait for browsr to show changes.

    Result

    No changes happen until I refresh the page.
    Modifying any of my view files does not trigger a live update either (I’m using handlebars…actually express-hbs [node module]).
    Modifying any of my JavaScript files– either/both front and back end files does not trigger live edit.

    What do?

  15. Stuart Barker says:

    The various comments here suggest php templating should work. I’m using expression engine which has it’s own templating engine. Editing an included php works but editing the templates doesn’t update.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">