1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

vimtex conf update

This commit is contained in:
jdhao 2021-10-22 22:05:58 +08:00
parent c873572872
commit 8325286097

View File

@ -303,20 +303,17 @@ omap s <Nop>
"{{ 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 <buffer> <F9> <plug>(vimtex-compile)
autocmd FileType tex call SetServerName()
augroup END
let g:vimtex_compiler_latexmk = {