Debugging: debugging syntax files

This commit is contained in:
Marco Hinz 2016-01-09 14:59:54 +01:00
parent 756538ed47
commit fba68810f6
2 changed files with 21 additions and 0 deletions

View File

@ -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) - Tips: [Saner command-line history](README.md#saner-command-line-history)
- Debugging: [Verbosity](README.md#verbosity) - Debugging: [Verbosity](README.md#verbosity)
- Debugging: [Debugging Vim scripts](README.md#debugging-vim-scripts) - 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 small files is slow](README.md#editing-small-files-is-slow)
- Quirks: [Editing huge files is slow](README.md#editing-huge-files-is-slow) - Quirks: [Editing huge files is slow](README.md#editing-huge-files-is-slow)
- Miscellaneous: [Easter eggs](README.md#easter-eggs) - Miscellaneous: [Easter eggs](README.md#easter-eggs)

View File

@ -52,6 +52,7 @@ added every day. Things about to be added can be found here:
- [Profiling at runtime](#profiling-at-runtime) - [Profiling at runtime](#profiling-at-runtime)
- [Verbosity](#verbosity) - [Verbosity](#verbosity)
- [Debugging Vim scripts](#debugging-vim-scripts) - [Debugging Vim scripts](#debugging-vim-scripts)
- [Debugging syntax files](#debugging-syntax-files)
#### [Miscellaneous](#miscellaneous-1) #### [Miscellaneous](#miscellaneous-1)
@ -999,6 +1000,25 @@ this case.
`:debug` can be used in combination with the [verbose](#verbosity) option. `: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 <c-l> 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 ## Miscellaneous
#### Vim distributions #### Vim distributions