-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On August 12, 2014 1:34:09 PM GMT+03:00, Xaut Jzd <[email protected]> wrote: >This is the first time to write vim plugin, so I try to write an hello >plugin, this is my repository url: > >autoload/hello.vim: > >>function! s:Hello() >> echo "hello, my name is xautjzd!" >>endfunction > >plugin/hello.vim:
Functions defined with s: are only accessible with s: or <SID> within the file you defined it in. You must do one of the following: 1. Use global function name. Since you are using autoload/hello.vim this name should be hello#Hello or you will not have your function autoloaded. You may still take any name and load your function with :runtime. 2. Put s:Hello into the same file you defined :Hello. 3. Use expanded variant of function name alongside with loading this function manually with :runtime. Check out :h <SID>, it will tell you how to get the expanded variant. > >>command Hello :call <SID>Hello() > >but after I installed the plugin via vundle, open vim and execute >`Hello` command,but get the error: > >> unknow function:<SNR> > >so please help! -----BEGIN PGP SIGNATURE----- Version: APG v1.1.1 iQI1BAEBCgAfBQJT6imiGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj HhHSvmQrD/92gXvaALTzP4tSeBEW6x2CVW8MFrh8J9v0QglvHn9SmY4bOpcnri2h 6v4mqoQsn4fNac2/XA9xxSxE3Y/sfgPKk5ZWZFLu+tEyg32ruqEp05wfGWu646zK 3r4YAcEw3HaHKtpaPTfBCXzy3Ar3azD66PO7RDSdXiXwgVDzXMcejpiOjra6stCB fuj5Ej/hKKmZn6Vvi7yNW1cxrWPFa492Cbru/JSN/PuoIdc44Je4tL8pzF/Vfo5x sU1WBu3X8l1djArYAhD1Ock+XlnsA52lkhldwbWUSsYs4MBXxUvBQqhPvlkPsqJR cxXfTSDo6yssqDLG6GBphzEEpi7L2CMe02wAk2vUFMyjZY7HYhqmie3Hzw4ubfSW 9QTWeGe6EJZZ9Dm3AVeoaDUZGmHkxvub+/fq1zLpzJj58/uQ4ABKMRGceteAz3y+ gOeG656BkmENzY+oHk/GoITpeKXNzJbuCAUvLLlqDtVo9EbxM4O2OfhHKjizEE+/ hAq6//Nwkoun1x1ORH2M7dk3NXnX4CiBDFECrXrBSzXk0OK3OO6+kRHdMTDavlxq uf0/JRJp1rHh+t0fIu+QN8q42x20FpNYGFRXqPJWie2i8g+lsNqDybui47O7qD70 4o5MLhpCvCOAB+ugHA2xY2LUdhTRjfbXlwPBDHP8S9zcFxyYMz/QpQ== =k3JI -----END PGP SIGNATURE----- -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
