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

Add vim8 support

This commit is contained in:
wsdjeg 2017-11-08 22:47:56 +08:00
parent 4fc14287f9
commit df957672d4
3 changed files with 18 additions and 2 deletions

View File

@ -11,7 +11,7 @@
function! SpaceVim#server#connect()
if empty($SPACEVIM_SERVER_ADDRESS)
let $SPACEVIM_SERVER_ADDRESS = fnamemodify('~/.cache/SpaceVim/server', ':p')
let $SPACEVIM_SERVER_ADDRESS = fnamemodify('/tmp/' . (has('nvim') ? 'spacevim_nvim_' : 'spacevim_vim_') . 'server', ':p')
endif
if has('nvim')
try
@ -19,6 +19,11 @@ function! SpaceVim#server#connect()
call SpaceVim#logger#info('SpaceVim server startup at:' . $SPACEVIM_SERVER_ADDRESS)
catch /Failed to start server: address already in use/
endtry
elseif exists('*remote_startserver')
if index(split(serverlist(), "\n"), $SPACEVIM_SERVER_ADDRESS) == -1
call remote_startserver($SPACEVIM_SERVER_ADDRESS)
call SpaceVim#logger#info('SpaceVim server startup at:' . $SPACEVIM_SERVER_ADDRESS)
endif
endif
endfunction

11
bin/nsvc Executable file
View 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 /tmp/spacevim_nvim_server --remote $@

View File

@ -8,4 +8,4 @@
# License: MIT license
#=============================================================================
nvr --servername ~/.cache/SpaceVim/server --remote $@
/usr/bin/vim --servername /tmp/spacevim_vim_server --remote-silent $@