Community
    • Login

    Insert specific text

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 603 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.
    • Mark DM
      Mark D
      last edited by

      Hello, I use notepad++ to write scripts for 3d modelling. Is it possible to programme the software to insert a blank line of text when i press a specific button? The line would just have spaces & commas in for me to populate. Thanks

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Mark D
        last edited by

        @Mark-D ,

        If you install the QuickText plugin, you can program a “named snippet” for that – for example, you could use the Shortcut Mapper to set a shortcut on the Plugin command tab for Replace Snip – my screenshot below shows Ctrl+Shift+Enter, but you can choose whatever you want.

        0baa135c-520a-4392-90ed-f3b422eca378-image.png

        Once that’s set up, then go to Plugins > Quick Text > Settings, pick the Language from the drop-down (Normal text if you don’t have syntax highlighting at all for your 3d-modelling text; udf if you have defined a User Defined Language for your modelling language, or the builtin language name if you are using one of the Languages from the top section of N++'s main Language menu), then define the snippet.

        Assuming you named your snippet bl for “blank line” and chose the Ctrl+Shift+Enter like I did, then you could just type bl then hit Ctrl+Shift+Enter, and the plugin would convert that bl into your blank-line text.

        (I know that sounds like a lot, but once you have the plugin set up, then you could use it for entering all sorts of snippet text. I use it for putting in my initial boilerplate when writing a script for the PythonScript plugin, or a new Perl program, and it has a bunch of predefined snippets for many common languages.)

        But if that’s still too much for you, you could also use Notepad++'s built-in macro feature. Do the following once, then after that, you’ll have a shortcut assigned:

        1. Macro > Start Recording
        2. type all the keystrokes necessary to enter the “blank line of text” (all the spaces and commas)
        3. Macro > Stop Recording
        4. Macro > Save Current Recorded Macro
          • give it a name
          • choose a keystroke combination

        Once you’ve done that, the keystroke combination you chose will type that same text every time, and that Macro will be saved when you exit Notepad++, so it will still be available the next time you run.

        Mark DM 1 Reply Last reply Reply Quote 2
        • Mark DM
          Mark D @PeterJones
          last edited by

          @PeterJones Hi Peter thanks so much for your help that looks perfect, do you have a link for the quick text plugin? Thanks Mark

          PeterJonesP 1 Reply Last reply Reply Quote 1
          • PeterJonesP
            PeterJones @Mark D
            last edited by

            @Mark-D said in Insert specific text:

            do you have a link for the quick text plugin

            You can install it using Plugins Admin.

            But here’s the link: https://github.com/vinsworldcom/nppQuickText

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