Community
    • Login

    Change Indent Keyboard Shortcut?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    27 Posts 5 Posters 11.0k 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.
    • Michael VincentM
      Michael Vincent @Alan Kilborn
      last edited by Michael Vincent

      @Alan-Kilborn said in Change Indent Keyboard Shortcut?:

      I’m not much of a NppExec scripter, but I’m curious about what your scripts will do with those circumstances, so I may just try it out! :-)

      My script basically looks at the selection and if it’s single line - it does some magic before calling the Edit=>Indent=>menu options. If it’s multiline selection, I just call the Edit=>Indent=>menu options.

      I don’t fully grok the source code at your link, but if all that’s in there, I wonder if it may be an easy lift for a talented N++ developer to change the current simple menu code to sending SCI_TAB/BACKTAB to actually doing some logic about single / multiline selection and making the menu items “do what they say”.

      Til then, I’m loving my scripts (since I’m actually editing Python right now with the exact troubleshooting use case I described above). Everything “looks like a nail” now to me I guess …

      Cheers.

      Alan KilbornA 1 Reply Last reply Reply Quote 2
      • Alan KilbornA
        Alan Kilborn @Michael Vincent
        last edited by

        @Michael-Vincent said in Change Indent Keyboard Shortcut?:

        I wonder if it may be an easy lift for a talented N++ developer to change the current simple menu code to sending SCI_TAB/BACKTAB to actually doing some logic about single / multiline selection and making the menu items “do what they say”.

        That’s a good idea, but I quoted some “issue” links above on it, and it doesn’t appear they’ve generated enough interest for any of the talents to work on it.

        1 Reply Last reply Reply Quote 0
        • Cr8zy_IvanC
          Cr8zy_Ivan @Michael Vincent
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • Cr8zy_IvanC
            Cr8zy_Ivan
            last edited by

            Oh wow, quite the topic I see.

            I’m trying to get this to work but finding it a bit frustrating.

            @Michael-Vincent, thank you so much for the plugin and the code!

            I’m a novice at Notepad++ and coding and general. I’ve installed the plugin, but then I’m confused as to what to do next. Macro\Modify Shortcut/Delete Macro? Plugins\NppExec\Show Console…? Save the code into a dll file? (I’m not even sure how dll files work)… oh boy

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

              @Stefane-Guevremont said in Change Indent Keyboard Shortcut?:

              I’m a novice at Notepad++ and coding and general. I’ve installed the plugin, but then I’m confused as to what to do next. Macro\Modify Shortcut/Delete Macro? Plugins\NppExec\Show Console…? Save the code into a dll file? (I’m not even sure how dll files work)… oh boy

              Plugins=>NppExec=>Execute. In the window, paste one of the “scripts” without the name and save with that name instead:

              e5c7e7f6-1f32-4a4e-a153-601c4cb877a9-image.png

              Do the same for the other saving it as the other name.

              Then, Plugins=>NppExec=> Advanced Options…

              2c012a93-81aa-408a-9850-2691ecc218db-image.png

              Add a name, select the script name you saved that matches and press the Add/Modify button. Make sure the “Place to the Macros submenu” at the top is checked.

              Finally, open Setting=>Shortcut Mapper… and add the “Ctrl + Alt + [” shortcuts:

              1f7c46d6-5891-46b0-8889-b1842e6fab2b-image.png

              Cheers.

              1 Reply Last reply Reply Quote 5
              • Cr8zy_IvanC
                Cr8zy_Ivan
                last edited by

                Wow, that’s so awesome. Thank you!

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

                  Here’s a weird condition…maybe:

                  Select one or more empty lines.
                  Press Tab.
                  Exactly nothing happens.

                  My goal was to have leading whitespace inserted on all lines at once, for each press of the tab key.

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