Text replacement for Blender's text editor (hotstrings)

Here there is a little script that allows the use of hotstrings (text replacement as we type) inside the Blender’s text editor.

Demo Video

Download:
text_replacement.py (4.3 KB)

Install:

  • Copy text_replacement.py inside Blender addons folder:
    ex: C:\Blender\2.81\scripts\addons
  • Enable the addon at Blender user preferences.
  • Activate it at Text Editor’s properties (Ctrl + F).

Notes:
If for any reason the script enters in an infinite loop (never stops replacing text), dont panic, theres no need to kill Blender, just deactivate the scripts at Text Editors properties so theres no risk of losing work. I believe i have covered all cases in which this may happen but just in case.

Hope you like it!

3 Likes

Very nice add-on. Maybe it would make sense to add the “operator cheat sheet” as a lib to it?

I’ll add it to this list of Text Editor enhancement add-ons. I hope it is okay:

Yes it might be a good idea. By typing the operator it could automatically fill the paramaters. Not sure why i dont have that cheatsheet, perhaps comes with an addon.

Awesome post of yours, i didnt know there were so many good looking addons for the text editor. Ill definitely give them a try.

Thanks.

2 Likes

You need to enable Developer Extras in Preferences > Interface

Or you can run this command, which will open a new text block containing the operator list. One nice thing is that it includes add-on operators too.
bpy.ops.wm.operator_cheat_sheet()

2 Likes

Updated to support all python 3 builtins.
list, repr, abs, dict, … will add parenthesis automatically.

1 Like