title: How can I set a global variable from a script/command line?
body: <p>I'm trying to create a little menu to switch from "YouCompleteMe" to "Supertab" and vice versa.</p>
  
  <pre><code>function! TabFunction()
   if !exists("g:WhatTab")
     let g:WhatTab = "Tab function?"
   endif
   if !exists("g:MenuTab_choices")
     let g:MenuTab_choices = "&amp;SuperTab\n&amp;YouCompleteMe"
   endif
   let n = confirm(g:WhatTab, g:MenuTab_choices, "Question")
  
   if n == 1
     let g:SuperTabMappingForward = '&lt;Tab&gt;'
     let g:SuperTabMappingBackward = '&lt;S-Tab&gt;'
  
     let g:ycm_key_list_select_completion = ['&lt;C-Tab&gt;', '&lt;Down&gt;']
     let g:ycm_key_list_previous_completion = ['&lt;C-S-Tab&gt;', '&lt;Up&gt;'] 
   elseif n == 2
     let g:SuperTabMappingForward = '&lt;C-Tab&gt;'
     let g:SuperTabMappingBackward = '&lt;C-S-Tab&gt;'
  
     let g:ycm_key_list_select_completion = ['&lt;Tab&gt;', '&lt;Down&gt;']
     let g:ycm_key_list_previous_completion = ['&lt;S-Tab&gt;', '&lt;Up&gt;']   
   endif
  endfun
  </code></pre>
  
  <p>This doesn't work.<br>
  When I try to check the value of these variables from the commandline<br>
  <code>:echo 'global variable'</code><br>
  the values are correct but they don't work as expected.  </p>
  
  <p>Is it not possible to declare a global variable like this?</p>