Community
    • Login

    auto-indentation in javascript file

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

          thanks it works!!!

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors