Community
    • Login

    Make It Easy to Surround Text With Parentheses

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 4 Posters 2.1k 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.
    • hoji afzal 0H
      hoji afzal 0
      last edited by

      What do think of adding a menu item in Edit to place parentheses around selected text?

      I have needed to do this a few times and found it to be a rather tedious operation when required multiple times.

      Edit | Surround with Parentheses | (…), […], {…}, “…”, ‘…’

      Before: Hello, world!
      After: “Hello, world!”

      Michael VincentM 1 Reply Last reply Reply Quote 1
      • Michael VincentM
        Michael Vincent @hoji afzal 0
        last edited by Michael Vincent

        @hoji-afzal-0

        One of our esteemed colleagues @dail beat you to it:

        SurroundSelection

        I use this plugin all the time; stable and very useful (Windows 10, N++ 7.8.6 64-bit).

        Cheers.

        hoji afzal 0H 1 Reply Last reply Reply Quote 4
        • hoji afzal 0H
          hoji afzal 0 @Michael Vincent
          last edited by

          @Michael-Vincent

          Wow! This works easier than I thought :)

          Very nice! Thanks.

          1 Reply Last reply Reply Quote 0
          • Blupeterb254 BB
            Blupeterb254 B
            last edited by

            I’ve got a question, a n00b question.

            I’ve got the plug-in installed, and it is working per the instructions, but instead of surrounding each line with the character, it only surrounds the first and last character in the group.

            Each line has an EOL (CR + LF) and I’ve not been able to figure this out.

            The list I have has data that looks like:

            *.thisfile
            *.thatfile

            So when I grab the text, and hit the " character, this is what happens…

            “*.thisfile
            *.thatfile”

            Any suggestions? Thanks in advance.

            Alan KilbornA 1 Reply Last reply Reply Quote 1
            • Alan KilbornA
              Alan Kilborn @Blupeterb254 B
              last edited by

              @Blupeterb254-B

              It isn’t necessarily a “noob” question.

              What you need to do is to make a “rectangular selection” around items that you want to surround.
              You do this either by holding Alt while selecting with the mouse, or, with the keyboard, holding Shift+Alt while you cursor around with the arrows.

              In reality a rectangular selection is made up of N selections, one for each line it is part of.
              Because you then have N selections, when the Surround Selection functionality is invoked each of the N selections gets wrapped.

              Contrast this with the single selection you had that covered multiple lines (but was still a “stream” selection). Here when you invoke the functionality of the plugin, it “surrounds” the selection, but, since there is only one selection covering multiple lines, you only get a single pair of wrapping characters.

              Hope it makes sense; it is a bit wordy to explain. Or maybe that’s just me. :-)

              1 Reply Last reply Reply Quote 5
              • Blupeterb254 BB
                Blupeterb254 B
                last edited by

                Thank you for the explanation - I do get it now, while Alt-Shift to select text, it works exactly as I expect it would.

                I just didn’t understand that’s what I needed to do.

                This will help with adding file exclusions in FSRM.

                Thank you!

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