1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 17:40:06 +08:00
SpaceVim/config/main.vim

68 lines
1.3 KiB
VimL
Raw Normal View History

2017-10-04 10:02:38 +08:00
if SpaceVim#server#connect()
finish
endif
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
" [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()]
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]
augroup SPwelcome
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()
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: