CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 21:30:31 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/vim/vim.git
etag: W/"92b1bd00aaff06c5162afea530d24947"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=PUTX5KBGGviDE1yOWaxVfQM0fj0DMaNUgdZjOEnnHkaguVmg48gYrmmeN45cvWEU0o%2BJ8b%2BfWg69%2FANLknEgvwNZjvW9aK%2B2Ny1zTdql1c%2BaWk25%2BvQhQ1qthJUnlt0mxQZypwEE6ggEKPusLn7qg0j8bc%2Br1wjaE6ppEH8BlYUiYwrSWgj25O7rSvtjr6Q06Fh5UUjaY5S%2B1bAyyiQQUWZSaia7YhFaOJTK4jxTlVdU1W6c1ocz0MjMY1XOYwU7u5go5rHwTfqdCNOMyLjn3A%3D%3D--IGAEdYD5WcufhjCE--Zrj73chsUZjkokXvI4s%2Fjg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1227857851.1753651830; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 21:30:30 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 21:30:30 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: CBC6:29FD1F:11A4CBA:1735257:68869A76
patch 9.1.1590: cannot perform autocompletion · vim/vim@af9a7a0 · GitHub
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit af9a7a0
patch 9.1.1590: cannot perform autocompletion
Problem: cannot perform autocompletion
Solution: Add the 'autocomplete' option value
(Girish Palya)
This change introduces the 'autocomplete' ('ac') boolean option to
enable automatic popup menu completion during insert mode. When enabled,
Vim shows a completion menu as you type, similar to pressing |i\_CTRL-N|
manually. The items are collected from sources defined in the
'complete' option.
To ensure responsiveness, this feature uses a time-sliced strategy:
- Sources earlier in the 'complete' list are given more time.
- If a source exceeds its allocated timeout, it is interrupted.
- The next source is then started with a reduced timeout (exponentially
decayed).
- A small minimum ensures every source still gets a brief chance to
contribute.
The feature is fully compatible with other |i_CTRL-X| completion modes,
which can temporarily suspend automatic completion when triggered.
See :help 'autocomplete' and :help ins-autocompletion for more details.
To try it out, use :set ac
You should see a popup menu appear automatically with suggestions. This
works seamlessly across:
- Large files (multi-gigabyte size)
- Massive codebases (:argadd thousands of .c or .h files)
- Large dictionaries via the `k` option
- Slow or blocking LSP servers or user-defined 'completefunc'
Despite potential slowness in sources, the menu remains fast,
responsive, and useful.
Compatibility: This mode is fully compatible with existing completion
methods. You can still invoke any CTRL-X based completion (e.g.,
CTRL-X CTRL-F for filenames) at any time (CTRL-X temporarily
suspends 'autocomplete'). To specifically use i_CTRL-N, dismiss the
current popup by pressing CTRL-E first.
---
How it works
To keep completion snappy under all conditions, autocompletion uses a
decaying time-sliced algorithm:
- Starts with an initial timeout (80ms).
- If a source does not complete within the timeout, it's interrupted and
the timeout is halved for the next source.
- This continues recursively until a minimum timeout (5ms) is reached.
- All sources are given a chance, but slower ones are de-prioritized
quickly.
Most of the time, matches are computed well within the initial window.
---
Implementation details
- Completion logic is mostly triggered in `edit.c` and handled in
insexpand.c.
- Uses existing inc_compl_check_keys() mechanism, so no new polling
hooks are needed.
- The completion system already checks for user input periodically; it
now also checks for timer expiry.
---
Design notes
- The menu doesn't continuously update after it's shown to prevent
visual distraction (due to resizing) and ensure the internal list
stays synchronized with the displayed menu.
- The 'complete' option determines priority—sources listed earlier get
more time.
- The exponential time-decay mechanism prevents indefinite collection,
contributing to low CPU usage and a minimal memory footprint.
- Timeout values are intentionally not configurable—this system is
optimized to "just work" out of the box. If autocompletion feels slow,
it typically indicates a deeper performance bottleneck (e.g., a slow
custom function not using `complete_check()`) rather than a
configuration issue.
---
Performance
Based on testing, the total roundtrip time for completion is generally
under 200ms. For common usage, it often responds in under 50ms on an
average laptop, which falls within the "feels instantaneous" category
(sub-100ms) for perceived user experience.
| Upper Bound (ms) | Perceived UX
|----------------- |-------------
| <100 ms | Excellent; instantaneous
| <200 ms | Good; snappy
| >300 ms | Noticeable lag
| >500 ms | Sluggish/Broken
---
Why this belongs in core:
- Minimal and focused implementation, tightly integrated with existing
Insert-mode completion logic.
- Zero reliance on autocommands and external scripting.
- Makes full use of Vim’s highly composable 'complete' infrastructure
while avoiding the complexity of plugin-based solutions.
- Gives users C native autocompletion with excellent responsiveness and
no configuration overhead.
- Adds a key UX functionality in a simple, performant, and Vim-like way.
closes: #17812
Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>1 parent 44309b9 commit af9a7a0Copy full SHA for af9a7a0
File tree
Expand file treeCollapse file tree
17 files changed
+704
-127
lines changedFilter options
- runtime
- doc
- syntax
- src
- po
- proto
- testdir
Expand file treeCollapse file tree
17 files changed
+704
-127
lines changed+17-1Lines changed: 17 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
1133 | 1133 |
| |
1134 | 1134 |
| |
1135 | 1135 |
| |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1136 | 1152 |
| |
1137 | 1153 |
| |
1138 | 1154 |
| |
|
+14-4Lines changed: 14 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
911 | 911 |
| |
912 | 912 |
| |
913 | 913 |
| |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
914 | 921 |
| |
915 | 922 |
| |
916 | 923 |
| |
| |||
2129 | 2136 |
| |
2130 | 2137 |
| |
2131 | 2138 |
| |
2132 |
| - | |
2133 |
| - | |
2134 |
| - | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
2135 | 2142 |
| |
2136 | 2143 |
| |
2137 | 2144 |
| |
| |||
2278 | 2285 |
| |
2279 | 2286 |
| |
2280 | 2287 |
| |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
2281 | 2291 |
| |
2282 | 2292 |
| |
2283 | 2293 |
| |
|
+2-1Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
607 | 607 |
| |
608 | 608 |
| |
609 | 609 |
| |
| 610 | + | |
610 | 611 |
| |
611 | 612 |
| |
612 | 613 |
| |
|
+5Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| 44 | + | |
44 | 45 |
| |
45 | 46 |
| |
46 | 47 |
| |
| |||
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
| 66 | + | |
65 | 67 |
| |
66 | 68 |
| |
67 | 69 |
| |
| |||
555 | 557 |
| |
556 | 558 |
| |
557 | 559 |
| |
| 560 | + | |
558 | 561 |
| |
559 | 562 |
| |
560 | 563 |
| |
| |||
571 | 574 |
| |
572 | 575 |
| |
573 | 576 |
| |
| 577 | + | |
574 | 578 |
| |
575 | 579 |
| |
576 | 580 |
| |
| |||
8585 | 8589 |
| |
8586 | 8590 |
| |
8587 | 8591 |
| |
| 8592 | + | |
8588 | 8593 |
| |
8589 | 8594 |
| |
8590 | 8595 |
| |
|
+3-1Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
41604 | 41604 |
| |
41605 | 41605 |
| |
41606 | 41606 |
| |
| 41607 | + | |
41607 | 41608 |
| |
41608 | 41609 |
| |
41609 | 41610 |
| |
| |||
41809 | 41810 |
| |
41810 | 41811 |
| |
41811 | 41812 |
| |
| 41813 | + | |
41812 | 41814 |
| |
41813 | 41815 |
| |
41814 | 41816 |
| |
|
+5-3Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| |||
873 | 873 |
| |
874 | 874 |
| |
875 | 875 |
| |
876 |
| - | |
877 |
| - | |
878 | 876 |
| |
| 877 | + | |
| 878 | + | |
879 | 879 |
| |
880 | 880 |
| |
881 | 881 |
| |
882 | 882 |
| |
| 883 | + | |
| 884 | + | |
883 | 885 |
| |
884 | 886 |
| |
885 | 887 |
| |
|
You can’t perform that action at this time.
0 commit comments