New answers tagged

1

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: set nocursorline set nocursorcolumn 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 ...


2

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,...


0

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 ...


1

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.


0

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 augroup end Which defines autocommand group and an ...


3

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\."


1

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; autocomplete; startup time; give it a try!


1

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 ...


2

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.


2

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 ...


2

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 ...


1

From :help 're': *'regexpengine'* *'re'* 'regexpengine' 're' number (default 0) global 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 ...


Top 50 recent answers are included