Slow files: rewrite

References #56.
This commit is contained in:
Marco Hinz 2016-01-13 11:05:46 +01:00
parent 9aa920be7e
commit 2f0679ab2f

View File

@ -1405,20 +1405,23 @@ This also shows why `~` is used to denote the home directory on Unix systems.
#### Editing small files is slow #### Editing small files is slow
Most of the time this is caused by syntax files using complex regular There are two things which can have a huge impact on performance:
expressions. Particulay the Ruby syntax file caused people to have slowdowns in
the past. (Also see [Debugging syntax files](#debugging-syntax-files).)
Moreover, some features tend to impact performance more than others. Check this 1. Complex **regular expressions**. Particular the Ruby syntax file caused
list to ease slowdowns: people to have slowdowns in the past. (Also see [Debugging syntax files](#debugging-syntax-files).)
2. **Screen redraws**. Some features force all lines to redraw.
| Option | Why? | | Typical culprit | Why? | Solution? |
|--------|------| |-----------------|------|-----------|
| `:set nocursorline` | This makes screen redrawing quite a bit slower. | | `:set cursorline` | Causes all lines to redraw. | `:set nocursorline` |
| `:set norelativenumber` | Constantly computing the relative numbers is expensive. | | `:set cursorcolumn` | Causes all lines to redraw. | `:set nocursorcolumn` |
| `:set foldmethod=marker` | If the syntax file itself is slow already, `foldmethod=syntax` makes it even worse. | | `:set relativenumber` | Causes all lines to redraw. | `:set norelativenumber` |
| `:set synmaxcol=200` | Due to internal representation, Vim has problems with long lines in general. Only syntax highlight till column 200. | | `:set foldmethod=syntax` | If the syntax file is slow already, this makes it even worse. | `:set foldmethod=manual`, `:set foldmethod=marker` or [FastFold](https://github.com/Konfekt/FastFold) |
| `:NoMatchParen` | Uses regular expressions to find the accompanying parenthesis. | | `:set synmaxcol=3000` | Due to internal representation, Vim has problems with long lines in general. Highlights columns till column 3000. | `:set synmaxcol=200` |
| matchparen.vim | Loaded by default. Uses regular expressions to find the accompanying parenthesis. | Disable plugin: `:h matchparen` |
**NOTE**: You only need to do this if you experience actual performance
drawbacks. In most cases using the things mentioned above is absolutely fine.
#### Editing huge files is slow #### Editing huge files is slow