let g:alternateExtensions_{'aspx.cs'} = "aspx"
This is a built-in extension of a Vimscript expression to a variable name, a rather hidden function that is rarely used with Vim version 7. See :help curly-braces-names for more information. It is usually used to interpolate a variable, rather than a string literal like here ( 'aspx.cs' ). In addition, this leads to an error because periods are not allowed in variable names. Newer plugins will use the List or Dictionary variable, but these data types were not available when a.vim was written.
To avoid contamination of the function namespace, the internal functions of the plugin should be script -local, that is, have the s: prefix. To call them from the comparison, instead of s: should use the special <SID> prefix, because <SID> internally converted to something that supports the script identifier, while pure s: when executed as part of the display, lost touch with the script that identified him.
Some plugin authors do not fully understand this unfortunate and random complexity of the Vim scoping implementation, and they put the <SID> prefix also in front of the function name (which also works). Although this is a little more correct and it is recommended to write it like this:
" Define and invoke script-local function. function! s:AddAlternateExtensionMapping(extension, alternates) ... call s:AddAlternateExtensionMapping('h',"c,cpp,cxx,cc,CC") " Only in a mapping, the special <SID> prefix is actually necessary. nmap <Leader>a :call <SID>AddAlternateExtensionMapping('h',"c,cpp,cxx,cc,CC")
source share