Closed brotherJ4mes closed 6 months ago
I think I've done all the sanity checks. I'm running vim 8.0.1763, Latexmk 4.80 and I've read the help page on requirements.
Seems like a good start! Notice, though, that Vim 8.0.1763 is really quite old! Although it should work, I do plan to bump requirements by quite a lot in not too far future. So I advice that you update your Vim version!
I also notice from the :VimtexInfo
output that you are running Linux 4.18 - I'm curious, which distro are you using? If you really are on kernel version 4.18, you should seriously consider to update your system! See here - this kernel version is even outside its LTS support window.
call plug#begin() Plug 'lervag/vimtex' call plug#end() let g:tex_flavor = 'latex' let g:vimtex_view_method = 'mupdf-x11' let g:vimtex_compiler_latexmk= {'options' : ['-pdf', '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode',],} let g:vimtex_fold_enabled = 1 filetype plugin indent on syntax enable
I'm curious, why do you have let g:tex_flavor = 'latex'
- I mean, where did you find the suggestion to include it? You can safely remove it and it has not been relevant for ~5 years now.
'mupdf-x11'
is not a valid view method. You probably want to use let g:vimtex_view_method = 'mupdf'
. Further, -pdf
should not be added to the compiler options. Finally, with vim-plug, you don't need the last two lines. Thus, you can simplify your listed config to this:
call plug#begin()
Plug 'lervag/vimtex'
call plug#end()
let g:vimtex_view_method = 'mupdf'
let g:vimtex_compiler_latexmk = {
\ 'options': [
\ '-shell-escape',
\ '-verbose',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ ]
\}
let g:vimtex_fold_enabled = 1
When I first open a .tex file with vim, I get a bunch of invalid expression and undefined errors: …
Hah, I think this is because I use the ..
variant for string concatenation. I was not aware this is not backwards compatible. It seems this syntax was only available from Vim version 8.1.114.
As mentioned, I plan to bump the version requirements, and instead of reverting things for backwards compatibility, I would kindly ask you to install a more recent Vim version. I hope that will work for you.
Error detected while processing function vimtex#compiler#compile[6]..vimtex#compiler#start: line 17: E117: Unknown function: expandcmd E116: Invalid arguments for function 38
Hah, one more feature I've used that will need for bumped requirements. This one requires version 8.1.1510.
and here's when I try to view table of contents with
\lt
I get: …
This is another problem due to the ..
syntax.
Wow okay thanks much for the quick reply for all the detailed tips!
It does appear that I'm using that very old kernel (at least that's what uname -r
reveals) and I'm running Rocky8.
I had tried upgrading vim via package manager but saw that I already had the latest in the repos (which I understand now is also quite old.) I just built vim 9 from source and vimtex is working great! (Thanks for developing this awesome tool!)
The mupdf-x11 was just b/c that was the name of the mupdf binary and it seemed like vimtex couldn't find my mupdf by that name. I just changed the view method back to simply "mupdf" and then created a symlink:
/usr/local/bin/mupdf -> /usr/local/bin/mupdf-x11
(seems to be working fine now but not sure if there are more elegant suggestions)
The one thing I still can't figure out is that now I'm getting weird characters floating around in vim when editing tex files. Screenshot attached. They seem to go away if I remove vimtex (though I do still seem to get them when I close vi at the beginning of my terminal prompt....I also eliminate all other lines in my ~/.vimrc
again just to make sure)
I read some places that it may be related to my encoding variable in my .viminfo
but I'm not smart enough to know how to change that.
Any thoughts?
Wow okay thanks much for the quick reply for all the detailed tips!
No problem.
It does appear that I'm using that very old kernel (at least that's what
uname -r
reveals) and I'm running Rocky8.
I see; Wikipedia has a nice list of the version history. It seems Rocky 8.9 is still maintained, but I would strongly enourage you to update your distro! And if you do, you should consider to use a distro with more recent kernels.
I had tried upgrading vim via package manager but saw that I already had the latest in the repos (which I understand now is also quite old.) I just built vim 9 from source and vimtex is working great! (Thanks for developing this awesome tool!)
Great, glad to hear it!
The mupdf-x11 was just b/c that was the name of the mupdf binary and it seemed like vimtex couldn't find my mupdf by that name. I just changed the view method back to simply "mupdf" and then created a symlink:
/usr/local/bin/mupdf -> /usr/local/bin/mupdf-x11
(seems to be working fine now but not sure if there are more elegant suggestions)
I think symlinking is a very valid way to fix this.
The one thing I still can't figure out is that now I'm getting weird characters floating around in vim when editing tex files. Screenshot attached. They seem to go away if I remove vimtex (though I do still seem to get them when I close vi at the beginning of my terminal prompt....I also eliminate all other lines in my
~/.vimrc
again just to make sure)
I believe this is due to the conceal feature. VimTeX uses it to replace e.g. \alpha
with α
. If your terminal font doesn't support these symbols, then it will not work well.
You can disable the conceal feature entirely with let g:vimtex_syntax_conceal_disable = 1
. That should also help you to check if this is indeed the problem.
My goofy chars ended up being related to vim v9 and had nothing to do with vimtex.
issue #11728 on the vim github page
A lot of suggestions there but if anyone else runs into this, what worked for me was adding the following to my .vimrc
:
set keyprotocol=
let &term=&term
Thanks again for all the support.
Glad to hear you figured it out!
Description
I think I've done all the sanity checks. I'm running vim 8.0.1763, Latexmk 4.80 and I've read the help page on requirements.
I installed via vim-plug and when I run
:PlugInstall
I get a successful message. (To isolate issues/conflcits I've remove all other packages) I've also removed everything from my~/.vimrc
except:When I first open a .tex file with vim, I get a bunch of invalid expression and undefined errors:
If I continue past the errors I can use vim regularly and I've found that some features of vim-tex actaully do work (like syntax folding, which I've enabled) or view quick fix errors.
However, most features appear broke (examples below). I'm guessing I'm just doing something dumb/obvious but can't figure it out after a week or two of trying. This seems like such a great tool (and way more sophisticated than my current approach of a bash script,
entr
and andpkill -HUP mupdf
) and I'd love to be able to use it.Many thanks for any ideas or suggestions to resolve this.
Here's what I get If it try to compile with
\ll
and here's when I try to view table of contents with
\lt
I get:Steps to reproduce
No response
Expected behavior
No response
Actual behavior
No response
Do you use a latexmkrc file?
No
VimtexInfo