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

Moving on long line is slow when set history #2775

Open
mr-superonion opened this issue Aug 19, 2023 · 1 comment
Open

Moving on long line is slow when set history #2775

mr-superonion opened this issue Aug 19, 2023 · 1 comment
Labels

Comments

@mr-superonion
Copy link

mr-superonion commented Aug 19, 2023

Description

If I use set history=20 (or any other numbers) in my init.vim file, the cursor moves very slow (with h and l) in .tex file if the current line is very long.
But if I comment out set history=20, the speed is very fast.
If I comment out the vimtex plugin and keep set history = 20, the speed is also fast.
Do you know why it happens?

minimal.vim

set history=20

call plug#begin('~/.vim/plugged')
    Plug 'lervag/vimtex'
call plug#end()

minimal.tex

\documentclass{minimal}
\begin{document}
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
\end{document}

Steps to reproduce

  1. nvim -u minimal.vim minimal.tex
  2. try moving the cursor with h and l on the long line in normal mode.
  3. you will find it is very slow.

Expected behavior

Fast moving speed.

Actual behavior

Slow Moving speed.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Linux 6.4.10-arch1-1
  Vim version: NVIM v0.9.1
  Has clientserver: true
  Servername: /run/user/1000/nvim.6369.0

VimTeX project: minimal
  base: minimal.tex
  root: /home/user/
  tex: /home/user/minimal.tex
  main parser: current file verified
  document class: minimal
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: Zathura
    xwin id: 0
  qf method: LaTeX logfile
@lervag
Copy link
Owner

lervag commented Aug 21, 2023

For me, the delay is not related to the history option - it would be a really strange thing if it was! But delay on long lines are instead caused by the feature for matching highlighted delimiters. You can disable it with let g:vimtex_matchparen_enabled = 0. Or, perhaps better: install vim-matchup as a much better provider of this feature (https://github.com/andymass/vim-matchup).

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