# 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 }