summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorSimon Fowler <simon.fowler@anu.edu.au>2019-06-29 12:34:14 +1000
committerSimon Fowler <simon.fowler@anu.edu.au>2019-06-29 12:34:14 +1000
commitb2459f5ecbef3706c6a36c408453d5cacf31043f (patch)
tree3943703d4b9f61ffa9eb426302b15789c5a496ab /rc
parentba75289eb59c55c96fbebe06cb7d7d3c2788b2da (diff)
Remove the sh_auto_indent option.
We now auto indent by default, with the option to disable it handled by the `diabled_hooks` mechanism.
Diffstat (limited to 'rc')
-rw-r--r--rc/filetype/sh.kak14
1 files changed, 1 insertions, 13 deletions
diff --git a/rc/filetype/sh.kak b/rc/filetype/sh.kak
index 0b518fdb..a48e6d29 100644
--- a/rc/filetype/sh.kak
+++ b/rc/filetype/sh.kak
@@ -7,7 +7,7 @@ hook global WinSetOption filetype=sh %{
set-option window static_words %opt{sh_static_words}
hook window ModeChange insert:.* -group sh-trim-indent sh-trim-indent
- hook window InsertChar \n -group sh-indent maybe-sh-indent-on-new-line
+ hook window InsertChar \n -group sh-indent sh-indent-on-new-line
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window sh-.+ }
}
@@ -18,9 +18,6 @@ hook -group sh-highlight global WinSetOption filetype=sh %{
provide-module sh %[
-declare-option -docstring "attempt to automatically indent shell code. Defaults to no." \
- bool sh_auto_indent no
-
add-highlighter shared/sh regions
add-highlighter shared/sh/code default-region group
add-highlighter shared/sh/double_string region %{(?<!\\)(?:\\\\)*\K"} %{(?<!\\)(?:\\\\)*"} group
@@ -58,15 +55,6 @@ add-highlighter shared/sh/double_string/expansion regex \$(\w+|\{.+?\}) 0:value
# Commands
# ‾‾‾‾‾‾‾‾
-# Check sh_auto_indent option before attempting to auto-indent anything
-define-command -hidden maybe-sh-indent-on-new-line %{
- evaluate-commands %sh{
- if [ "${kak_opt_sh_auto_indent}" = true ]; then
- echo "sh-indent-on-new-line"
- fi
- }
-}
-
define-command -hidden sh-trim-indent %{
# remove trailing white spaces
try %{ execute-keys -draft -itersel <a-x> s \h+$ <ret> d }