while scripting in blender i found that some things could be automated, and so i started scripting. the script can be downloaded here.
so far i have:
* smart line break * smart delete * smart backspace
smart line break handles auto (un)indent and aligns lists.
# Example: def function (): # pressing return with the cursor after the ':' a = 1 # will automagically put the cursor before where you can type (auto indent) return a # pressing return with the cursor after 'a' will put the cursor # at the beginning of this line (auto unindent) function(arg1 = 1, arg2 = [1, 2, 3], arg3 = False) #each new line is automagically aligned to the previous
smart delete deletes all whitespace after the cursor.
# Example def function(): String = "Text" # Pressing Delete with the cursor at the end of this line "Text2" # will turn the line to the following def funtion(): String = "Text""Text2"
smart backspace handles whitespaces in groups of length of tab_width.
if for example tab_width is 4, then pressing backspace will backspace to the last multiple
of 4 spaces. it will act as if 4 spaces are one tab.
one thing however that i havent been able to make work, is to have this as an addon.
this because of the changing of older keys, which dont seem to exist before the splash-screen is clicked away.
so you have to open the script in blender in the text editor and run it. i myself have it open in my default blendfile, so i only have to click run. if someone knows a way around this, anyway, please tell me.
any C&C, requests and bug reports are welcome
have fun, DreamPainter