Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    auto-indentation in javascript file

    Help wanted · · · – – – · · ·
    auto-indent javascript auto indentation
    2
    3
    2250
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Adriano Ellero
      Adriano Ellero last edited by

      how to get auto-indent function in javascript file? any hint? any plug-in?

      Meta Chuh 1 Reply Last reply Reply Quote 0
      • Meta Chuh
        Meta Chuh @Adriano Ellero last edited by Meta Chuh

        @Adriano-Ellero

        go to plugins > plugins admin and install jstool.
        (jstool is available on both 64 bit and 32 bit versions of notepad++)

        after installing jstool, open up any unformatted .js file in notepad++ and go to plugins > jstool > jsformat

        here is a larger unformatted .js file (jquery compressed), if you need something to test on: https://code.jquery.com/jquery-3.3.1.min.js
        (this is a good file for testing, as it has 86kb of code in just 3 lines, which will be expanded to readable 118kb in 4157 lines, after running jsformat)

        note: i did not find any plugins, that are able to correctly format/indent mixed html and js code.
        if you have mixed html/js files, you currently have to copy the js code part(s) to a new tab, run plugins > jstool > jsformat from there, and then copy/paste the formatted js back to your mixed html/js file, replacing the unformatted js code part.

        1 Reply Last reply Reply Quote 2
        • Adriano Ellero
          Adriano Ellero last edited by

          thanks it works!!!

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Copyright © 2014 NodeBB Forums | Contributors