context.vim icon indicating copy to clipboard operation
context.vim copied to clipboard

context.vim works slowly when writing vue file

Open Ahacad opened this issue 4 years ago • 1 comments

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.

Ahacad avatar Mar 23 '21 14:03 Ahacad

@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

Hippo0o avatar Aug 06 '23 14:08 Hippo0o