Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:VimtexTocToggle not working inside the TOC buffer #2317

Closed
ChausseBenjamin opened this issue Jan 31, 2022 · 3 comments
Closed

:VimtexTocToggle not working inside the TOC buffer #2317

ChausseBenjamin opened this issue Jan 31, 2022 · 3 comments
Labels

Comments

@ChausseBenjamin
Copy link

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
lervag added a commit that referenced this issue Jan 31, 2022
@lervag
Copy link
Owner

lervag commented Jan 31, 2022

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).

I've added the command for the ToC window now - does that resolve your issue?

@lervag lervag closed this as completed Jan 31, 2022
@ChausseBenjamin
Copy link
Author

Yes Thank you!

@lervag
Copy link
Owner

lervag commented Feb 2, 2022

Glad to hear it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants