From 347d63f1d8cace2559781a760a70722732c2808e Mon Sep 17 00:00:00 2001 From: Taylor Bockman Date: Fri, 30 Aug 2019 20:19:43 -0700 Subject: [PATCH] Make vim plug work right on windows --- dotfiles/config/nvim/init.vim | 58 ++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/dotfiles/config/nvim/init.vim b/dotfiles/config/nvim/init.vim index 83ba351..cd77cb4 100644 --- a/dotfiles/config/nvim/init.vim +++ b/dotfiles/config/nvim/init.vim @@ -1,9 +1,13 @@ set fileencoding=utf-8 -if empty(glob('~/.config/nvim/autoload/plug.vim')) - silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - autocmd VimEnter * PlugInstall | source % +" I have no idea how to auto-install vim-plug on Windows +" so you will have to install it manually. +if !(has('win16') || has('win32') || has('win64')) + if empty(glob('~/.config/nvim/autoload/plug.vim')) + silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + autocmd VimEnter * PlugInstall | source % + endif endif call plug#begin('~/.config/nvim/plugged') @@ -66,30 +70,28 @@ Plug 'ktvoelker/sbt-vim' " Org Mode Plug 'jceb/vim-orgmode' -if !has("win32") || !has("win16") - "Code Completion - " Post-update hook for YCM - " Make sure to sudo pip install neovim before running this - function! BuildYCM(info) - if a:info.status == 'installed' || a:info.force - !./install.sh - endif - endfunction - Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') } - - - Plug 'scrooloose/nerdtree' - " For nerdtree indicators of what has changed - Plug 'Xuyuanp/nerdtree-git-plugin' - - " For some modern file icons - Plug 'ryanoasis/vim-devicons' - - " Make Vim play nice with tmux - " Use - " to move between window panes in tmux or vim - Plug 'christoomey/vim-tmux-navigator' -endif +"Code Completion +" Post-update hook for YCM +" Make sure to sudo pip install neovim before running this +function! BuildYCM(info) + if a:info.status == 'installed' || a:info.force + !./install.sh + endif +endfunction +Plug 'Valloric/YouCompleteMe', { 'do': function('BuildYCM') } + + +Plug 'scrooloose/nerdtree' +" For nerdtree indicators of what has changed +Plug 'Xuyuanp/nerdtree-git-plugin' + +" For some modern file icons +Plug 'ryanoasis/vim-devicons' + +" Make Vim play nice with tmux +" Use +" to move between window panes in tmux or vim +Plug 'christoomey/vim-tmux-navigator' " Markdown Plug 'godlygeek/tabular'