1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:50:05 +08:00

Add server support

This commit is contained in:
wsdjeg 2017-10-04 10:02:38 +08:00
parent 45e26cdc1d
commit 7ba7ca3455
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,21 @@
"=============================================================================
" server.vim --- server manager for SpaceVim
" Copyright (c) 2016-2017 Shidong Wang & Contributors
" Author: Shidong Wang < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: MIT license
"=============================================================================
function! SpaceVim#server#connect()
if empty($SPACEVIM_SERVER_ADDRESS)
let $SPACEVIM_SERVER_ADDRESS = serverlist()[0]
return 0
else
call sockconnect('pipe', $SPACEVIM_SERVER_ADDRESS, {'rpc' : 1})
return 1
endif
endfunction

View File

@ -1,3 +1,7 @@
if SpaceVim#server#connect()
finish
endif
let g:Config_Main_Home = fnamemodify(expand('<sfile>'), let g:Config_Main_Home = fnamemodify(expand('<sfile>'),
\ ':p:h:gs?\\?'.((has('win16') || has('win32') \ ':p:h:gs?\\?'.((has('win16') || has('win32')
\ || has('win64'))?'\':'/') . '?') \ || has('win64'))?'\':'/') . '?')