diff options
| author | Frank LENORMAND <lenormf@gmail.com> | 2019-10-22 11:02:06 +0200 |
|---|---|---|
| committer | Frank LENORMAND <lenormf@gmail.com> | 2019-10-22 11:02:06 +0200 |
| commit | 21614cb06ea4f7a7349c628e5b8a754f730b2f0d (patch) | |
| tree | a5a65ba0f4489808cf312a2db9e0d5699874ff40 /rc/filetype/python.kak | |
| parent | 3c34de7fe7db607fe2c0519471b8d3c4935ce717 (diff) | |
src: Create a <semicolon> named key
This commit allows using the <semicolon> expansion in commands, instead
of `\;`.
It makes commands look more elegant, and prevents new-comers from
falling into the trap of using <a-;> without escaping the semicolon.
Diffstat (limited to 'rc/filetype/python.kak')
| -rw-r--r-- | rc/filetype/python.kak | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rc/filetype/python.kak b/rc/filetype/python.kak index b88f5343..93f9a618 100644 --- a/rc/filetype/python.kak +++ b/rc/filetype/python.kak @@ -18,7 +18,7 @@ hook global WinSetOption filetype=python %{ hook window InsertChar \n -group python-indent python-indent-on-new-line # cleanup trailing whitespaces on current line insert end - hook window ModeChange pop:insert:.* -group python-trim-indent %{ try %{ execute-keys -draft \; <a-x> s ^\h+$ <ret> d } } + hook window ModeChange pop:insert:.* -group python-trim-indent %{ try %{ execute-keys -draft <semicolon> <a-x> s ^\h+$ <ret> d } } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window python-.+ } } @@ -145,7 +145,7 @@ define-command -hidden python-indent-on-new-line %{ # copy '#' comment prefix and following white spaces try %{ execute-keys -draft k <a-x> s ^\h*#\h* <ret> y jgh P } # preserve previous line indent - try %{ execute-keys -draft \; K <a-&> } + try %{ execute-keys -draft <semicolon> K <a-&> } # cleanup trailing whitespaces from previous line try %{ execute-keys -draft k <a-x> s \h+$ <ret> d } # indent after line ending with : |
