diff options
-rw-r--r-- | autoload/sonictemplate.vim (renamed from autoload/template.vim) | 16 | ||||
-rw-r--r-- | doc/sonictemplate-vim.txt (renamed from doc/template-vim.txt) | 40 | ||||
-rw-r--r-- | plugin/sonictemplate.vim (renamed from plugin/template.vim) | 7 |
3 files changed, 32 insertions, 31 deletions
diff --git a/autoload/template.vim b/autoload/sonictemplate.vim index b4b8ee6..c6bf121 100644 --- a/autoload/template.vim +++ b/autoload/sonictemplate.vim @@ -1,26 +1,26 @@ "============================================================================= -" template.vim +" sonictemplate.vim " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> " Last Change: 28-Oct-2011. let s:save_cpo = &cpo set cpo&vim -if exists('g:template_vim_template_dir') - let s:tmpldir = g:template_vim_template_dir +if exists('g:sonictemplate_vim_template_dir') + let s:tmpldir = g:sonictemplate_vim_template_dir else let s:tmpldir = expand('<sfile>:p:h:h') . '/template/' endif -function! template#select() abort - let name = input(':Template ', '', 'customlist,template#complete') +function! sonictemplate#select() abort + let name = input(':Template ', '', 'customlist,sonictemplate#complete') if name == '' return endif - call template#apply(name) + call sonictemplate#apply(name) endfunction -function! template#complete(lead, cmdline, curpos) abort +function! sonictemplate#complete(lead, cmdline, curpos) abort if search('[^ \t]', 'wn') return map(split(globpath(join([s:tmpldir, &ft], '/'), 'snip-' . a:lead . '*.*'), "\n"), 'fnamemodify(v:val, ":t:r")[5:]') else @@ -28,7 +28,7 @@ function! template#complete(lead, cmdline, curpos) abort endif endfunction -function! template#apply(name) abort +function! sonictemplate#apply(name) abort let buffer_is_not_empty = search('[^ \t]', 'wn') if search('[^ \t]', 'wn') let fs = split(globpath(join([s:tmpldir, &ft], '/'), 'snip-' . a:name . '.*'), "\n") diff --git a/doc/template-vim.txt b/doc/sonictemplate-vim.txt index c407eff..4295981 100644 --- a/doc/template-vim.txt +++ b/doc/sonictemplate-vim.txt @@ -1,35 +1,35 @@ -*template-vim.txt* Template for Vim +*sonictemplate-vim.txt* SonicTemplate for Vim ------------------------------------------------------- - Template: easy way coding + SonicTemplate: hi speed coding method ------------------------------------------------------- Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> WebSite: http://mattn.kaoriya.net/ -Repository: http://github.com/mattn/template-vim -Site: http://mattn.github.com/template-vim +Repository: http://github.com/mattn/sonictemplate-vim +Site: http://mattn.github.com/sonictemplate-vim License: BSD style license ============================================================================== -CONTENTS *template-vim-contents* +CONTENTS *sonictemplate-vim-contents* -Introduction |template-introduction| -Install |template-install| -Tutorial |template-tutorial| -Customize |template-customize| -Write Your Template |template-writetemplate| +Introduction |sonictemplate-introduction| +Install |sonictemplate-install| +Tutorial |sonictemplate-tutorial| +Customize |sonictemplate-customize| +Write Your Template |sonictemplate-writetemplate| ============================================================================== -INTRODUCTION *template-vim-introduction* +INTRODUCTION *sonictemplate-vim-introduction* -|Template| is easy way to coding. +|SonicTemplate| is easy and high speed coding method. * Choose template for the filetype * Few typings. * Flexible customization. ============================================================================== -INSTALL *template-vim-install* +INSTALL *sonictemplate-vim-install* Install the distributed files into Vim runtime directory which is usually ~/.vim/, or $HOME/vimfiles on Windows. @@ -38,7 +38,7 @@ If you install pathogen that provided from Tim Pope, you should extract the file into 'bundle' directory. ============================================================================== -TUTORIAL *template-vim-tutorial* +TUTORIAL *sonictemplate-vim-tutorial* For example, you are writing C++ file. @@ -105,24 +105,24 @@ For example, you are writing C++ file. } < ============================================================================== -CUSTOMIZE *template-vim-customize* +CUSTOMIZE *sonictemplate-vim-customize* You can modify template directory for your-self templates. > let g:template_vim_template_dir = '/path/to/your/template/directory' < ============================================================================== -WRITE YOUR TEMPLATE *template-vim-writetemplate* +WRITE YOUR TEMPLATE *sonictemplate-vim-writetemplate* -Templates are stored in the directory that "g:template_vim_template_dir" +Templates are stored in the directory that "g:sonictemplate_vim_template_dir" variable specified. On unix, directory structure is following. Note that I'm using pathogen-vim. > - ~/.vim/bundle/template-vim + ~/.vim/bundle/sonictemplate-vim plugin - template.vim + sonictemplate.vim doc - template.txt + sonictemplate.txt template go ... filetype go base-main.go ... base main diff --git a/plugin/template.vim b/plugin/sonictemplate.vim index 1a832a6..5fe99bd 100644 --- a/plugin/template.vim +++ b/plugin/sonictemplate.vim @@ -1,5 +1,5 @@ "============================================================================= -" template.vim +" sonictemplate.vim " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> " Last Change: 28-Oct-2011. " @@ -8,7 +8,8 @@ " :Template {name} " Load template named as {name} in the current buffer. -command! -nargs=1 -complete=customlist,template#complete Template call template#apply(<f-args>) -inoremap <c-y>t <esc>:call template#select()<cr> +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> " vim:ts=4:sw=4:et |