" Language: Nomsu " Maintainer: Bruce Hill " License: WTFPL if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetNomsuIndent() setlocal indentkeys+=. " Only define the function once. if exists("*GetNomsuIndent") finish endif function! GetNomsuIndent() let line = getline(v:lnum) let current_ind = indent(v:lnum) let previousNum = prevnonblank(v:lnum - 1) let previous = getline(previousNum) let ind = indent(previousNum) if previous =~ ':$' || previous =~ '\.\.$' || previous =~ '(\.\.)$' || previous =~ '\[\.\.\]$' || previous =~ '"\.\."$' let ind += &tabstop endif if line =~ '^\s*\.\.$' let ind -= &tabstop endif if ind == indent(previousNum) return current_ind endif return ind endfunction