mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 08:00:05 +08:00
Add server client mode
This commit is contained in:
parent
b34e0beda6
commit
8d50f9e229
@ -11,12 +11,13 @@
|
|||||||
|
|
||||||
function! SpaceVim#server#connect()
|
function! SpaceVim#server#connect()
|
||||||
if empty($SPACEVIM_SERVER_ADDRESS)
|
if empty($SPACEVIM_SERVER_ADDRESS)
|
||||||
let $SPACEVIM_SERVER_ADDRESS = serverlist()[0]
|
let $SPACEVIM_SERVER_ADDRESS = fnamemodify('~/.cache/SpaceVim/server', ':p')
|
||||||
return 0
|
|
||||||
else
|
|
||||||
call sockconnect('pipe', $SPACEVIM_SERVER_ADDRESS, {'rpc' : 1})
|
|
||||||
return 1
|
|
||||||
endif
|
endif
|
||||||
|
try
|
||||||
|
call serverstart($SPACEVIM_SERVER_ADDRESS)
|
||||||
|
call SpaceVim#logger#info('SpaceVim server startup at:' . $SPACEVIM_SERVER_ADDRESS)
|
||||||
|
catch /Failed to start server: address already in use/
|
||||||
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
11
bin/svc
Executable file
11
bin/svc
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# SpaceVim client mode
|
||||||
|
# Copyright (c) 2016-2017 Shidong Wang & Contributors
|
||||||
|
# Author: Shidong Wang < wsdjeg at 163.com >
|
||||||
|
# URL: https://spacevim.org
|
||||||
|
# License: MIT license
|
||||||
|
#=============================================================================
|
||||||
|
|
||||||
|
nvr --servername ~/.cache/SpaceVim/server --remote $@
|
@ -1,6 +1,4 @@
|
|||||||
if SpaceVim#server#connect()
|
call 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')
|
||||||
|
@ -942,7 +942,8 @@ MAPPINGS
|
|||||||
normal gd rust-definition
|
normal gd rust-definition
|
||||||
normal gs rust-definition-split
|
normal gs rust-definition-split
|
||||||
normal gx rust-definition-vertical
|
normal gx rust-definition-vertical
|
||||||
normal <leader>gd rust-doc
|
normal SPC l d rust-doc
|
||||||
|
normal SPC l r execute current file
|
||||||
<
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user