aboutsummaryrefslogtreecommitdiff
path: root/plugin/template.vim
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/template.vim')
-rw-r--r--plugin/template.vim3
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_}}')