Community
    • Login

    Folding based on Indent?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    2 Posts 2 Posters 9.3k Views 2 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.
    • Lee GriffithsL Offline
      Lee Griffiths
      last edited by

      Hi,

      How do I get Notepad++ to fold based on the indent level?

      I noticed Python and YAML will fold based on indent level, but they have the side-effect of syntax colouring things incorrectly for the files I’m working on, so I don’t find them usable.

      I tried making a new language definition, but couldn’t figure out how to make it fold based on whitespace/indent level like YAML and Python do. The boxes seem to ignore whitespace, and expect to have an “end” delimiter which I guess this doesn’t have.

      I even tried looking at YAML and Python sections in the %AppData%\Roaming\Notepad++\langs.xml file, but it doesn’t seem to have anything about indent that I could copy.

      Any help?

      Thanks.

      1 Reply Last reply Reply Quote 1
      • Bortre IkariamB Offline
        Bortre Ikariam
        last edited by

        Hi. I found your post as I was googling for the same thing. I read on Stack Overflow that it can’t be done. It does it for Python and YAML thanks to Scintilla, which is the editor used within Notepad++ and which recognizes those two languages.

        http://stackoverflow.com/questions/7246004/configure-notepad-to-use-indentation-based-code-folding

        I’m using indentation to describe a complex array in PHP. For my purposes, the Python style works ok. On my computer, the YAML language makes all the text red. I hope one of the two works for you.

        1 Reply Last reply Reply Quote 0

        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