# Detection # --------- hook global BufCreate .*\.(s|S|asm)$ %{ set buffer filetype gas } addhl -group / regions -default code gas \ string '"' (? # remove trailing white spaces try %{ exec -draft s \h+$ d } } } def -hidden _gas_indent_on_new_line %~ eval -draft -itersel %< # preserve previous line indent try %{ exec -draft K } # filter previous line try %{ exec -draft k : _gas_filter_around_selections } # indent after label try %[ exec -draft k :$ j ] > ~ hook -group gas-highlight global WinSetOption filetype=gas %{ addhl ref gas } hook global WinSetOption filetype=gas %{ hook window InsertChar \n -group gas-indent _gas_indent_on_new_line } hook -group gas-highlight global WinSetOption filetype=(?!gas).* %{ rmhl gas } hook global WinSetOption filetype=(?!gas).* %{ rmhooks window gas-indent }