diff --git a/CHANGELOG.md b/CHANGELOG.md index 907df85..443d3bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. - Tips: [Saner command-line history](README.md#saner-command-line-history) - Debugging: [Verbosity](README.md#verbosity) - Debugging: [Debugging Vim scripts](README.md#debugging-vim-scripts) +- Debugging: [Debugging syntax files](README.md#debugging-syntax-files) - Quirks: [Editing small files is slow](README.md#editing-small-files-is-slow) - Quirks: [Editing huge files is slow](README.md#editing-huge-files-is-slow) - Miscellaneous: [Easter eggs](README.md#easter-eggs) diff --git a/README.md b/README.md index 793b629..a31a1ff 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ added every day. Things about to be added can be found here: - [Profiling at runtime](#profiling-at-runtime) - [Verbosity](#verbosity) - [Debugging Vim scripts](#debugging-vim-scripts) +- [Debugging syntax files](#debugging-syntax-files) #### [Miscellaneous](#miscellaneous-1) @@ -999,6 +1000,25 @@ this case. `:debug` can be used in combination with the [verbose](#verbosity) option. +#### Debugging syntax files + +Syntax files are often the cause for slowdowns due to wrong and/or complex +regular expressions. If the `+profile` feature is compiled in, Vim provides the +super useful `:syntime` command. + +```viml +:syntime on +" hit a few times to redraw the window which causes the syntax rules to get applied again +:syntime off +:syntime report +``` + +The output contains important metrics. E.g. you can see which regexp takes too +long and should be optimized or which regexps are used all the time but never +even match. + +See `:h :syntime`. + ## Miscellaneous #### Vim distributions