add-highlighter global/indent show-whitespaces -tab "│" -indent "│" -spc " " -lf " " define-command softtab-enable %{ hook buffer InsertChar \t %{ try %{ execute-keys -draft "h\A\h+\z;%opt{indentwidth}@" }} hook buffer InsertDelete ' ' %{ try %{ execute-keys -draft 'h\A\h+\zi' }} } define-command toggle-whitespace %{ try %{ add-highlighter global/whitespaces show-whitespaces remove-highlighter global/indent } catch %{ remove-highlighter global/whitespaces add-highlighter global/indent show-whitespaces -tab "│" -indent "│" -spc " " -lf " " } }