A vim syntax for my concatenative language, nimf
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
520 B

setlocal indentexpr=NimfIndent()
function! NimfIndent()
let line = getline(v:lnum)
let previousNum = prevnonblank(v:lnum - 1)
let previous = getline(previousNum)
if previous =~ ":"
return indent(previousNum) + &tabstop
endif
if previous =~ 'if$' || previous =~ 'else$' || previous =~ 'do$'
return indent(previousNum) + &tabstop
endif
if line =~ 'else$' || line =~ 'then$' || line =~ 'loop$' || line =~ ';$'
return indent(previousNum) + &tabstop
endif
return indent(previousNum)
endfunction