# Detection # --------- hook global BufCreate .*\.(s|S|asm)$ %{ set buffer filetype gas } add-highlighter -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 %{ add-highlighter 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).* %{ remove-highlighter gas } hook global WinSetOption filetype=(?!gas).* %{ remove-hooks window gas-indent }