0%

vim的latex插件

首先下载

1
sudo pacman -S texlive-core texlive-langchinese 

在vimrc里面配置如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Plug 'lervag/vimtex'
let g:tex_flavor='latex'

" 阅读器相关的配置 包含正反向查找功能 仅供参考
let g:vimtex_view_general_viewer = 'zathura'
let g:vimtex_view_general_options_latexmk = '-reuse-instance'
let g:vimtex_view_general_options
\ = '-reuse-instance -forward-search @tex @line @pdf'
\ . ' -inverse-search "' . exepath(v:progpath)
\ . ' --servername ' . v:servername
\ . ' --remote-send \"^<C-\^>^<C-n^>'
\ . ':execute ''drop '' . fnameescape(''\%f'')^<CR^>'
\ . ':\%l^<CR^>:normal\! zzzv^<CR^>'
\ . ':call remote_foreground('''.v:servername.''')^<CR^>^<CR^>\""'

set conceallevel=1
let g:tex_conceal='abdmg'

在编辑好的.tex格式文件用vim打开,可以通过一下命令编译操作

LHS RHS MODE
<leader>li (vimtex-info) n
<leader>lt (vimtex-toc-open) n
<leader>lT (vimtex-toc-toggle) n
<leader>lv (vimtex-view) n
<leader>ll (vimtex-compile) n
<leader>lo (vimtex-compile-output) n
<leader>lg (vimtex-status) n
<leader>lG (vimtex-status-all) n
<leader>lc (vimtex-clean) n
<leader>lC (vimtex-clean-full) n
dse (vimtex-env-delete) n
dsc (vimtex-cmd-delete) n
cse (vimtex-env-change) n
csc (vimtex-cmd-change) n
F7 (vimtex-cmd-create) nxi
]] (vimtex-delim-close) i

<leader>键设置为默认的\