From c3cd43413a23b7534fc0d8bdbdc28d49174ccfc3 Mon Sep 17 00:00:00 2001 From: NGC13009 Date: Thu, 1 May 2025 19:50:52 +0800 Subject: [PATCH 1/2] 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 6fd498e8d1..c982579d31 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 From ec58d64dd5f7f5066237203c9e782a26bb399930 Mon Sep 17 00:00:00 2001 From: NGC13009 Date: Tue, 6 May 2025 21:02:48 +0800 Subject: [PATCH 2/2] remove redundant link --- docs/docs/customize/deep-dives/autocomplete.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/docs/customize/deep-dives/autocomplete.mdx b/docs/docs/customize/deep-dives/autocomplete.mdx index c982579d31..e6dc62f426 100644 --- a/docs/docs/customize/deep-dives/autocomplete.mdx +++ b/docs/docs/customize/deep-dives/autocomplete.mdx @@ -134,9 +134,7 @@ Yes, in VS Code, if you don't want to be shown suggestions automatically you can ### Is there a shortcut to accept one line at a time? -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: +This is a built-in feature of VS Code, but it's just a bit hidden. 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`.