mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:10:04 +08:00
144ac248cd
close #1263
76 lines
1.7 KiB
VimL
76 lines
1.7 KiB
VimL
"=============================================================================
|
|
" main.vim --- Main file of SpaceVim
|
|
" Copyright (c) 2016-2017 Shidong Wang & Contributors
|
|
" Author: Shidong Wang < wsdjeg at 163.com >
|
|
" URL: https://spacevim.org
|
|
" License: MIT license
|
|
"=============================================================================
|
|
|
|
let g:Config_Main_Home = fnamemodify(expand('<sfile>'),
|
|
\ ':p:h:gs?\\?'.((has('win16') || has('win32')
|
|
\ || has('win64'))?'\':'/') . '?')
|
|
|
|
|
|
" [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
|
|
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]
|
|
let g:_spacevim_enter_dir = s:status[1]
|
|
augroup SPwelcome
|
|
au!
|
|
autocmd VimEnter * call SpaceVim#welcome()
|
|
augroup END
|
|
endif
|
|
|
|
try
|
|
call zvim#util#source_rc('functions.vim')
|
|
catch
|
|
execute 'set rtp +=' . fnamemodify(g:Config_Main_Home, ':p:h:h')
|
|
call zvim#util#source_rc('functions.vim')
|
|
endtry
|
|
|
|
call SpaceVim#plugins#projectmanager#RootchandgeCallback()
|
|
|
|
|
|
call zvim#util#source_rc('init.vim')
|
|
|
|
call SpaceVim#default()
|
|
|
|
call SpaceVim#loadCustomConfig()
|
|
|
|
call SpaceVim#server#connect()
|
|
|
|
call SpaceVim#end()
|
|
|
|
call zvim#util#source_rc('general.vim')
|
|
|
|
|
|
|
|
call SpaceVim#autocmds#init()
|
|
|
|
if has('nvim')
|
|
call zvim#util#source_rc('neovim.vim')
|
|
endif
|
|
|
|
call zvim#util#source_rc('commands.vim')
|
|
filetype plugin indent on
|
|
syntax on
|
|
" vim:set et sw=2 cc=80:
|