diff --git a/core/plugins.vim b/core/plugins.vim index 8c77c36..9bba13d 100644 --- a/core/plugins.vim +++ b/core/plugins.vim @@ -775,9 +775,20 @@ omap s "{{ LaTeX editting """"""""""""""""""""""""""""vimtex settings""""""""""""""""""""""""""""" if ( g:is_win || g:is_mac ) && executable('latex') - augroup vimtex_map + function! SetServerName() + if has('win32') + let nvim_server_file = $TEMP . '/curnvimserver.txt' + else + let nvim_server_file = '/tmp/curnvimserver.txt' + endif + let cmd = printf('echo %s > %s', v:servername, nvim_server_file) + call system(cmd) + endfunction + + augroup vimtex_common autocmd! autocmd FileType tex nmap (vimtex-compile) + autocmd FileType tex call SetServerName() augroup END " Deoplete configurations for autocompletion to work @@ -816,13 +827,8 @@ if ( g:is_win || g:is_mac ) && executable('latex') augroup vimtex_mac autocmd! autocmd User VimtexEventCompileSuccess call UpdateSkim() - autocmd FileType tex call SetServerName() augroup END - function! SetServerName() - call system('echo ' . v:servername . ' > /tmp/curvimserver') - endfunction - " The following code is adapted from https://gist.github.com/skulumani/7ea00478c63193a832a6d3f2e661a536. function! UpdateSkim() abort let l:out = b:vimtex.out()