diff --git a/CHANGELOG.md b/CHANGELOG.md index 70afea2..907df85 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) +- 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 b1fe9bb..793b629 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ added every day. Things about to be added can be found here: #### [Quirks](#quirks-1) +- [Editing small files is slow](#editing-small-files-is-slow) - [Editing huge files is slow](#editing-huge-files-is-slow) - [Newline used for NUL](#newline-used-for-nul) - [Bracketed paste (or why do I have to set 'paste' all the time?)](#bracketed-paste-or-why-do-i-have-to-set-paste-all-the-time) @@ -1047,6 +1048,23 @@ looking at some distributions: ## Quirks +#### Editing small files is slow + +Most of the time this is caused by syntax files using complex regular +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 +list to ease slowdowns: + +| Option | Why? | +|--------|------| +| `:set nocursorline` | This makes screen redrawing quite a bit slower. | +| `:set norelativenumber` | Constantly computing the relative numbers is expensive. | +| `:set foldmethod=marker` | If the syntax file itself is slow already, `foldmethod=syntax` makes it even worse. | +| `:set synmaxcol=200` | Due to internal representation, Vim has problems with long lines in general. Only syntax highlight till column 200. | +| `:NoMatchParen` | Uses regular expressions to find the accompanying parenthesis. | + #### Editing huge files is slow The biggest issue with big files is, that Vim reads the whole file at once. This