forked from neoclide/vim-node-rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.vim
More file actions
30 lines (25 loc) · 740 Bytes
/
python.vim
File metadata and controls
30 lines (25 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
set nocompatible
let s:root = expand('<sfile>:h')
"let g:nvim_node_rpc_debug = 1
execute 'set rtp+='.fnameescape(s:root)
call nvim#rpc#start_server()
function! s:PythonStart()
terminal python
let job = term_getjob("")
let channel = job_getchannel(job)
sleep 100m
let list = [
\ "from neovim import attach",
\ "nvim = attach('socket', path='".$NVIM_LISTEN_ADDRESS."')",
\ "buffer = nvim.buffers[1]"
\]
call ch_sendraw(channel, join(list, "\n"))
endfunction
function! s:on_stderr(channel, message)
echohl Error | echon a:message | echohl None
endfunction
augroup Test
autocmd!
autocmd User NvimRpcInit call s:PythonStart()
augroup end
command! -nargs=? Openlog :call nvim#rpc#open_log()