From 1e0f6520ba3bf30bc6bf43f0858855d8ce90d22f Mon Sep 17 00:00:00 2001 From: mattn Date: Thu, 27 Oct 2011 19:15:10 +0900 Subject: intelligent indent. --- plugin/template.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugin') 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_}}') -- cgit v1.2.3-54-g00ecf