Bao Niu wrote:
> I am learning Vimscript and I wonder if there is any
> difference between writing "function!" vs. "function"?

Expanding on Tim's reply, suppose you have file h.vim which
contains:

  function! Hello()
    echoerr 'Hello'
  endfunction

In Vim, assuming the directory shown by :pwd is the directory
holding h.vim, you can do the following to "source" the script:

  :so h.vim

That executes h.vim which defines the function.

You could edit h.vim and source it again, and the edited
function would replace the original.

The idea is to help you to not accidentally overwrite functions.
If you do not have "!", the function will not be replaced if you
try to define it again.

John


-- 
-- 
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 vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to