On 21/01/09 11:58, Maxim Kim wrote:
>> if !hasmapto('<Plug>HeaderAdd')
>>          map<unique>  <Leader>a<Plug>HeaderAdd
>> endif
>> noremap<unique>  <script>  <Plug>HeaderAdd<SID>addMyHeader
>
> I wonder if<Leader>a works for you.
> What about
> noremap<unique>  <script>  <Plug>HeaderAdd  :call<SID>addMyHeader<CR>
> ?
>
>> function! addMyHeader()

1. this function is defined without s: before its name, so you should 
call it without <SID>
2. A user function defined without s: must have a name starting in a 
capital letter
3. Calling a function always requires parentheses after the name

        function! AddMyHeader()
                ...
        endfunction
        noremap  <unique>  <script>   <Plug>HeaderAdd
                \ :call AddMyHeader()<CR>

or (probably better)

        function! s:addMyHeader()
                ...
        endfunction
        noremap  <unique>  <script>  <Plug>HeaderAdd
                \ :call <SID>addMyHeader()<CR>

>> ....
>> endfunction
>>
>> Snipe of my .vimrc
>>
>> map<F1>  <Plug>HeaderAdd
>> ...
>>
>> This don´t work! How to map the functions defined within a plugin to single
>> keys???
>>
>> Thanks a lot and 42^42 times say: Zaphod is the president of the universe (
>> which at least don´t help :-/)
>>
>> Schnullux


Best regards,
Tony.
-- 
Klein bottle for sale ... inquire within.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to