title: Gvim: Empty bottom bar appears on re-sourcing vimrc
body: <p>I recently decided to migrate to Gvim, and noticed that some of my gui-specific settings are borked.</p>
  
  <p>I have defined an autocommand to re-source $MYVIMRC upon writing to it, and upon re-sourcing it (this does not happen on the initial startup), an empty bar appears on the bottom. I believe it is the bar that is meant to contain the horizontal scrollbar.</p>
  
  <p>When I attempt to remove the scrollbar using </p>
  
  <pre><code>:set guioptions-=b
  </code></pre>
  
  <p>nothing happens. However, if I add it first and then remove it,</p>
  
  <pre><code>:set guioptions+=b
  :set guioptions-=b
  </code></pre>
  
  <p>it disappears.</p>
  
  <p>I thought this might be related to how and when I am defining my <code>guioptions</code>. This is the relevant part of my .vimrc:</p>
  
  <pre><code>set guioptions-=m              " GUI: Disable Menu 
  set guioptions-=r              " GUI: Disable right scrollbar
  set guioptions-=T              " GUI: Disable Toolbar
  </code></pre>
  
  <p>I attempted to put this in an <code>augroup</code> like this</p>
  
  <pre><code>augroup GuiWidgets
    au!
    set guioptions-=m              " GUI: Disable Menu 
    set guioptions-=r              " GUI: Disable right scrollbar
    set guioptions-=T              " GUI: Disable Toolbar
  augroup end
  </code></pre>
  
  <p>but it made no difference.</p>
  
  <p>What can be the source of this problem?</p>
  
  <p><br><b>EDIT 1</b> - Added .vimrc<br></p>
  
  <pre><code>let mapleader = ','
  inoremap jj &lt;Esc&gt;
  set nocompatible
  
  
  "********************************
  " PLUGINS
  "********************************
  
  if has('vim_starting')
    set runtimepath+=~/.vim/bundle/neobundle.vim/
  endif
  
  call neobundle#begin(expand('~/.vim/bundle/'))
  
  NeoBundleFetch 'Shougo/neobundle.vim'
  
  NeoBundle 'benmills/vimux'
  NeoBundle 'scrooloose/nerdcommenter'
  NeoBundle 'scrooloose/syntastic'
  NeoBundle 'kana/vim-textobj-entire'
  NeoBundle 'kana/vim-textobj-user'
  NeoBundle 'Raimondi/delimitMate'
  NeoBundle 'Lokaltog/vim-easymotion'
  NeoBundle 'godlygeek/tabular'
  NeoBundle 'surround.vim'
  NeoBundle 'christoomey/vim-tmux-navigator'
  NeoBundle 'Shougo/vimproc.vim'
  NeoBundle 'Shougo/unite.vim'
  NeoBundle 'Shougo/vimshell.vim'
  NeoBundle 'c.vim'
  
  call neobundle#end()
  filetype plugin indent on
  
  NeoBundleCheck
  
  
  "******************************
  " PLUGIN SETTINGS
  "******************************
  
  nnoremap &lt;C-p&gt; :Unite file_rec/async:! -silent -start-insert -auto-resize&lt;CR&gt;
  
  
  "******************************
  " PLUGIN MAPPINGS
  "******************************
  
  map &lt;Space&gt; &lt;Plug&gt;(easymotion-prefix)
  
  cnoreabbrev bi Unite neobundle/install
  cnoreabbrev bu Unite neobundle/update
  cnoreabbrev bc NeoBundleClean
  
  nmap &lt;Leader&gt;a= :Tabularize /=&lt;CR&gt;
  vmap &lt;Leader&gt;a= :Tabularize /=&lt;CR&gt;
  nmap &lt;Leader&gt;a: :Tabularize /:\zs&lt;CR&gt;
  vmap &lt;Leader&gt;a: :Tabularize /:\zs&lt;CR&gt;
  nmap &lt;Leader&gt;a# :Tabularize /#&lt;CR&gt;
  vmap &lt;Leader&gt;a# :Tabularize /#&lt;CR&gt;
  
  
  "******************************
  " GENERAL SETTINGS
  "******************************
  
  set t_Co=256                   
  let g:molokai_original=0       
  colorscheme molokai            
  filetype plugin indent on      
  syntax on                      
  
  set complete-=t                
  set gfn=Source\ Code\ Pro\ 10  
  set encoding=utf-8             
  set number                     
  set lazyredraw                 
  set completeopt-=preview       
  set ttyfast                    
  set backspace=indent,eol,start 
  
  set hidden                     
  set showmatch                  
  set wildmode=longest:list,full 
  set wildmenu                   
  set shortmess+=I               
  set showcmd                    
  set showmode                   
  set clipboard=unnamed          
  
  set history=50                 
  set nrformats=                 
  set autoread                   
  set ruler                      
  set laststatus=2               
  set scrolloff=8                
  set visualbell                 
  set splitright                 
  
  set smarttab                   
  set autoindent                 
  set expandtab                  
  set tabstop=4                  
  set shiftwidth=4               
  set softtabstop=4              
  set ignorecase smartcase       
  set gdefault                   
  
  set incsearch                  
  set hlsearch                   
  set nobackup                   
  set noswapfile                 
  set ttimeoutlen=50             
  set relativenumber             
  set cursorline                 
  set cc=80                      
  
  set guioptions-=m             
  set guioptions-=r             
  set guioptions-=T             
  "set guioptions=
  
  match ErrorMsg '\%&gt;80v.\+'
  
  
  "***************************
  " GENERAL MAPPINGS
  "***************************
  
  map cn &lt;Esc&gt;:cn&lt;CR&gt;
  map cp &lt;Esc&gt;:cp&lt;CR&gt;
  nmap &lt;CR&gt; o&lt;Esc&gt;k
  inoremap {&lt;CR&gt; {&lt;CR&gt;}&lt;C-o&gt;O
  nnoremap &lt;leader&gt;v :e $MYVIMRC&lt;CR&gt;
  nnoremap &lt;leader&gt;h  :let @/ = ""&lt;CR&gt;
  nnoremap n nzz
  nnoremap &lt;silent&gt; &lt;leader&gt;; :call setline('.', getline('.').';')&lt;CR&gt;
  nnoremap &lt;leader&gt;q &lt;C-w&gt;q&lt;CR&gt;
  nnoremap &lt;leader&gt;w :w&lt;CR&gt;
  nnoremap &lt;silent&gt; &lt;leader&gt;d :bp\|bd #&lt;CR&gt;
  nnoremap &lt;leader&gt;c :cd %:p:h&lt;CR&gt;
  cnoreabbrev ci( %ci(
  cnoreabbrev ci) %ci)
  cnoreabbrev ci[ %ci[
  cnoreabbrev ci[ %ci]
  cnoreabbrev ci{ %ci{
  cnoreabbrev ci} %ci}
  
  
  "***************************
  " AUTOCOMMANDS
  "***************************
  
  " Auto-source .vimrc
  augroup Vimrc
      au!
      au bufwritepost .vimrc source $MYVIMRC
  augroup end
  
  " Filetype-specific settings
  augroup Filetypes
      au!
      "au FileType c nmap &lt;leader&gt;r :SCCompileRun&lt;CR&gt;
      au FileType c nmap &lt;leader&gt;r :make\|!./%:r&lt;CR&gt;
      au FileType c setlocal sw=2 sts=2 
      au FileType ruby nmap &lt;leader&gt;r :call RunByFiletype("ruby")&lt;CR&gt;
  augroup end
  </code></pre>
  
  <p><br><br><b>EDIT 2</b> - Added pictures<br> (sorry for the small size)</p>
  
  <p>On startup
  <img src="https://i.stack.imgur.com/mKfOr.png" alt="On startup"></p>
  
  <p>After sourcing .vimrc (the empty scrollbar container appears)
  <img src="https://i.stack.imgur.com/zmicD.png" alt="enter image description here"></p>
  
  <p>After running :set guioptions+=b (the horizontal scrolling bar is added to the container)
  <img src="https://i.stack.imgur.com/t03PS.png" alt="enter image description here"></p>
  
  <p>After running :set guioptions-=b (the horizontal container disappears)
  <img src="https://i.stack.imgur.com/yD8eP.png" alt="enter image description here"></p>
  
  <p>After running :set gfn=Source\ Code\ Pro\ 10 (the bar reappears)
  <img src="https://i.stack.imgur.com/O6lzE.png" alt="enter image description here"></p>