From 338a962b3f7492c96b991e969f689f993a0bbc3b Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Fri, 28 Jul 2023 09:18:07 +0200 Subject: [PATCH] nvim latex stuff --- home/.config/nvim/coc-settings.json | 8 +++++- home/.config/nvim/coc.vim | 19 ++++++++++++- home/.config/nvim/ltex.vim | 1 + home/.config/nvim/main.vim | 3 ++ home/.config/nvim/plugs.vim | 1 + home/.config/nvim/vimtex.vim | 43 +++++++++++++++++++++++++++++ 6 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 home/.config/nvim/ltex.vim create mode 100644 home/.config/nvim/vimtex.vim diff --git a/home/.config/nvim/coc-settings.json b/home/.config/nvim/coc-settings.json index 3e2101c..92aa162 100644 --- a/home/.config/nvim/coc-settings.json +++ b/home/.config/nvim/coc-settings.json @@ -1,5 +1,11 @@ { "rust-analyzer.server.path": "~/.cargo/bin/rust-analyzer", "suggest.acceptSuggestionOnCommitCharacter": true, - "diagnostic.displayByAle": false + "diagnostic.displayByAle": false, + "languageserver": { + "digestif": { + "command": "digestif", + "filetypes": ["tex", "plaintex", "context"] + } + } } diff --git a/home/.config/nvim/coc.vim b/home/.config/nvim/coc.vim index a8f022f..d4cbc51 100644 --- a/home/.config/nvim/coc.vim +++ b/home/.config/nvim/coc.vim @@ -1,4 +1,21 @@ -let g:coc_global_extensions = ['coc-json', 'coc-git', 'coc-clangd', 'coc-cmake', 'coc-css', 'coc-floaterm', 'coc-fzf-preview', 'coc-html', 'coc-json', 'coc-lists', 'coc-lua', 'coc-pyright', 'coc-rust-analyzer', 'coc-sh', 'coc-sql', 'coc-markdownlint'] +let g:coc_global_extensions = [ + \'coc-json', + \'coc-git', + \'coc-clangd', + \'coc-cmake', + \'coc-css', + \'coc-floaterm', + \'coc-fzf-preview', + \'coc-html', + \'coc-json', + \'coc-lists', + \'coc-lua', + \'coc-pyright', + \'coc-rust-analyzer', + \'coc-sh', + \'coc-sql', + \'coc-markdownlint', + \] " navigate between errors quickly nmap (coc-diagnostic-prev) diff --git a/home/.config/nvim/ltex.vim b/home/.config/nvim/ltex.vim new file mode 100644 index 0000000..1799c1d --- /dev/null +++ b/home/.config/nvim/ltex.vim @@ -0,0 +1 @@ +let g:coc_filetype_map = {'tex': 'latex'} diff --git a/home/.config/nvim/main.vim b/home/.config/nvim/main.vim index 2963471..7f5d1f4 100644 --- a/home/.config/nvim/main.vim +++ b/home/.config/nvim/main.vim @@ -37,6 +37,9 @@ runtime tagbar.vim " load suda runtime suda.vim +" load vimtex +runtime vimtex.vim + " load ALE (another language server or something that works with COC) "runtime ale.vim diff --git a/home/.config/nvim/plugs.vim b/home/.config/nvim/plugs.vim index ce691fd..861413b 100644 --- a/home/.config/nvim/plugs.vim +++ b/home/.config/nvim/plugs.vim @@ -23,6 +23,7 @@ Plug 'nvim-tree/nvim-web-devicons' Plug 'rust-lang/rust.vim' Plug 'preservim/tagbar' Plug 'lambdalisue/suda.vim' +Plug 'lervag/vimtex' "Plug 'dense-analysis/ale' call plug#end() diff --git a/home/.config/nvim/vimtex.vim b/home/.config/nvim/vimtex.vim new file mode 100644 index 0000000..217dee6 --- /dev/null +++ b/home/.config/nvim/vimtex.vim @@ -0,0 +1,43 @@ +" This is necessary for VimTeX to load properly. The "indent" is optional. +" Note that most plugin managers will do this automatically. +filetype plugin indent on + +" This enables Vim's and neovim's syntax-related features. Without this, some +" VimTeX features will not work (see ":help vimtex-requirements" for more +" info). +syntax enable + +" Viewer options: One may configure the viewer either by specifying a built-in +" viewer method: +let g:vimtex_view_method = 'zathura' + +" Or with a generic interface: +let g:vimtex_view_general_viewer = 'okular' +let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex' + +" VimTeX uses latexmk as the default compiler backend. If you use it, which is +" strongly recommended, you probably don't need to configure anything. If you +" want another compiler backend, you can change it as follows. The list of +" supported backends and further explanation is provided in the documentation, +" see ":help vimtex-compiler". +let g:vimtex_compiler_method = 'latexmk' + +" Most VimTeX mappings rely on localleader and this can be changed with the +" following line. The default is usually fine and is the symbol "\". +let maplocalleader = "," + +let g:vimtex_compiler_latexmk = { + \ 'aux_dir' : 'build', + \ 'out_dir' : '', + \ 'callback' : 1, + \ 'continuous' : 1, + \ 'executable' : 'latexmk', + \ 'hooks' : [], + \ 'options' : [ + \ '-verbose', + \ '-file-line-error', + \ '-synctex=1', + \ '-interaction=nonstopmode', + \ ], + \} +