On 11月8日, 下午5时16分, "John Beckett" <[EMAIL PROTECTED]> wrote:
> StarWing wrote:
> > when i write
> > :command BeginFunc -nargs=1 function <args>() it will be ok,
> > i write it in command line:
> > :BeginFunc AAA
> > : echo 'here!'
> > :endfunction
>
> Following is a working example. Put it in a file and save it. Open the file
> in Vim,
> then enter commands:
> :so %
> :Example hello
>
> ---start---
> function! MyFunc(data)
> echo 'MyFunc:' a:data
> endfunction
> command! -nargs=1 Example call MyFunc('<args>')
> ---end---
>
> John
but, i just want to make a shell of inner-command"function", to make a
user-defined-sub-script.
e.g. maybe you can write a script:
BeginFileType 'c'
AddAbbrev "main", "main()\<cr>{\<cr>}\<cr>"
EndFileType
and, in my script, i will
command! -nargs=1 BeginFileType if &ft == <args>
command! -nargs=0 EndFileType endif
command! -nargs=+ AddAbbrev call s:add_abbrev(<args>)
runtime yourscript.template
delcommand BeginFileType
delcommand EndFileType
how can i make it?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---