From 6e029a7db1baaecb792eddfd4dca38ffd5f9a132 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 28 Oct 2011 19:09:44 +0900 Subject: renamed to SonicTemplate. --- doc/sonictemplate-vim.txt | 182 ++++++++++++++++++++++++++++++++++++++++++++++ doc/template-vim.txt | 182 ---------------------------------------------- 2 files changed, 182 insertions(+), 182 deletions(-) create mode 100644 doc/sonictemplate-vim.txt delete mode 100644 doc/template-vim.txt (limited to 'doc') diff --git a/doc/sonictemplate-vim.txt b/doc/sonictemplate-vim.txt new file mode 100644 index 0000000..4295981 --- /dev/null +++ b/doc/sonictemplate-vim.txt @@ -0,0 +1,182 @@ +*sonictemplate-vim.txt* SonicTemplate for Vim + + ------------------------------------------------------- + SonicTemplate: hi speed coding method + ------------------------------------------------------- + +Author: Yasuhiro Matsumoto +WebSite: http://mattn.kaoriya.net/ +Repository: http://github.com/mattn/sonictemplate-vim +Site: http://mattn.github.com/sonictemplate-vim +License: BSD style license + +============================================================================== +CONTENTS *sonictemplate-vim-contents* + +Introduction |sonictemplate-introduction| +Install |sonictemplate-install| +Tutorial |sonictemplate-tutorial| +Customize |sonictemplate-customize| +Write Your Template |sonictemplate-writetemplate| + +============================================================================== +INTRODUCTION *sonictemplate-vim-introduction* + +|SonicTemplate| is easy and high speed coding method. + + * Choose template for the filetype + * Few typings. + * Flexible customization. + +============================================================================== +INSTALL *sonictemplate-vim-install* + +Install the distributed files into Vim runtime directory which is usually +~/.vim/, or $HOME/vimfiles on Windows. + +If you install pathogen that provided from Tim Pope, you should extract the +file into 'bundle' directory. + +============================================================================== +TUTORIAL *sonictemplate-vim-tutorial* + +For example, you are writing C++ file. + +1. Create main function + + Open new C++ file, and type following. +> + :Template boost-main +< + Then you can see following. +> + #include + #include + #include + + int + main(int argc, char* argv[]) { + _ + return 0; + } +< + The cursor is in the position of |_|. + +2. Add foreach loop + + Type following. +> + :Template boost-for +< + Then you will be asked like following. +> + variable: +< + Then type "foo". +> + #include + #include + #include + + int + main(int argc, char* argv[]) { + BOOST_FOREACH(auto x, foo) { + _ + } + return 0; + } +< +3. Add std::cout << xxx << std::endl; +> + :Template cout +< + Answer "x" for the question "string:". +> + #include + #include + #include + + int + main(int argc, char* argv[]) { + BOOST_FOREACH(auto x, foo) { + std::cout << x << std::endl; + } + return 0; + } +< +============================================================================== +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 *sonictemplate-vim-writetemplate* + +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/sonictemplate-vim + plugin + sonictemplate.vim + doc + sonictemplate.txt + template + go ... filetype go + base-main.go ... base main + base-package.go ... base package + snip-goroutine.go ... snippet for goroutine + ... + perl ... filetype perl + base-package.pl ... base package + base-script.pl ... base script + snip-dbi-connect-sqlite.pl ... snippet for DBI/SQLite + ... + +1. The filename have following rule. + + |[kind]|-|[name]|.|[extension]| + + |[kind]| 'base' or 'snip' should be used. + + 'base' is used when buffer is empty. + + |[name]| template name + + Words in the name must join with '-'. + + |[extension]| file name extension like ".c". + + If several extensions are exists in same directory, the first found is used. + +2. Template can have some keywords. + + |{{_name_}}| the filename without extension. + + If you are opening "foo.pl" for perl, {{_name_}} become "foo". + + |{{_cursor_}}| : cursor position. + + When expanded template, cursor will be moved to there. + + |{{_input_:var}}| : ask the value of "var". + + When expanded template, cursor will be moved to there. + + |{{_expr_:xxx}}| : expression in vimscript. + + For example: "Current Time:|{{_expr_:strftime('%c')}}|" will be +> + Current Time: 2011/10/27 20:19:00 +< + |{{_if_:expr;foo;bar}}| : ternary operator + + For example: When today is saturday, + "Today is |{{_if_:strftime('%w')%6;OrdinaryDay;Holiday}}|" will be +> + Today is Holiday +< +============================================================================== +vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0: diff --git a/doc/template-vim.txt b/doc/template-vim.txt deleted file mode 100644 index c407eff..0000000 --- a/doc/template-vim.txt +++ /dev/null @@ -1,182 +0,0 @@ -*template-vim.txt* Template for Vim - - ------------------------------------------------------- - Template: easy way coding - ------------------------------------------------------- - -Author: Yasuhiro Matsumoto -WebSite: http://mattn.kaoriya.net/ -Repository: http://github.com/mattn/template-vim -Site: http://mattn.github.com/template-vim -License: BSD style license - -============================================================================== -CONTENTS *template-vim-contents* - -Introduction |template-introduction| -Install |template-install| -Tutorial |template-tutorial| -Customize |template-customize| -Write Your Template |template-writetemplate| - -============================================================================== -INTRODUCTION *template-vim-introduction* - -|Template| is easy way to coding. - - * Choose template for the filetype - * Few typings. - * Flexible customization. - -============================================================================== -INSTALL *template-vim-install* - -Install the distributed files into Vim runtime directory which is usually -~/.vim/, or $HOME/vimfiles on Windows. - -If you install pathogen that provided from Tim Pope, you should extract the -file into 'bundle' directory. - -============================================================================== -TUTORIAL *template-vim-tutorial* - -For example, you are writing C++ file. - -1. Create main function - - Open new C++ file, and type following. -> - :Template boost-main -< - Then you can see following. -> - #include - #include - #include - - int - main(int argc, char* argv[]) { - _ - return 0; - } -< - The cursor is in the position of |_|. - -2. Add foreach loop - - Type following. -> - :Template boost-for -< - Then you will be asked like following. -> - variable: -< - Then type "foo". -> - #include - #include - #include - - int - main(int argc, char* argv[]) { - BOOST_FOREACH(auto x, foo) { - _ - } - return 0; - } -< -3. Add std::cout << xxx << std::endl; -> - :Template cout -< - Answer "x" for the question "string:". -> - #include - #include - #include - - int - main(int argc, char* argv[]) { - BOOST_FOREACH(auto x, foo) { - std::cout << x << std::endl; - } - return 0; - } -< -============================================================================== -CUSTOMIZE *template-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* - -Templates are stored in the directory that "g:template_vim_template_dir" -variable specified. On unix, directory structure is following. -Note that I'm using pathogen-vim. -> - ~/.vim/bundle/template-vim - plugin - template.vim - doc - template.txt - template - go ... filetype go - base-main.go ... base main - base-package.go ... base package - snip-goroutine.go ... snippet for goroutine - ... - perl ... filetype perl - base-package.pl ... base package - base-script.pl ... base script - snip-dbi-connect-sqlite.pl ... snippet for DBI/SQLite - ... - -1. The filename have following rule. - - |[kind]|-|[name]|.|[extension]| - - |[kind]| 'base' or 'snip' should be used. - - 'base' is used when buffer is empty. - - |[name]| template name - - Words in the name must join with '-'. - - |[extension]| file name extension like ".c". - - If several extensions are exists in same directory, the first found is used. - -2. Template can have some keywords. - - |{{_name_}}| the filename without extension. - - If you are opening "foo.pl" for perl, {{_name_}} become "foo". - - |{{_cursor_}}| : cursor position. - - When expanded template, cursor will be moved to there. - - |{{_input_:var}}| : ask the value of "var". - - When expanded template, cursor will be moved to there. - - |{{_expr_:xxx}}| : expression in vimscript. - - For example: "Current Time:|{{_expr_:strftime('%c')}}|" will be -> - Current Time: 2011/10/27 20:19:00 -< - |{{_if_:expr;foo;bar}}| : ternary operator - - For example: When today is saturday, - "Today is |{{_if_:strftime('%w')%6;OrdinaryDay;Holiday}}|" will be -> - Today is Holiday -< -============================================================================== -vim:tw=78:ts=8:ft=help:norl:noet:fen:fdl=0: -- cgit v1.2.3-54-g00ecf