diff options
| author | jdhao <jdhao@hotmail.com> | 2021-02-20 22:24:08 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-02-20 22:24:08 +0800 |
| commit | 2672a92e7740000490c80954bfa0bce4767ef5d4 (patch) | |
| tree | e563648b7d0804ecc5aa55614c198f653bd70601 | |
| parent | 448fe4ad58ad417a90d6940e1816df5bd00fa48f (diff) | |
Update vimtex settings
| -rw-r--r-- | core/plugins.vim | 18 |
1 files changed, 12 insertions, 6 deletions
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 <Nop> "{{ 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 <buffer> <F9> <plug>(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() |
