mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-11-10 18:16:29 +00:00
55 lines
1.4 KiB
VimL
55 lines
1.4 KiB
VimL
" A lot of inspiration from Shougo
|
|
|
|
" Note: Skip initialization for vim-tiny or vim-small.
|
|
if !1 | finish | endif
|
|
|
|
if &compatible
|
|
set nocompatible
|
|
endif
|
|
|
|
function! s:smart_source_rc(name)
|
|
call s:source_rc(a:name . '.rc.vim')
|
|
call s:source_rc(a:name . '.local.rc.vim')
|
|
endfunction
|
|
|
|
function! s:source_rc(path)
|
|
let l:f_path = fnameescape(expand('~/.vim/rc/' . a:path))
|
|
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)
|
|
|
|
function! IsWindows()
|
|
return s:is_windows
|
|
endfunction
|
|
|
|
function! IsMac()
|
|
return !s:is_windows && !s:is_cygwin
|
|
\ && (has('mac') || has('macunix') || has('gui_macvim') ||
|
|
\ (!executable('xdg-open') &&
|
|
\ system('uname') =~? '^darwin'))
|
|
endfunction
|
|
|
|
" Auto install vim-plug
|
|
if empty(glob('~/.vim/autoload/plug.vim'))
|
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
|
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
autocmd VimEnter * PlugInstall
|
|
endif
|
|
|
|
call s:source_rc('init.rc.vim')
|
|
|
|
call plug#begin()
|
|
call s:smart_source_rc('plugins')
|
|
call plug#end()
|
|
|
|
call s:smart_source_rc('edit')
|
|
call s:smart_source_rc('keymap')
|
|
call s:smart_source_rc('ui')
|