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:
parent
45e26cdc1d
commit
7ba7ca3455
21
autoload/SpaceVim/server.vim
Normal file
21
autoload/SpaceVim/server.vim
Normal 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
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -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'))?'\':'/') . '?')
|
||||||
|
Loading…
Reference in New Issue
Block a user