I am trying to spread up some functions across files to make it a bit more manageable (and also to see how that works. So far I have three dummy variables/functions in one file:
# second.vim
let newer = "as"
let s:older = "by" " note: this variable will not be imported if source'd
func LogOutput1(msg, level=g:log_level_default)
" ...
endfunc
# vimrc
source second.vim
As far as I'm able to understand, it seems that running the source
will import all 'global' items from second.vim
, so that it will import:
newer
<-- yes, global variables:older
<-- no, script-localLogOutput1
<-- yes, 'global' (?) function
Is this accurate? What is the proper way to do imports, or is the above adequate?