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 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 theCtrl+Shift+Enter
like I did, then you could just typebl
then hitCtrl+Shift+Enter
, and the plugin would convert thatbl
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:
- 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