mirror of
https://gitlab.com/wsdjeg/vim-galore-zh_cn.git
synced 2026-02-13 12:55:03 +08:00
finish translation.
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
## 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的运行较慢。如果Vim在编译的时候包含了`+profile` [feature](#what-kind-of-vim-am-i-running)特性,就可以给用户提供一个超级好用的`:syntime`命令。
|
||||
|
||||
```vim
|
||||
:syntime on
|
||||
" hit <c-l> a few times to redraw the window which causes the syntax rules to get applied again
|
||||
" 多次敲击<c-l>来重绘窗口,这样的话就会使得相应的语法规则被重新应用一次
|
||||
: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.
|
||||
请查阅`:h :syntime`。
|
||||
|
||||
See `:h :syntime`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user