The built-in indent methods (cindent
, autoindent
, smartindent
) won't suffice for a custom language. You need to write your own indent plugin, which would go into ~/.vim/indent/dg.vim
.
Basically, you need to write a Vimscript function that examines the current (and previous) line(s) and determines the indent level from this. This function is then installed into 'indentexpr'
. See :help indent-expression
, which unfortunately only recommends to have a look at the existing indent scripts.