lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.45k stars 388 forks source link

Vimtex is not working with packer.nvim #2925

Closed Gen0vo closed 5 months ago

Gen0vo commented 5 months ago

Description

OS: debian 12.5

I installed packer.nvim from https://github.com/wbthomason/packer.nvim properly This is my lua file init.lua

vim.cmd([[
let maplocalleader = ";"
filetype plugin indent on
syntax enable
let g:vimtex_view_method = 'zathura'
]])
return require('packer').startup(function(use)
    use 'wbthomason/packer.nvim'
    use 'lervag/vimtex'
end)

My first problem is: By using :PackerInstall i do installed VimTeX However, every command from VimTeX is not recognized e.g. E492: Not an editor command: VimtexCompile Second problem is: With line 1 i can change my maplocalloader properly because :echo maplocalloader returns ; in this case, but i can't use it in Neovim I have zathura and latexmkon my PC

Steps to reproduce

  1. :source ~/.config/nvim/init.lua
  2. :PackerInstall to install VimTeX
  3. Pressing ;, and it does not work as maplocalloader
  4. :VimtexCompile returns E492

Expected behavior

Being able to use commands from VimTeX and compile

Actual behavior

No commands is working

Do you use a latexmkrc file?

No

VimtexInfo

-
Gen0vo commented 5 months ago

I'm sorry for being silly, i should open a file with .tex suffix.

lervag commented 5 months ago

This is my lua file init.lua

vim.cmd([[
let maplocalleader = ";"
filetype plugin indent on
syntax enable
let g:vimtex_view_method = 'zathura'
]])
return require('packer').startup(function(use)
  use 'wbthomason/packer.nvim'
  use 'lervag/vimtex'
end)

You can simplify that:

vim.g.maplocalleader = ';'
vim.g.vimtex_view_method = 'zathura'
return require('packer').startup(function(use)
    use 'wbthomason/packer.nvim'
    use 'lervag/vimtex'
end)

My first problem is: …

I'm sorry for being silly, i should open a file with .tex suffix.

No problem - we are all silly once in a while! ;)