# Powershell script to install my configuration for Windows
# You need to install Git so it's available on the command line. Use Chocolatey
# or something else, but ensure it's installed so you can run Git from the command line.
#
# Then download this file and run it in your %HOME% directory 
# 
#     powershell -NoProfile -ExecutionPolicy unrestricted vim.ps1
#
# This is very experimental.

# set up folders
new-item vimfiles -type directory
new-item vimfiles\backup -type directory
new-item vimfiles\bundle -type directory
if (-not (test-path "tmp") ) {
  new-item tmp -type directory
}
if (-not (test-path "tmp\backup") ) {
  new-item tmp\backup -type directory
}
# fetch my configs from Github
(New-Object System.Net.WebClient).DownloadFile(
    "https://gist.githubusercontent.com/napcs/532968/raw/.vimrc" ,"_vimrc")

(New-Object System.Net.WebClient).DownloadFile(
    "https://gist.githubusercontent.com/napcs/532968/raw/vimrc_main","vimfiles/vimrc_main")

(New-Object System.Net.WebClient).DownloadFile(
    "https://gist.githubusercontent.com/napcs/532968/raw/vundle","vimfiles/vundle")

# Grab the Vundle plugin from Git
$gitargs = @('clone', 'git://github.com/gmarik/vundle.git', 'vimfiles/bundle/vundle')
& 'git' $gitargs

# Run Vim for the first time and try to run BundleInstall
$vundleargs = @('+PluginInstall', '+qall')
& 'gvim' $vundleargs