aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-10-22 22:05:58 +0800
committerjdhao <jdhao@hotmail.com>2021-10-22 22:05:58 +0800
commit8325286097ffde36bda0d5e4a2c59dcb19394e1a (patch)
tree526319a1bc26394b2e859ea04af16979e5f17def
parentc873572872f42696772ca284074c502894b56633 (diff)
vimtex conf update
-rw-r--r--core/plugins.vim15
1 files 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 <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 = {