Re: sluggish processing of autocommands

2023-02-24 Fir de Conversatie Dave McCooey
Hi Jürgen, I had come up with a solution using self-modifying autocommands: augroup g1 au! augroup g2 au! augroup end function ShowExtraSpace() au! g1 sy match ExtraSpace / \+\ze\t\|\t\zs \+\|^ \+\|\s\+$/ containedin=ALL endfunction au g1 BufWinEnter,InsertLeave * call ShowExtraSpace() function

Re: sluggish processing of autocommands

2023-02-24 Fir de Conversatie 'Jürgen Krämer' via vim_dev
[Quoting re-ordered] Hi Dave, ben.k...@gmail.com schrieb am 22.02.2023 um 15:47: > On Tuesday, February 21, 2023 at 5:01:04 AM UTC-5 Dave McCooey wrote: >> >> Hello, >> >> I recently added the following autocommands to my _vimrc file: >> >> :hi ExtraWhiteSpace ctermbg=58 " Orange4

Re: sluggish processing of autocommands

2023-02-22 Fir de Conversatie ben.k...@gmail.com
That’s because your autocommand adds a new syntax match every time you enter insert mode. That probably increases syntax highlighting times and makes everything else sluggish. Don’t do that for the same reason we use autogroups. Just add the new match once per buffer (say, autocmd Syntax *). O

sluggish processing of autocommands

2023-02-21 Fir de Conversatie Dave McCooey
Hello, I recently added the following autocommands to my _vimrc file: :hi ExtraWhiteSpace ctermbg=58 " Orange4 = #5f5f00 autocmd BufWinEnter,InsertLeave * syntax match ExtraWhiteSpace / \+\ze\t\|\t\zs \+\|^ \+\|\s\+$/ containedin=ALL autocmd InsertEnter * syntax match ExtraWhiteSpace / \+\ze\t\|