From 8325286097ffde36bda0d5e4a2c59dcb19394e1a Mon Sep 17 00:00:00 2001 From: jdhao Date: Fri, 22 Oct 2021 22:05:58 +0800 Subject: [PATCH] vimtex conf update --- core/plugins.vim | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/core/plugins.vim b/core/plugins.vim index 8dd4a5f..515f606 100644 --- a/core/plugins.vim +++ b/core/plugins.vim @@ -303,20 +303,17 @@ omap s "{{ LaTeX editing """"""""""""""""""""""""""""vimtex settings""""""""""""""""""""""""""""" if ( g:is_win || g:is_mac ) && executable('latex') - function! SetServerName() abort - 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) + " Hacks for inverse serach to work semi-automatically, + " see https://jdhao.github.io/2021/02/20/inverse_search_setup_neovim_vimtex/. + function! s:write_server_name() abort + let nvim_server_file = (has('win32') ? $TEMP : '/tmp') . '/vimtexserver.txt' + call writefile([v:servername], nvim_server_file) endfunction augroup vimtex_common autocmd! + autocmd FileType tex call s:write_server_name() autocmd FileType tex nmap (vimtex-compile) - autocmd FileType tex call SetServerName() augroup END let g:vimtex_compiler_latexmk = {