From be01ceb18cf43be5ec2f681421c55bfa70357823 Mon Sep 17 00:00:00 2001 From: Vasili Sviridov Date: Tue, 23 Feb 2016 14:01:14 -0800 Subject: [PATCH 1/4] setting up proper handling for plug on windows --- vimrc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vimrc b/vimrc index 0ad52e8..19a333d 100644 --- a/vimrc +++ b/vimrc @@ -1,13 +1,15 @@ -set shell=/bin/bash +"set shell=/bin/sh scriptencoding utf-8 set encoding=utf-8 set shortmess=I "turn off splash screen -let have_plug=filereadable(expand('~/.vim/autoload/plug.vim')) +let vim_files=fnamemodify(expand("$MYVIMRC"), ":p:h") +let plug_path=expand(vim_files . '/autoload/plug.vim') +let have_plug=filereadable(plug_path) if(!have_plug && executable('curl')) echo "Installing Plug" - !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim + echo '!curl -fLo ' . plug_path . ' --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' endif if(have_plug) From 4cb7e78c35b3e92255056268ce1a05142d512781 Mon Sep 17 00:00:00 2001 From: Vasili Sviridov Date: Tue, 23 Feb 2016 16:43:44 -0800 Subject: [PATCH 2/4] better compat for windows --- vimrc | 60 ++++++++++++++++++++--------------------------------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/vimrc b/vimrc index 19a333d..d62194f 100644 --- a/vimrc +++ b/vimrc @@ -1,4 +1,4 @@ -"set shell=/bin/sh +" set shell=/bin/sh scriptencoding utf-8 set encoding=utf-8 set shortmess=I "turn off splash screen @@ -9,11 +9,11 @@ let have_plug=filereadable(plug_path) if(!have_plug && executable('curl')) echo "Installing Plug" - echo '!curl -fLo ' . plug_path . ' --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + echo '!curl -fLo "' . plug_path . '" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' endif if(have_plug) - call plug#begin('~/.vim/plugged') + call plug#begin(vim_files . '/plugged') Plug 'w0ng/vim-hybrid' " Hybrid colorscheme Plug 'vim-airline/vim-airline' " Status bar Plug 'vim-airline/vim-airline-themes' " Status bar themes @@ -28,7 +28,6 @@ if(have_plug) Plug 'rking/ag.vim' " Silver Searcher Support Plug 'junegunn/rainbow_parentheses.vim' " Color matched parenthesis Plug 'tpope/vim-commentary' " Commenting - Plug 'unblevable/quick-scope' " f/t navigation helper " Language Plug 'dag/vim-fish' " Fish Shell Support @@ -47,7 +46,7 @@ if(have_plug) " Plug 'tmux-plugins/vim-tmux' " tmux.conf call plug#end() - if empty(glob("~/.vim/plugged")) + if empty(glob(vim_files . '/plugged')) PlugInstall endif endif @@ -66,8 +65,6 @@ set visualbell set wildmenu "show autocomplete menu set wildmode=full -silent! colorscheme hybrid - "Set before any key remapping let mapleader = '\' @@ -204,52 +201,35 @@ nmap ] :bn nmap [ :bp nmap d :bd +if($ConEmuANSI == 'ON' && !has("gui_running")) + set term=xterm + set t_Co=256 + let &t_AB="\e[48;5;%dm" + let &t_AF="\e[38;5;%dm" + inoremap [62~ + inoremap [63~ + nnoremap [62~ + nnoremap [63~ +endif + if has("gui_running") - "set guifont=Consolas:h10:cRUSSIAN,Lucida\ Console:h10:cRUSSIAN + set go-=mTr " disable toolbar, menubar and scrollbar if has("win32") - set guifont=Menlo_for_Powerline:h10:cANSI + set guifont=Source_Code_Pro:h12:cANSI endif else - "Powerline fonts for Airline - let g:airline_powerline_fonts = 1 set mouse=a endif +colorscheme hybrid +let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1 + if exists("g:loaded_syntastic_checker") nmap c :SyntasticCheck nmap e :Errors endif -" if exists("g:loaded_quick_scope") - " Insert into your .vimrc after quick-scope is loaded. - " Obviously depends on being installed. - - " Thanks to @VanLaser for cleaning the code up and expanding capabilities to include e.g. `df` - - let g:qs_enable = 0 - let g:qs_enable_char_list = [ 'f', 'F', 't', 'T' ] - - function! Quick_scope_selective(movement) - let needs_disabling = 0 - if !g:qs_enable - QuickScopeToggle - redraw - let needs_disabling = 1 - endif - let letter = nr2char(getchar()) - if needs_disabling - QuickScopeToggle - endif - return a:movement . letter - endfunction - - " quick_scope maps, operator-pending mode included (can do 'df' with hint) - for i in g:qs_enable_char_list - execute 'noremap ' . i . " Quick_scope_selective('". i . "')" - endfor -" endif - set wildignore+=*/Deploy/*,*/node_modules/*,*/build/*,*/lib/*,*/jspm_packages/* set completeopt=longest,menu,menuone From 9ee851732bfc7e1ead1135e38f01b22afe14aad3 Mon Sep 17 00:00:00 2001 From: Vasili Sviridov Date: Fri, 26 Feb 2016 02:50:11 -0800 Subject: [PATCH 3/4] follow symlinks on unix --- vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimrc b/vimrc index d62194f..c9c469a 100644 --- a/vimrc +++ b/vimrc @@ -3,7 +3,7 @@ scriptencoding utf-8 set encoding=utf-8 set shortmess=I "turn off splash screen -let vim_files=fnamemodify(expand("$MYVIMRC"), ":p:h") +let vim_files=fnamemodify(resolve(expand("$MYVIMRC")), ":p:h") let plug_path=expand(vim_files . '/autoload/plug.vim') let have_plug=filereadable(plug_path) if(!have_plug && executable('curl')) From 5c16f38239a4d66cadbf1ec53d211e62e0a15cbd Mon Sep 17 00:00:00 2001 From: Vasili Sviridov Date: Sat, 27 Feb 2016 12:37:46 -0800 Subject: [PATCH 4/4] forgot to return `execute` back in place --- vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index c9c469a..2599ab9 100644 --- a/vimrc +++ b/vimrc @@ -9,7 +9,7 @@ let have_plug=filereadable(plug_path) if(!have_plug && executable('curl')) echo "Installing Plug" - echo '!curl -fLo "' . plug_path . '" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + execute '!curl -fLo "' . plug_path . '" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' endif if(have_plug) @@ -221,7 +221,7 @@ else set mouse=a endif -colorscheme hybrid +silent! colorscheme hybrid let g:airline_powerline_fonts = 1 let g:airline#extensions#tabline#enabled = 1