mirror of
https://gitlab.com/wsdjeg/vim-galore-zh_cn.git
synced 2026-04-25 17:09:44 +08:00
start to translate chapters requested.
This commit is contained in:
19
chapter/Debugging-Syntax-Files.md
Executable file
19
chapter/Debugging-Syntax-Files.md
Executable file
@@ -0,0 +1,19 @@
|
||||
## Debugging syntax files
|
||||
|
||||
Syntax files are often the cause for slowdowns due to wrong and/or complex
|
||||
regular expressions. If the `+profile` [feature](#what-kind-of-vim-am-i-running)
|
||||
is compiled in, Vim provides the super useful `:syntime` command.
|
||||
|
||||
```vim
|
||||
: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`.
|
||||
|
||||
Reference in New Issue
Block a user