From c3cd43413a23b7534fc0d8bdbdc28d49174ccfc3 Mon Sep 17 00:00:00 2001 From: NGC13009 Date: Thu, 1 May 2025 19:50:52 +0800 Subject: [PATCH] Update autocomplete.mdx Provide a better way of "### Is there a shortcut to accept one line at a time?" --- docs/docs/customize/deep-dives/autocomplete.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs/customize/deep-dives/autocomplete.mdx b/docs/docs/customize/deep-dives/autocomplete.mdx index 6fd498e8d..c982579d3 100644 --- a/docs/docs/customize/deep-dives/autocomplete.mdx +++ b/docs/docs/customize/deep-dives/autocomplete.mdx @@ -136,6 +136,14 @@ Yes, in VS Code, if you don't want to be shown suggestions automatically you can This is a built-in feature of VS Code, but it's just a bit hidden. See this great [StackOverflow answer](https://stackoverflow.com/questions/72228174/accept-line-by-line-from-autocompletion/78001122#78001122) for more details. +Or, follow these settings to reassign the keyboard shortcuts in VS Code: +1. Press `Ctrl+Shift+P`, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page. +2. Search for `editor.action.inlineSuggest.acceptNextLine`. +3. Set the key binding to `Tab`. +4. Set the trigger condition (when) to `inlineSuggestionVisible && !editorReadonly`. +This will make multi-line completion (including continue and from VS Code built-in or other plugin snippets) still work, and you will see multi-line completion. However, Tab will only fill in one line at a time. Any unnecessary code can be canceled with `Esc`. +If you need to apply all the code, just press `Tab` multiple times. + ### How to turn off autocomplete #### VS Code