groenewege/vim-less

Vim get slow over time

kafeltz opened this issue · 4 comments

After minutes typing less files, vim get super slow. Up/Down movement take too much time. (1 second to move cursor 1 line up/down)

I have to :set syntax= and then again :set syntax=less to reset and all get normal again.

Any ideias what it could be? I'm having problem to track what is the cause.

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 12 2016 13:38:39)
MacOS X (unix) version
Compiled by ismael@iMac-de-Ismael.local
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset -gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
+clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist -perl +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak -python +vreplace
-cscope +lispindent -python3 +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con -lua +rightleft +writebackup
+diff +menu -ruby -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra -mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Cocoa

This is odd. Can you check autocmds setup for CursorHold / CursorHoldI ?

Well, after making some test, this is only happening in vim in MAC using (both default term and iTerm2). At home using ubuntu/mint it was lighting fast.

Anyway, the issue is not related to CursorHold[i]. It's something about this:

:autocmd matchparen

matchparen WinEnter
* call s:Highlight_Matching_Pair()
matchparen CursorMoved
* call s:Highlight_Matching_Pair()
matchparen CursorMovedI
* call s:Highlight_Matching_Pair()
matchparen TextChanged
* call s:Highlight_Matching_Pair()
matchparen TextChangedI
* call s:Highlight_Matching_Pair()

When disabled (for testing) it becomes smooth again.

Is not vim-less issue.

There are some people complaining about the same thing in other repo:
LaTeX-Box-Team/LaTeX-Box#163
preservim/tagbar#107

Or just type in google: vim Highlight_Matching_Pair slow.

Thx anyway, I will take a look to a proper solution.

I'm still having this annoying issue and it's something related to the RegexEngine.
Taking a look at the: http://stackoverflow.com/questions/16902317/vim-slow-with-ruby-syntax-highlighting

I can confirm that set lazyredraw does improve the speed from annoying lag to minor lag.

Setting set regexpengine=0 it does improve the speed to vim normal (no lag feeled), but hightlight obviously stop working, but it shows where to look to fix the issue.

I know it's not vim-less plugin issue, i'm just documenting what I got so far.