anders
November 4, 2024, 5:52pm
1
Problem
When opening a tex file I get, for vimPlugins.coc-texlab
, the following popup:
TexLab Server is not found, download from GitHub?
1. Yes
2. Cancel
I get a similar error when trying with vimPlugins.coc-vimtex
.
Question
Any advice on how to solve above problem?
Additional info
Configuration
I think the following are the relevant parts of my Home Manager configuration:
programs.neovim.enable = true;
programs.neovim.coc.enable = true;
programs.neovim.plugins = [
# …
pkgs.vimPlugins.coc-texlab
# …
];
Relevant links
opened 02:35PM - 09 Mar 22 UTC
closed 01:20PM - 11 Mar 22 UTC
bug
### Description
Hello, it's my first time posting an issue I have.
I install… ed vimtex, coc.nvim alongside other plugins through Vim_Plug and each time I open a `.tex` file i get an error saying `[coc.nvim] vimtex not loaded, please check your runtimepath`. I searched if this issue was already treated and I found these two posts [#18](https://github.com/neoclide/coc-vimtex/issues/18) and [#6](https://github.com/neoclide/coc-vimtex/issues/6) but it didn't help me. My vimtex installation works well (`:VimtexInfo` works and I added `let g:tex_flavor = 'latex'` to my `.vimrc`) so it isn't like the above posts' issue.
Here is the output of `:CocInfo`:
```
2022-03-09T15:19:50.486 ERROR (pid:7435) [node-client] - request error on "nvim_eval" [ 'vimtex#re#deoplete' ] Vim(return):E121: Undefined variable: vimtex#re#deoplete Error
at O1.request (/home/kaiser/.vim/plugged/coc.nvim/build/index.js:29:43511)
at O1.eval (/home/kaiser/.vim/plugged/coc.nvim/build/index.js:34:3435)
at activate (/home/kaiser/.config/coc/extensions/node_modules/coc-vimtex/src/index.js:10:24)
at active (/home/kaiser/.config/coc/extensions/node_modules/coc-vimtex/src/index.js:78:5)
at Object.exports.activate (/home/kaiser/.config/coc/extensions/node_modules/coc-vimtex/src/index.js:82:7)
at /home/kaiser/.vim/plugged/coc.nvim/build/index.js:249:1411
at new Promise (<anonymous>)
at Object.activate (/home/kaiser/.vim/plugged/coc.nvim/build/index.js:249:1369)
at V7.activate (/home/kaiser/.vim/plugged/coc.nvim/build/index.js:246:7425)
at /home/kaiser/.vim/plugged/coc.nvim/build/index.js:248:283
2022-03-09T15:19:50.488 WARN (pid:7435) [workspace] - workspace.showMessage is deprecated, please use window.showMessage instead.
at activate (/home/kaiser/.config/coc/extensions/node_modules/coc-vimtex/src/index.js:12:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2022-03-09T15:19:54.777 INFO (pid:7435) [attach] - receive notification: showInfo []
```
So apparently there is a problem with `vimtex#re#deoplete` but I don't even have it installed, I don't quite understand where the problem is, if it's on vimtex side or coc.nvim side.
Here is the main part of my `.vimrc`:
```vim
" vim_plug plugin
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" beginning of plugin list
call plug#begin()
Plug 'lervag/vimtex' " latex
let g:tex_flavor = 'latex'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim' " fuzzy search tool
Plug 'godlygeek/tabular' " markdown plugins
Plug 'plasticboy/vim-markdown'
Plug 'iamcco/markdown-preview.nvim', {'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
Plug 'morhetz/gruvbox' " color theme
Plug 'tmhedberg/SimpylFold' " fix intensive folding when indent
Plug 'vim-scripts/indentpython.vim'
" python indent helper
" Plug 'vim-syntastic/syntastic' " check syntax for python etc
Plug 'preservim/nerdtree' " tree to navigate in project's files
" Plug 'kien/ctrlp.vim' " <C-p> enable fuzzy file search
call plug#end()
" overall config
set encoding=utf-8
filetype plugin indent on
syntax on
" vimtex config
let g:vimtex_enabled = 1
let g:vimtex_view_general_viewer = 'mupdf'
let g:vimtex_compiler_method = 'latexmk'
let g:vimtex_compiler_latexmk_engines = {
\ '_' : '-xelatex'
\}
let g:vimtex_complete_enabled = 1
let g:vimtex_fold_enabled = 1 " folding tex sections
let g:vimtex_complete_enabled = 0
" coc config
set hidden cmdheight=2 updatetime=300 shortmess+=c
" trigger completion
inoremap <silent>expr> <c-m> coc'refresh()
let g:coc_global_extensions = [
" \ 'coc-vimtex',
" \ 'coc-pairs'
" \]
```
While submitting this issue I noticed that in the `minima.vim`, vimtex is called in `~/vim/bundle/vimtex` but mine is installed in `~/vim/plugged/vimtex`, maybe this can be the problem(?)
I read the documentation about `vimtex-complete-coc.nvim` but it didn't help me further so I am now trying to submit an issue.
As I said I am new in this issue submitting so please ask me if I forgot to add something.
Thank you in advance for your help!
### Steps to reproduce
_No response_
### Expected behavior
_No response_
### Actual behavior
_No response_
### Do you use a latexmkrc file?
No
### VimtexInfo
```yaml
System info:
OS: Arch Linux
Vim version: VIM 8.2 (1-4464)
Has clientserver: true
Servername: undefined (vim started without --servername)
VimTeX project: template
base: template.tex
root: /mnt/internal/latex
tex: /mnt/internal/latex/template.tex
main parser: current file verified
document class: article
packages: atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook bigintcalc biolinum bitset cgloss4e color etexcmds etoolbox expl3 fontenc fontspec fontspec-xetex gb4e geometry gettitlestring hycolor hyperref ifluatex iftex ifvtex ifxetex infwarerr inputenc intcalc keyval kvdefinekeys kvoptions kvsetkeys l3keys2e letltxmacro libertineMono libertineRoman ltxcmds makecmds nameref pdfescape pdftexcmds polyglossia refcount rerunfilecheck setspace stringenc textcomp titlesec uniquecounter url xcolor xkeyval xparse
compiler: latexmk
engine: -xelatex
options:
-verbose
-file-line-error
-synctex=1
-interaction=nonstopmode
callback: 1
continuous: 1
executable: latexmk
viewer: General
qf method: LaTeX logfile
```
teto
November 4, 2024, 7:08pm
2
you are missing the actual program texlab
as the message mentions. you didn’t say what happened after answering “yes” but chances are it will fail as the download texlab executable wont work.
add pkgs.texlab
to your environment.
We’ll try to make it work out of the box in the future see collect and add to PATH runtimeinputs of neovim plugin dependencies · Issue #352738 · NixOS/nixpkgs · GitHub
2 Likes
anders
November 4, 2024, 10:37pm
3
Thanks, adding pkgs.texlab
to home.packages
solved it!
@anders , I changed the post to help category and you can now mark teto’s answer as solution.
1 Like