Commit 95734c6
Add support for option g:gitgutter_grep_command
With this change, setting `g:gitgutter_grep_command` to ' | grep --color=never -e "^@@ "'`
greatly reduces startup time.
Before this change, `diff.vim` was a major bottleneck because it calls
`grep --help`. This is mostly unnecessary except in a few cases where
the user is running a nonstandard version of grep.
`vim --startuptime start.out large_file.sql` before:
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.026 000.026: --- VIM STARTING ---
[...]
068.463 003.645 003.500: sourcing /home/dchurch/.vim/plugin/gitgutter.vim
[...]
150.957 000.208 000.208: sourcing /home/dchurch/.vim/autoload/gitgutter.vim
151.294 000.196 000.196: sourcing /home/dchurch/.vim/autoload/gitgutter/utility.vim
165.059 012.619 012.619: sourcing /home/dchurch/.vim/autoload/gitgutter/diff.vim
236.901 000.188 000.188: sourcing /home/dchurch/.vim/autoload/gitgutter/hunk.vim
237.289 000.233 000.233: sourcing /home/dchurch/.vim/autoload/gitgutter/sign.vim
[...]
337.673 000.004: --- VIM STARTED ---
After change, and setting `g:gitgutter_grep_command = ' | grep --color=never -e "^@@ "'`:
000.026 000.026: --- VIM STARTING ---
[...]
064.873 002.713 002.591: sourcing /home/dchurch/.vim/plugin/gitgutter.vim
[...]
134.109 000.149 000.149: sourcing /home/dchurch/.vim/autoload/gitgutter.vim
134.337 000.147 000.147: sourcing /home/dchurch/.vim/autoload/gitgutter/utility.vim
135.411 000.232 000.232: sourcing /home/dchurch/.vim/autoload/gitgutter/diff.vim
187.831 000.180 000.180: sourcing /home/dchurch/.vim/autoload/gitgutter/hunk.vim
188.223 000.175 000.175: sourcing /home/dchurch/.vim/autoload/gitgutter/sign.vim
[...]
285.008 000.004: --- VIM STARTED ---1 parent 4510e9b commit 95734c6
3 files changed
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
274 | 282 | | |
275 | 283 | | |
276 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | | - | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
217 | 223 | | |
218 | 224 | | |
219 | 225 | | |
| |||
0 commit comments