diff --git a/contrib/fut.vim b/contrib/fut.vim new file mode 100644 index 0000000..f40a273 --- /dev/null +++ b/contrib/fut.vim @@ -0,0 +1,17 @@ +syntax keyword futKeywords module wire reg wire input output proc if else + +highlight default link futKeywords Keyword + +setlocal indentexpr=FutIndent() + +function! FutIndent() + let line = getline(v:lnum) + let previousNum = prevnonblank(v:lnum - 1) + let previous = getline(previousNum) + + if previous =~ "{" && previous !~ "}" && line !~ "}" + return indent(previousNum) + &tabstop + endif + + return indent(previousNum) +endfunction