Your issue is that functions cannot be redefined without
! (as in
function!). This is only partially true:
When a function by this name already exists and [!] is
not used an error message is given. There is one
exception: When sourcing a script again, a function
that was previously defined in that script will be
When [!] is used, an existing function is silently
replaced. Unless it is currently being executed, that
is an error.
NOTE: Use ! wisely. If used without care it can cause
an existing function to be replaced unexpectedly,
which is hard to debug.
I actually do not use
! anymore, but I believe in old versions of vim it was required to be able to re-source a script at runtime and have function/command definitions work. You might want to check on your version.
A more idiomatic way to accomplish your setup is to split the two (this is effectively what I do):
" ~/.vim/vimrc, or some other globally-sourced file
nnoremap <leader>fs :write<CR>
" two options: a dedicated map
nnoremap <buffer> <localleader>ef :source %<CR>
" or an autocommand
autocmd! * <buffer>
autocmd BufWritePost <buffer> source %
(I do something similar in clojure with fireplace's