diff options
| author | Maxime Coste <mawww@kakoune.org> | 2022-04-15 08:14:17 +1000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2022-07-05 08:43:40 +1000 |
| commit | 2d8456db102e13f37a5cd271868c330d73580f6d (patch) | |
| tree | e9c1c36be5bfa2ed61bea03462e1841bcde68a91 /rc/filetype/sh.kak | |
| parent | 266d1c37d0d970a7eff747f5e6a5773a3cea39d8 (diff) | |
Move user mappings to <space> and keep/remove selection to ,
Diffstat (limited to 'rc/filetype/sh.kak')
| -rw-r--r-- | rc/filetype/sh.kak | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/rc/filetype/sh.kak b/rc/filetype/sh.kak index 7a284c84..9a9f51e7 100644 --- a/rc/filetype/sh.kak +++ b/rc/filetype/sh.kak @@ -120,11 +120,11 @@ define-command -hidden sh-indent-on-new-line %¶ # done # # indent after do - try %{ execute-keys -draft <space> k x <a-k> \bdo$ <ret> j <a-gt> } + try %{ execute-keys -draft , k x <a-k> \bdo$ <ret> j <a-gt> } # copy the indentation of the matching for/when - matching on the do # statement, so we don't need to duplicate this for the two loop # structures. - try %{ execute-keys -draft <space> k x <a-k> \bdone$ <ret> gh [c\bdo\b,\bdone\b <ret> x <a-S> 1<a-&> <space> j K <a-&> } + try %{ execute-keys -draft , k x <a-k> \bdone$ <ret> gh [c\bdo\b,\bdone\b <ret> x <a-S> 1<a-&> , j K <a-&> } # Indent if/then/else syntax, e.g.: # if [ $foo = $bar ]; then @@ -142,11 +142,11 @@ define-command -hidden sh-indent-on-new-line %¶ # fi # # indent after then - try %{ execute-keys -draft <space> k x <a-k> \bthen$ <ret> j <a-gt> } + try %{ execute-keys -draft , k x <a-k> \bthen$ <ret> j <a-gt> } # copy the indentation of the matching if - try %{ execute-keys -draft <space> k x <a-k> \bfi$ <ret> gh [c\bif\b,\bfi\b <ret> x <a-S> 1<a-&> <space> j K <a-&> } + try %{ execute-keys -draft , k x <a-k> \bfi$ <ret> gh [c\bif\b,\bfi\b <ret> x <a-S> 1<a-&> , j K <a-&> } # copy the indentation of the matching if, and then re-indent afterwards - try %{ execute-keys -draft <space> k x <a-k> \belse$ <ret> gh [c\bif\b,\bfi\b <ret> x <a-S> 1<a-&> <space> j K <a-&> j <a-gt> } + try %{ execute-keys -draft , k x <a-k> \belse$ <ret> gh [c\bif\b,\bfi\b <ret> x <a-S> 1<a-&> , j K <a-&> j <a-gt> } # Indent case syntax, e.g.: # case "$foo" in @@ -166,13 +166,13 @@ define-command -hidden sh-indent-on-new-line %¶ # esac # # indent after in - try %{ execute-keys -draft <space> k x <a-k> \bin$ <ret> j <a-gt> } + try %{ execute-keys -draft , k x <a-k> \bin$ <ret> j <a-gt> } # copy the indentation of the matching case - try %{ execute-keys -draft <space> k x <a-k> \besac$ <ret> gh [c\bcase\b,\besac\b <ret> x <a-S> 1<a-&> <space> j K <a-&> } + try %{ execute-keys -draft , k x <a-k> \besac$ <ret> gh [c\bcase\b,\besac\b <ret> x <a-S> 1<a-&> , j K <a-&> } # indent after ) - try %{ execute-keys -draft <space> k x <a-k> ^\s*\(?[^(]+[^)]\)$ <ret> j <a-gt> } + try %{ execute-keys -draft , k x <a-k> ^\s*\(?[^(]+[^)]\)$ <ret> j <a-gt> } # deindent after ;; - try %{ execute-keys -draft <space> k x <a-k> ^\s*\;\;$ <ret> j <a-lt> } + try %{ execute-keys -draft , k x <a-k> ^\s*\;\;$ <ret> j <a-lt> } # Indent compound commands as logical blocks, e.g.: # { @@ -194,9 +194,9 @@ define-command -hidden sh-indent-on-new-line %¶ # white space (including a newline), though technically it can also be # ';'. Only vertical white space makes sense in this context, though, # since the syntax denotes a logical block, not a simple compound command. - try %= execute-keys -draft <space> k x <a-k> (\s|^)\{$ <ret> j <a-gt> = + try %= execute-keys -draft , k x <a-k> (\s|^)\{$ <ret> j <a-gt> = # deindent closing } - try %= execute-keys -draft <space> k x <a-k> ^\s*\}$ <ret> <a-lt> j K <a-&> = + try %= execute-keys -draft , k x <a-k> ^\s*\}$ <ret> <a-lt> j K <a-&> = # deindent closing } when after cursor try %= execute-keys -draft x <a-k> ^\h*\} <ret> gh / \} <ret> m <a-S> 1<a-&> = |
