Syntax highlighting is done synchronously in vim, which is why it is slow when dealing with large files.
There's a few highlights you can deactivate to speed things up:
You can also set the minimum / maximum highlighted lines (:h :syn-sync-maxlines):
syntax sync minlines=200
syntax sync maxlines=500
There's a good ...
Syntax for large files is consistently atrociously slow (especially when the language is hugely recursive à la lisp or xml: C fares much better because it has generally has more consecutive structures than recursive ones). I find it best to turn it off when viewing large documents.
I don’t have anything technical to back this up (links, discussion, timings,...
This seems to be a bug in Microsoft Terminal](https://github.com/microsoft/terminal/issues/832) used in WSL.
The Windows Terminal doesn't support a feature called BCE but if Vim is configured to use an xterm style of terminal, it will try to use the feature and produce the artifacts you're currently seeing.
The bug has been fixed upstream,.but it looks ...
Try using ~/.vim/after/syntax/python.vim:
syn match pythonSelf "\<self\.\@="
hi pythonSelf cterm=bold
I used a slightly different syntax group so you could customize it more; you could also hi link it to another group if you wanted.
I can't see you use any colorschemes so
:highlight Comment ctermfg=Blue
at the end of your vimrc should work.
Note though, if you use colorscheme, then your highlight would be overridden.
It is possible to do the following:
augroup colorscheme_change | au!
au ColorScheme * :hi Comment ctermfg=blue
Which defines autocommand group and an ...
The easiest way is to use \ze to mark end of the match:
syn match mysqlTable2 "TBL_[A-Z_]\+"
syn match mysqlQualifier "TBL_[A-Z_]\+.\s\+[A-Z]\+" contains=mysqlTable
syn match mysqlTable "TBL_[A-Z_]\+" contained
syn match mysqlQualifier "[A-Z]\+\ze\."
I suggest you to disable syntax highlighting as default. It will change your mind about your needs of using it and will definilety improve every performance issue you had in vim:
insert in large files;
give it a try!
Here's a completely different, arguably even more hacky, but much simpler solution:
syntax keyword lam fn conceal cchar=λ containedin=ALL nextgroup=bda
execute "syntax match bda ' ' conceal cchar=\uff0e"
It relies on:
There always being a space after the fn keyword: we're matching this space as well as the fn.
Unicode support: we're replacing the space ...
I guess you have your code before filetype on (including runtime defaults.vim or anything else switching filetype on). But it must be placed after it.
Also, my personal advice is to set confirm and get rid of this stuff completely. Or use ZQ, or :q! and such.
UPD. As it turned out, the problem was due to using autocommands with mkview and loadview.
Option 1: Use :qa, :q!, or ZQ to quit. Then vim does not prompt for multiple files. On the other hand, it will also not alert for changes made to the current buffer.
Option 2: Always open multiple buffers in spits, or in tab pages. Change your bash alias to
alias vim='nvim -o'
or (for tab pages)
alias vim='nvim -p'
This doesn't solve the problem of ...
Here's a solution using a different technique to the two you suggested:
syntax match lambda /\_.\<fn\>/ containedin=ALL
syntax match lam /f/ containedin=lambda contained conceal cchar=λ
syntax match bda /n/ containedin=lambda contained conceal cchar=.
Syntax items which start in an earlier position in the buffer take priority over other items, so we ...
From :help 're':
'regexpengine' 're' number (default 0)
This selects the default regexp engine. |two-engines|
The possible values are:
0 automatic selection
1 old engine
2 NFA engine
Note that when using the NFA engine and the pattern contains ...