1. !exists("*s:SetVals") , why they are starmark before s:
An asterisk is a special syntax for an existence function, and this means that we check if an existing function called SetVals exists. The iskeyword could be checked with exists("&iskeyword") , and the ex echo command with exists(":echo")
See :h exists(
2. function! why eat! character?
An exclamation mark means that the function must be replaced if it already exists.
See :h user-functions
3. &iskeyword , is this a variable, if so, where is it defined?
This is a variant of vim. You can check if it is installed with :set iskeyword?
4. What is s: and g: what is the difference between them?
They determine the scope of the next character. s: means the character is local to the script, and g: means the character will be global.
See :h internal-variables and for s: see :h script-variable
5. Why use let ? such as let &dictionary = g:pydiction_location, can i change it to be &dictionary = g:pydiction_location ?
Vimscript is one of the languages ββthat require variable declarations with a keyword. I donβt think there is a way to declare variables easier than using let .
source share