wellle / context.vim

Vim plugin that shows the context of the currently visible buffer contents
MIT License
1.27k stars 23 forks source link

context.vim works slowly when writing vue file #102

Open Ahacad opened 3 years ago

Ahacad commented 3 years ago

Hi, I am a frontend developer using context.vim to write some vue projects. I think this context idea is really awesome, however, the performance is too bad. I can clearly see flashing on the screen, and I can barely write any code when moving up and down.

Now I decide to get away from context.vim due to the performance problem, If you could solve it, I would definitely be back.

Hippo0o commented 1 year ago

@Ahacad vue is generally slower than other filetypes in my experience.

My solution for this is not using CursorMoved and WinScrolled autocmds and defining the other default ones manually. Just make sure that your CursorHold updatetime isnt set too high.

let g:context_add_autocmds = 0
augroup context.vim
    autocmd!
    autocmd VimEnter     * ContextActivate
    autocmd BufAdd       * call context#update('BufAdd')
    autocmd BufEnter     * call context#update('BufEnter')
    " autocmd CursorMoved  * call context#update('CursorMoved')
    autocmd VimResized   * call context#update('VimResized')
    autocmd CursorHold   * call context#update('CursorHold')
    autocmd User GitGutter call context#update('GitGutter')
    autocmd OptionSet number,relativenumber,numberwidth,signcolumn,tabstop,list
                \          call context#update('OptionSet')

    " if exists('##WinScrolled')
    "    autocmd WinScrolled * call context#update('WinScrolled')
    " endif
augroup END