1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- if exists('loaded_OpenBSD')
- finish
- endif
- let loaded_OpenBSD = 1
- nmap <silent> <Leader>f :call OpenBSD_Style()<CR>
- function! IgnoreParenIndent()
- let indent = cindent(v:lnum)
- if indent > 4000
- if cindent(v:lnum - 1) > 4000
- return indent(v:lnum - 1)
- else
- return indent(v:lnum - 1) + 4
- endif
- else
- return (indent)
- endif
- endfun
- function! OpenBSD_Style()
- setlocal cindent
- setlocal cinoptions=(4200,u4200,+0.5s,*500,:0,t0,U4200
- setlocal indentexpr=IgnoreParenIndent()
- setlocal indentkeys=0{,0},0),:,0#,!^F,o,O,e
- setlocal noexpandtab
- setlocal shiftwidth=8
- setlocal tabstop=8
- setlocal textwidth=80
- endfun
|