Vim Script
lets:coding_styles = {}
lets:coding_styles['DefaultTab'] ='setl tabstop=4 shiftwidth=4 shiftwidth=4 softtabstop=4 noexpandtab'lets:coding_styles['Default'] ='setl tabstop=4 shiftwidth=4 shiftwidth=4 softtabstop=4 expandtab'lets:coding_styles['ShortExpandStyle'] ='setl tabstop=2 shiftwidth=2 shiftwidth=2 softtabstop=2 expandtab'lets:coding_styles['ShortExpandStyleTab'] ='setl tabstop=2 shiftwidth=2 shiftwidth=2 softtabstop=2 noexpandtab'
command!
\ -bar-nargs=1-complete=customlist,s:coding_style_complete
\ CodingStyle
\ execute get(s:coding_styles,<f-args>,'')function!s:coding_style_complete(...)"{{{return keys(s:coding_styles)endfunction"}}}
ExモードからCodingStyle Default
みたいな形で呼び出してます。