Here's a snippet for you:
:inoremap <expr> <Tab> getline('.')[col('.')-2]=~#'[-=]' ? ">" : "\<Tab>"
This is an expression mapping that maps <Tab>
in insert mode to >
if the character before the cursor is either -
or =
.
See :h :map-expression
.