Community
    • Login

    auto-indentation in javascript file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    auto-indentjavascript autoindentation
    3 Posts 2 Posters 5.4k Views
    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 ElleroA
      Adriano Ellero
      last edited by

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

      Meta ChuhM 1 Reply Last reply Reply Quote 0
      • Meta ChuhM
        Meta Chuh moderator @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 ElleroA
          Adriano Ellero
          last edited by

          thanks it works!!!

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors