diff options
author | mattn <mattn.jp@gmail.com> | 2011-10-27 19:15:10 +0900 |
---|---|---|
committer | mattn <mattn.jp@gmail.com> | 2011-10-27 19:15:10 +0900 |
commit | 1e0f6520ba3bf30bc6bf43f0858855d8ce90d22f (patch) | |
tree | e31ff192f6848da00fab1bc8723f08f95d33ec92 | |
parent | 783f7e7203b4382b9bf868a1c5ce5998da6b0302 (diff) | |
download | vim-sonictemplate-1e0f6520ba3bf30bc6bf43f0858855d8ce90d22f.tar.gz vim-sonictemplate-1e0f6520ba3bf30bc6bf43f0858855d8ce90d22f.tar.bz2 vim-sonictemplate-1e0f6520ba3bf30bc6bf43f0858855d8ce90d22f.zip |
intelligent indent.
-rw-r--r-- | plugin/template.vim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/template.vim b/plugin/template.vim index 336c2a6..f200e74 100644 --- a/plugin/template.vim +++ b/plugin/template.vim @@ -84,6 +84,9 @@ function! s:Template(name) silent! normal dd endif let c = indent . substitute(c, "\n", "\n".indent, 'g') + if &expandtab || indent =~ '^ *$' + let c = substitute(c, "\t", repeat(' ', min([len(indent), &tabstop])), 'g') + endif silent! put! = c endif if stridx(c, '{{_cursor_}}') |