2017-08-16 06:09:25 +08:00
|
|
|
let g:Config_Main_Home = fnamemodify(expand('<sfile>'),
|
|
|
|
\ ':p:h:gs?\\?'.((has('win16') || has('win32')
|
|
|
|
\ || has('win64'))?'\':'/') . '?')
|
2016-12-29 18:53:29 +08:00
|
|
|
|
2017-05-11 21:44:43 +08:00
|
|
|
|
|
|
|
" [dir?, path]
|
|
|
|
function! s:parser_argv() abort
|
|
|
|
if !argc()
|
|
|
|
return [1, getcwd()]
|
|
|
|
elseif argv(0) =~# '/$'
|
|
|
|
let f = expand(argv(0))
|
|
|
|
if isdirectory(f)
|
|
|
|
return [1, f]
|
|
|
|
else
|
|
|
|
return [1, getcwd()]
|
|
|
|
endif
|
2017-06-09 21:08:16 +08:00
|
|
|
elseif argv(0) ==# '.'
|
|
|
|
return [1, getcwd()]
|
2017-05-11 21:44:43 +08:00
|
|
|
elseif isdirectory(expand(argv(0)))
|
|
|
|
return [1, expand(argv(0)) ]
|
|
|
|
else
|
|
|
|
return [0]
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
let s:status = s:parser_argv()
|
|
|
|
if s:status[0]
|
2017-06-09 21:08:16 +08:00
|
|
|
let g:_spacevim_enter_dir = s:status[1]
|
2017-06-20 07:23:14 +08:00
|
|
|
augroup SPwelcome
|
2017-05-11 21:44:43 +08:00
|
|
|
au!
|
|
|
|
autocmd VimEnter * call SpaceVim#welcome()
|
|
|
|
augroup END
|
|
|
|
endif
|
|
|
|
|
2016-12-26 21:11:19 +08:00
|
|
|
try
|
|
|
|
call zvim#util#source_rc('functions.vim')
|
|
|
|
catch
|
2016-12-28 21:36:11 +08:00
|
|
|
execute 'set rtp +=' . fnamemodify(g:Config_Main_Home, ':p:h:h')
|
2016-12-26 21:11:19 +08:00
|
|
|
call zvim#util#source_rc('functions.vim')
|
|
|
|
endtry
|
|
|
|
|
2016-12-28 21:36:11 +08:00
|
|
|
|
2016-12-26 21:11:19 +08:00
|
|
|
call zvim#util#source_rc('init.vim')
|
|
|
|
|
2016-12-29 18:53:29 +08:00
|
|
|
call SpaceVim#default()
|
2016-12-26 21:11:19 +08:00
|
|
|
|
2016-12-28 21:36:11 +08:00
|
|
|
call SpaceVim#loadCustomConfig()
|
|
|
|
|
2017-11-08 21:18:48 +08:00
|
|
|
call SpaceVim#server#connect()
|
|
|
|
|
2016-12-28 21:36:11 +08:00
|
|
|
call SpaceVim#end()
|
2016-12-26 21:11:19 +08:00
|
|
|
|
|
|
|
call zvim#util#source_rc('general.vim')
|
|
|
|
|
2017-01-07 01:09:56 +08:00
|
|
|
|
2016-12-26 21:11:19 +08:00
|
|
|
|
2017-01-03 22:29:54 +08:00
|
|
|
call SpaceVim#autocmds#init()
|
2016-12-26 21:11:19 +08:00
|
|
|
|
|
|
|
if has('nvim')
|
|
|
|
call zvim#util#source_rc('neovim.vim')
|
|
|
|
endif
|
|
|
|
|
|
|
|
call zvim#util#source_rc('commands.vim')
|
2017-01-08 00:17:32 +08:00
|
|
|
filetype plugin indent on
|
|
|
|
syntax on
|
2017-08-16 06:09:25 +08:00
|
|
|
" vim:set et sw=2 cc=80:
|