make on_windows global

Mon, 22 May 2017 20:36:59 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 22 May 2017 20:36:59 -0400
changeset 578
3e4703eef23d
parent 577
c3ecffb36fb7
child 579
0cb7adee16fe

make on_windows global

.vim/autoload/vimrc.vim file | annotate | diff | comparison | revisions
.vimrc file | annotate | diff | comparison | revisions
--- a/.vim/autoload/vimrc.vim
+++ b/.vim/autoload/vimrc.vim
@@ -20,10 +20,7 @@ function! vimrc#MkNonExDir(file, buf) ab
 endfunction
 
 function! vimrc#VundleInstall() abort
-  " on windows and not cygwin
-  let l:on_windows = (has('win32') || has('win64'))
-
-  let l:vundle_readme = expand(l:on_windows
+  let l:vundle_readme = expand(g:on_windows
     \ ? '~/vimfiles/bundle/vundle/README.md'
     \ : '~/.vim/bundle/vundle/README.md')
 
@@ -33,7 +30,7 @@ function! vimrc#VundleInstall() abort
       return
     endif
 
-    if l:on_windows == 0
+    if g:on_windows == 0
       silent !mkdir -p ~/.vim/bundle
       silent !git clone --depth 1 https://github.com/gmarik/vundle ~/.vim/bundle/vundle
     else
@@ -43,5 +40,4 @@ function! vimrc#VundleInstall() abort
 
     echo "Installed Vundle, run :PluginInstall if desired"
   endif
-
 endfunction
--- a/.vimrc
+++ b/.vimrc
@@ -4,18 +4,18 @@
 set nocompatible
 
 " on windows and not cygwin
-let s:on_windows=(has('win32') || has('win64'))
-let s:filename=expand('<sfile>')
+let g:on_windows = (has('win32') || has('win64'))
+let s:filename   = expand('<sfile>')
 
 " Set up Vundle and plugins  {{{
   call vimrc#VundleInstall()
 
-  if s:on_windows == 0
+  if g:on_windows
+    set rtp+=~/vimfiles/bundle/vundle/
+    call vundle#begin('~/vimfiles/bundle')
+  else
     set rtp+=~/.vim/bundle/vundle/
     call vundle#begin()
-  else
-    set rtp+=~/vimfiles/bundle/vundle/
-    call vundle#begin('~/vimfiles/bundle')
   endif
 
   Plugin 'gmarik/vundle'
@@ -182,7 +182,7 @@ set tags+=.tags
 
 " Ignore compiled files and repositories
 set wildignore=*.o,*~,*.pyc
-if s:on_windows == 1
+if g:on_windows
     set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
 else
     set wildignore+=.git\*,.hg\*,.svn\*
@@ -207,7 +207,7 @@ set sessionoptions=buffers,curdir,localo
 "set statusline=%f%m%r%h%w\ %y\ %=%l,%c\ %p%%\ %L
 set laststatus=2
 
-if s:on_windows == 1
+if g:on_windows
   let $MYVIM=$HOME.'/vimfiles'
 
   if !filewritable( $MYVIM . '/var' )
@@ -238,7 +238,7 @@ else
 
 endif
 
-if s:on_windows == 1
+if g:on_windows
   set guifont=DejaVu_Sans_Mono:h10:cDEFAULT
   set linespace=0
 elseif has('osx')
@@ -340,12 +340,12 @@ let g:viewdoc_winwidth_max = 100
 
 ">> Gundo
 " I prefer python3 on windows if I have to use it. Needs a dll in path.
-if s:on_windows == 1
-  let g:gundo_prefer_python3=1
+if g:on_windows
+  let g:gundo_prefer_python3 = 1
 endif
 
 ">> Tagbar
-if s:on_windows == 1
+if g:on_windows
   if executable('ctags') == 0
     " if i haven't installed from chocolatey...
     let g:tagbar_ctags_bin = 'C:\Users\mhoward\bin\ctags.exe'

mercurial