diff options
author | mattn <mattn.jp@gmail.com> | 2011-11-02 11:51:28 +0900 |
---|---|---|
committer | mattn <mattn.jp@gmail.com> | 2011-11-02 11:51:28 +0900 |
commit | afcff8be0816042d3ef4d3ee02b5851e9207769f (patch) | |
tree | 9c7d3f21f6791b4fab2ad1d907e95bc6adf1b4a5 | |
parent | 59f5cd24d34d663bfb2dda66f01f92bf7087d168 (diff) | |
download | vim-sonictemplate-afcff8be0816042d3ef4d3ee02b5851e9207769f.tar.gz vim-sonictemplate-afcff8be0816042d3ef4d3ee02b5851e9207769f.tar.bz2 vim-sonictemplate-afcff8be0816042d3ef4d3ee02b5851e9207769f.zip |
workaround for indent.
-rw-r--r-- | autoload/sonictemplate.vim | 10 | ||||
-rw-r--r-- | plugin/sonictemplate.vim | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/autoload/sonictemplate.vim b/autoload/sonictemplate.vim index c6bf121..e29f397 100644 --- a/autoload/sonictemplate.vim +++ b/autoload/sonictemplate.vim @@ -1,7 +1,7 @@ "============================================================================= " sonictemplate.vim " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> -" Last Change: 28-Oct-2011. +" Last Change: 02-Nov-2011. let s:save_cpo = &cpo set cpo&vim @@ -17,7 +17,7 @@ function! sonictemplate#select() abort if name == '' return endif - call sonictemplate#apply(name) + silent! call sonictemplate#apply(name) endfunction function! sonictemplate#complete(lead, cmdline, curpos) abort @@ -89,11 +89,9 @@ function! sonictemplate#apply(name) abort silent! put! = c endif if stridx(c, '{{_cursor_}}') - silent! call search('{{_cursor_}}', 'w') - silent! s/{{_cursor_}}//g + silent! call search('{{_cursor_}}\zs', 'w') + silent! exe "normal a".repeat("\<bs>", 12) endif - silent! exe "normal! \<c-o>" - startinsert endfunction let &cpo = s:save_cpo diff --git a/plugin/sonictemplate.vim b/plugin/sonictemplate.vim index 840b69b..89ff879 100644 --- a/plugin/sonictemplate.vim +++ b/plugin/sonictemplate.vim @@ -1,7 +1,7 @@ "============================================================================= " File: sonictemplate.vim " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> -" Last Change: 28-Oct-2011. +" Last Change: 02-Nov-2011. " Version: 0.02 " WebPage: http://github.com/mattn/sonictemplate-vim " Description: Easy and high speed coding method @@ -22,7 +22,7 @@ set cpo&vim command! -nargs=1 -complete=customlist,sonictemplate#complete Template call sonictemplate#apply(<f-args>) nnoremap <c-y>t :call sonictemplate#select()<cr> -inoremap <c-y>t <esc>:call sonictemplate#select()<cr> +inoremap <c-y>t <space><bs><c-\><c-o>:call sonictemplate#select()<cr> let &cpo = s:save_cpo unlet s:save_cpo |