Vim::Snippet::Converter - A Template Converter for Slippery Snippet Vim Plugin
Version 0.082
#!perl use Vim::Snippet::Converter; my $vsc = Vim::Snippet::Converter->new(); open my $in , "<" , "perl.snt"; open my $out , ">" , "perl_snippets.vim"; $vsc->convert( $in , $out ); close ($in , $out);
This module provides template conversion for Vim SnippetEmu Plugin ( http://www.vim.org/scripts/script.php?script_id=1318 )
You can write your template simply. see "TEMPLATE FORMAT"
convert template file (*.snt)
$ scc -s [filename] [-i {path}] [-c {path}]
for example:
# generate snippet vim script to stdout $ scc -s perl.snt $ scc -s filename.snt > perl_snippets.vim # to replace the previous install automatically. $ scc -s filename.snt -i ~/.vim/syntax/perl.vim -s, --src [filename] specify source file path -i, --install-to [filename] specify vim script path, e.g. ~/.vim/syntax/perl.vim -c, --create-completion [filepath] create snippet keyword completion file for vim
to save triggers into vim completion file:
$ scc -s perl.snt -c vim_completion
save triggers into vim completion file:
append the below setting to your .vimrc , it is located in your home directory.
set dictionary+=/path/to/vim_completion
when you want to call the keyword completion , just press Ctrl-X Ctrl-K in Insert-Mode.
Ctrl-X Ctrl-K
# comments ;sub sub <<function>> ( <<prototype>> ) { my <<>> = <<>>; return <<returnValue>>; } ;end
sub is a trigger name , when you press <Tab> , the trigger will be replaced with the template.
sub
<Tab>
<<function>> is called Place Holder , when you press <Tab> again , curosr will jump to the next position to let you enter some text.
<<function>>
Cornelius, <cornelius.howl+cpan at gmail.com>
<cornelius.howl+cpan at gmail.com>
Please report any bugs or feature requests to bug-vim-snippet-compiler at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Vim-Snippet-Converter. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-vim-snippet-compiler at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Vim::Snippet::Converter
You can also look for information at:
Vim
http://www.vim.org/
Slippery Snippets Vim Plugin
http://slipperysnippets.blogspot.com/2006/12/howto-try-out-latest-version-of.html
http://c9s.blogspot.com/2007/06/vim-snippet.html
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Vim-Snippet-Converter
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Vim-Snippet-Converter
CPAN Ratings
http://cpanratings.perl.org/d/Vim-Snippet-Converter
Search CPAN
http://search.cpan.org/dist/Vim-Snippet-Converter
Copyright 2007 Cornelius, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Vim::Snippet::Converter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Vim::Snippet::Converter
CPAN shell
perl -MCPAN -e shell install Vim::Snippet::Converter
For more information on module installation, please visit the detailed CPAN module installation guide.