2015-03-26 17:09:26 +00:00
|
|
|
" A lot of inspiration from Shougo
|
2012-07-02 17:25:36 +00:00
|
|
|
|
2015-03-26 17:09:26 +00:00
|
|
|
" Note: Skip initialization for vim-tiny or vim-small.
|
|
|
|
if !1 | finish | endif
|
2012-07-02 17:25:36 +00:00
|
|
|
|
2019-10-21 23:26:35 +00:00
|
|
|
" Don't use fish as the default shell. This makes things weird
|
2015-05-21 20:52:19 +00:00
|
|
|
if &shell =~# 'fish$'
|
2015-10-26 17:23:45 +00:00
|
|
|
set shell=bash
|
2015-05-21 20:52:19 +00:00
|
|
|
endif
|
|
|
|
|
2015-03-26 17:09:26 +00:00
|
|
|
if &compatible
|
|
|
|
set nocompatible
|
2013-03-18 02:19:44 +00:00
|
|
|
endif
|
|
|
|
|
2015-03-27 00:54:29 +00:00
|
|
|
function! s:smart_source_rc(name)
|
|
|
|
call s:source_rc(a:name . '.rc.vim')
|
|
|
|
call s:source_rc(a:name . '.local.rc.vim')
|
2015-03-26 17:09:26 +00:00
|
|
|
endfunction
|
|
|
|
|
2015-03-27 00:54:29 +00:00
|
|
|
function! s:source_rc(path)
|
2015-03-26 17:11:36 +00:00
|
|
|
let l:f_path = fnameescape(expand('~/.vim/rc/' . a:path))
|
2015-03-26 17:09:26 +00:00
|
|
|
if filereadable(l:f_path)
|
|
|
|
execute 'source' . l:f_path
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
let s:is_windows = has('win16') || has('win32') || has('win64')
|
|
|
|
let s:is_cygwin = has('win32unix')
|
|
|
|
let s:is_sudo = $SUDO_USER !=# '' && $USER !=# $SUDO_USER
|
|
|
|
\ && $HOME !=# expand('~'.$USER)
|
|
|
|
\ && $HOME ==# expand('~'.$SUDO_USER)
|
|
|
|
|
2019-10-21 23:26:35 +00:00
|
|
|
|
|
|
|
" IsWindows determines if this instances is running on Windows
|
2015-03-26 17:09:26 +00:00
|
|
|
function! IsWindows()
|
|
|
|
return s:is_windows
|
|
|
|
endfunction
|
|
|
|
|
2019-10-21 23:26:35 +00:00
|
|
|
" IsMac determines if this instance is running on macOS
|
2015-03-26 17:09:26 +00:00
|
|
|
function! IsMac()
|
|
|
|
return !s:is_windows && !s:is_cygwin
|
|
|
|
\ && (has('mac') || has('macunix') || has('gui_macvim') ||
|
|
|
|
\ (!executable('xdg-open') &&
|
|
|
|
\ system('uname') =~? '^darwin'))
|
|
|
|
endfunction
|
|
|
|
|
2019-10-21 23:26:35 +00:00
|
|
|
" IsGuiApp determines if (n)vim is running in a GUI
|
2017-11-01 21:27:30 +00:00
|
|
|
function! IsGuiApp()
|
|
|
|
return has("gui_running") || exists("neovim_dot_app")
|
|
|
|
\ || has("gui_win32") || has("gui_macvim")
|
2018-06-13 20:19:22 +00:00
|
|
|
\ || has("gui_vimr") || exists('g:gui_oni')
|
2017-11-01 21:27:30 +00:00
|
|
|
endfunction
|
|
|
|
|
2019-10-21 23:26:35 +00:00
|
|
|
" Some GUI applications provide built in support for certain features
|
|
|
|
let g:gui = {}
|
|
|
|
let g:gui.has_buffer_features = exists('g:gui_oni')
|
|
|
|
let g:gui.has_autocomplete_features = exists('g:gui_oni')
|
|
|
|
let g:gui.has_linter_features = exists('g:gui_oni')
|
|
|
|
let g:gui.has_ctags_features = exists('g:gui_oni')
|
|
|
|
|
2015-03-26 17:09:26 +00:00
|
|
|
" Auto install vim-plug
|
|
|
|
if empty(glob('~/.vim/autoload/plug.vim'))
|
2018-06-13 20:19:22 +00:00
|
|
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
|
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
|
|
autocmd VimEnter * PlugInstall
|
2014-11-04 18:18:22 +00:00
|
|
|
endif
|
2013-12-05 22:32:02 +00:00
|
|
|
|
2017-11-08 21:55:13 +00:00
|
|
|
call s:smart_source_rc('init')
|
2019-10-21 17:49:27 +00:00
|
|
|
call s:smart_source_rc('input')
|
2015-03-26 17:09:26 +00:00
|
|
|
call plug#begin()
|
2015-03-27 00:54:29 +00:00
|
|
|
call s:smart_source_rc('plugins')
|
2015-03-26 17:09:26 +00:00
|
|
|
call plug#end()
|
2015-03-27 00:54:29 +00:00
|
|
|
call s:smart_source_rc('ui')
|