Insert specific text
-
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
-
@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.
Once that’s set up, then go to Plugins > Quick Text > Settings, pick the Language from the drop-down (
Normal textif you don’t have syntax highlighting at all for your 3d-modelling text;udfif 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
blfor “blank line” and chose theCtrl+Shift+Enterlike I did, then you could just typeblthen hitCtrl+Shift+Enter, and the plugin would convert thatblinto 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:
- Macro > Start Recording
- type all the keystrokes necessary to enter the “blank line of text” (all the spaces and commas)
- Macro > Stop Recording
- 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.
-
@PeterJones Hi Peter thanks so much for your help that looks perfect, do you have a link for the quick text plugin? Thanks Mark
-
@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
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