简体   繁体   中英

What does the sharp (#) sign mean in a vim script function definition?

So I was looking for ways to get some object oriented stuff in vimcript when I found this page

So for instance:

   function gnat#Make () dict
      ...
      return
   endfunction gnat#Make
  • What does the '#' mean?
  • Does it have to do with ending the function explicitly like that? (usually one just endfu[nction] without the function name)

Thanks!

The # is for autoload scripts. Try :h autoload for more info.

I don't think that "explicit" function ending is allowed, as written in the vim help:

:endf[unction]   The end of a function definition.  Must be on a line
                 by its own, without other commands.

But it appears that when you try to put something after :endf , even if it's not the name of the function, no error occurs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM