vim,zathura: Setup LaTeX file development
LaTeX files can now be automatically compiled in vim and jumping into the relevant lines from PDF to code or the other way around is possible too. Add the LaTeX coc-language server as well. Thanks to @AurelWeinhold
This commit is contained in:
1
.config/vim/pack/plugins/opt/vimtex
Submodule
1
.config/vim/pack/plugins/opt/vimtex
Submodule
Submodule .config/vim/pack/plugins/opt/vimtex added at 7c886a0731
@@ -1,11 +1,13 @@
|
||||
" Set leader key
|
||||
let mapleader = "\<Space>"
|
||||
let maplocalleader = mapleader
|
||||
|
||||
" Plugins ######################################################################
|
||||
" Auto completion
|
||||
" needs vim >= 8.1.1719 to support features like popup and text property.
|
||||
if (has('patch-8.1.1719') || has('nvim'))
|
||||
let g:coc_global_extensions = ['coc-clangd', 'coc-sh', 'coc-python']
|
||||
let g:coc_global_extensions =
|
||||
\ ['coc-clangd', 'coc-sh', 'coc-python', 'coc-vimtex']
|
||||
packadd! coc.nvim
|
||||
source $XDG_CONFIG_HOME/vim/coc.nvim.vim
|
||||
endif
|
||||
@@ -17,6 +19,9 @@ packadd! fzf.vim
|
||||
nmap <leader>f :Files<CR>
|
||||
" Theme
|
||||
packadd! onedark.vim
|
||||
" LaTeX
|
||||
packadd! vimtex
|
||||
source $XDG_CONFIG_HOME/vim/vimtex.vim
|
||||
" Git information
|
||||
packadd! vim-gitgutter
|
||||
" Surround text with parentheses, brackets, quotes, tags, etc.
|
||||
|
||||
24
.config/vim/vimtex.vim
Normal file
24
.config/vim/vimtex.vim
Normal file
@@ -0,0 +1,24 @@
|
||||
let g:tex_flavor = "latex"
|
||||
let g:vimtex_compiler_progname = 'nvr'
|
||||
|
||||
" Setup latexmk and make callback possible with synctex
|
||||
" (Click into PDF to land in code)
|
||||
let g:vimtex_compiler_latexmk = {
|
||||
\ 'build_dir' : 'build',
|
||||
\ 'callback' : 1,
|
||||
\ 'continuous' : 1,
|
||||
\ 'executable' : 'latexmk',
|
||||
\ 'hooks' : [],
|
||||
\ 'options' : [
|
||||
\ '-verbose',
|
||||
\ '-file-line-error',
|
||||
\ '-synctex=1',
|
||||
\ '-interaction=nonstopmode',
|
||||
\ '-shell-escape',
|
||||
\ ],
|
||||
\}
|
||||
|
||||
" synctex needs to be activated in zathurarc as well
|
||||
let g:vimtex_context_pdf_viewer='zathura'
|
||||
let g:vimtex_view_general_viewer = 'zathura'
|
||||
let g:vimtex_view_method='zathura'
|
||||
@@ -16,3 +16,7 @@ set recolor-reverse-video true
|
||||
|
||||
# Search while typing
|
||||
set incremental-search true
|
||||
|
||||
# vimtex
|
||||
set synctex true
|
||||
set synctex-editor-command "nvr --remote +%{line} %{input}"
|
||||
|
||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -58,3 +58,6 @@
|
||||
[submodule ".local/bin/fzf-repo"]
|
||||
path = .local/bin/fzf-repo
|
||||
url = https://github.com/junegunn/fzf
|
||||
[submodule ".config/vim/pack/plugins/opt/vimtex"]
|
||||
path = .config/vim/pack/plugins/opt/vimtex
|
||||
url = https://github.com/lervag/vimtex
|
||||
|
||||
Reference in New Issue
Block a user