oedit*1というテキストエディタでCtrl+J時に現在行と同じインデント(行頭の空白、全角空白、タブ)と改行を挿入するマクロです。
oedit.scm
(app-set-key "Ctrl+J"
(lambda()
(editor-paste-string
(string-append "\n"
(rxmatch-substring
(rxmatch #/^[ \t]*/
(editor-get-row-string
(editor-get-cur-row))) 0)))))
"ENTER"でもいいかも。