diff --git a/rc/fish.kak b/rc/fish.kak index 769b6f26..f0e2fd8e 100644 --- a/rc/fish.kak +++ b/rc/fish.kak @@ -41,6 +41,13 @@ def -hidden _fish_filter_around_selections %{ } } +def -hidden _fish_indent_on_char %{ + eval -draft -itersel %{ + # deindent on (else|end) command insertion + try %{ exec -draft w (else|end) } + } +} + def -hidden _fish_indent_on_new_line %{ eval -draft -itersel %{ # preserve previous line indent @@ -63,6 +70,7 @@ hook global WinSetOption filetype=fish %{ addhl ref fish hook window InsertEnd .* -group fish-hooks _fish_filter_around_selections + hook window InsertChar .* -group fish-indent _fish_indent_on_char hook window InsertChar \n -group fish-indent _fish_indent_on_new_line }