Skip to content

:VimtexTocToggle not working inside the TOC buffer #2317

@ChausseBenjamin

Description

@ChausseBenjamin

Description

When inside the VimtexTOC buffer, typing the :VimtexTocToggle commands returns the following error:

E492: Not an editor command: VimtexTocToggle

This is due to the fact that the VimtexTocToggle command is exclusive to tex filetypes (and it's derivatives such as rnw).
Since the toc buffer has no filetype( running :set filetype returned filetype=), I deduced this was the issue.

This is especially annoying when mapping a key to open and focus the TOC as it no longer works as a toggle
(ex: nnoremap <c-Tab> :VimtexTocToggle<CR><c-w>l).

Steps to reproduce

  1. Open a latex document
  2. Enter :VimtexTocToggle
  3. Enter <C-w>l (or j if your split is horizontal)
  4. Retype :VimtexTocToggle
  5. Enjoy!

Expected behavior

The Toc window disapears and the cursor returns to the previous tex buffer.

Actual behavior

ERROR:

E492: Not an editor command: VimtexTocToggle

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Artix Linux
  Vim version: NVIM v0.6.1
  Has clientserver: true
  Servername: /tmp/nvimFTkUx2/0

VimTeX project: main
  base: main.tex
  root: /home/master/Dropbox/A/scholar/sherbrooke/s2/mat901/devoir-1
  tex: /home/master/Dropbox/A/scholar/sherbrooke/s2/mat901/devoir-1/main.tex
  main parser: current file verified
  document class: article
  packages: babel blkarray document fontenc multicol tabularx titlepage titlesec
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions