feat: Automatically start in Insert mode for specific schemes #9854
+26
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR adds a new configuration option
vim.startInInsertModeSchemesthat allows users to specify document URI schemes that should automatically start in Insert mode.Use Cases
commentscheme. Users typically want to immediately start typing without pressingifirst.vscode-notebook-cellscheme. This provides a better experience when editing cells.gitlensscheme.Configuration Example
{
"vim.startInInsertModeSchemes": ["comment", "vscode-notebook-cell"]
}
Implementation Details
startInInsertModesetting is preserved and works alongside this new featureWhich issue(s) this PR fixes
This PR partially addresses #8782 by providing a flexible way for users to customize Vim behavior for specific contexts like Jupyter notebooks and comment editors.
While #8782 requested the ability to disable Vim for certain contexts, this PR takes a complementary approach: instead of disabling Vim entirely, it allows automatically entering Insert mode for specific URI schemes. This provides a better UX for contexts where users primarily want to type text (comments, notebook cells, etc.) while still maintaining Vim functionality when needed.
Special notes for your reviewer:
editor.document.uri.schemewhich is a stable VS Code API[], so existing users are not affectedtest/testConfiguration.tsto include the new propertyyarn test