咨询一个 vs code 的 vim 插件问题, 列编辑如何不自动切换模式

48 天前
 746970179
mac 下, 使用 vscode 的 vim 插件带来的 vim 模式
最难受的地方, 是非预期得从插入模式自动切换到 normal 模式
1 插入模式时, 使用 cmd+D 选中单词(我设置的选择当前单词, 如果重复按, 会选中下一个相同的单词), 会自动进入到 normal 模式
2 列编辑的时候, 打散(此时光标在行尾), shift 和方向键左(其他都行), 就会切换模式.

这个是我使用姿势不对吗?
网上搜索了蛮多, 结果没有能解决的
803 次点击
所在节点    Visual Studio Code
7 条回复
november
48 天前
没遇到这种情况。
试了下,在插入模式下,连续按 cmd + d ,会选择多个相同的单词,并且光标会自动跳到单词末尾,并且保持插入模式。
第 2 个不懂。
gitclose
48 天前
vscode vim 插件不卡吗?我在 win 、linux 和 mac 上 hjkl 很卡。换到 neovim 就好了。
746970179
47 天前
@gitclose 不卡的, 是不是和其他插件冲突了?
746970179
47 天前
@november 可能有设置过吧, 方便贴一下配置的 json 吗?
因为和 ctrl 有关联
jqtmviyu
47 天前
反正我是进入 multi cursor 模式, 然后 shift+i/ shift+a 编辑. 或者 di
gitclose
47 天前
@746970179 现在换到 neovim 插件了,也很流畅
november
47 天前
这是整个配置。

{
"editor.fontSize": 20,
"security.workspace.trust.untrustedFiles": "open",
"workbench.tree.indent": 22,
"vim.handleKeys": {
"<C-c>": false,
"<C-v>": false,
"<C-x>": false,
"<C-k>": false,
"<C-a>": false,
},
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["d"],
"after": ["\"", "_", "d"]
},
{
"before": ["D"],
"after": ["\"", "_", "D"]
},
{
"before": ["d", "d"],
"after": ["\"", "_", "d", "d"]
},
{
"before": [ "c", "a" ],
"after": [ "\"", "_", "c", "a" ]
},
// {
// "before": [ "c" ],
// "after": [ "\"", "_" ]
// },
{
"before": [ "c", "i" ],
"after": [ "\"", "_", "c", "i" ]
},
{
"before": [ "d", "a" ],
"after": [ "\"", "_", "d", "a" ]
},
],
"vim.visualModeKeyBindingsNonRecursive": [
{
"before": ["d"],
"after": ["\"", "_", "d"]
},
{
"before": ["D"],
"after": ["\"", "_", "D"]
},
// {
// "before": ["d", "d"],
// "after": ["\"", "_", "d", "d"]
// },
// {
// "before": ["<BS>"],
// "after": ["\"", "_", "d"]
// }
],
"vim.insertModeKeyBindings": [
{
"before": [
"up"
],
"commands": [
"cursorUp"
]
},
{
"before": [
"down"
],
"commands": [
"cursorDown"
]
},
{
"before": [
"left"
],
"commands": [
"cursorLeft"
]
},
{
"before": [
"right"
],
"commands": [
"cursorRight"
]
}
],
"vim.foldfix": true,
"vim.useSystemClipboard": true,
"editor.codeLensFontFamily": "\"Input\"",
"editor.renderWhitespace": "all",
"editor.trimAutoWhitespace": false,
"editor.showFoldingControls": "always",
"indenticator.color.dark": "#FFF10C",
"workbench.colorTheme": "Monokai",
"vim.autoSwitchInputMethod.defaultIM": "im.rime.inputmethod.Squirrel.Rime",
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/im-select",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/im-select {im}",
"editor.minimap.showSlider": "always",
"files.insertFinalNewline": true,
"search.showLineNumbers": true,
"files.trimTrailingWhitespace": true,
"editor.dragAndDrop": false,
"workbench.colorCustomizations": {
"[Monokai]": {
"tab.activeBorder":"#fff",
"tab.activeForeground": "#fff",
"editorGroupHeader.tabsBackground": "#44463a",
"tab.inactiveBackground": "#44463a",
"tab.border": "#44463a",
"tab.hoverBackground": "#4e4e4e",
},
},
"breadcrumbs.symbolPath": "off",
"workbench.list.horizontalScrolling": true,
"breadcrumbs.icons": false,
"remote.SSH.remoteServerListenOnSocket": true,
"remote.SSH.remotePlatform": {
"release": "linux",
"remote": "linux"
},
"bookmarks.saveBookmarksInProject": true,
"clipboard-manager.preview": false,
"clipboard-manager.maxClips": 500,
"clipboard-manager.snippet.enabled": false,
"liveServer.settings.donotShowInfoMsg": true,
"diffEditor.renderSideBySide": false,
"explorer.autoReveal": false,
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"vscode_custom_css.imports": [
"file:///home/eos/Documents/vscode-css/custom.css"
],
"eslint.enble": false,
"html.format.enable": false,
"explorer.confirmDelete": false,
"markdown.preview.linkify": false,
"bookmarks.sideBar.expanded": true,
"bookmarks.label.suggestion": "suggestWhenSelected",
"workbench.startupEditor": "none",
"editor.multiCursorModifier": "ctrlCmd",
"files.exclude": {
"**/.vscode": true
},
"editor.acceptSuggestionOnCommitCharacter": false,
"extensions.ignoreRecommendations": true,
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false,
"yaml": false,
"javascript": true
},
"typescript.updateImportsOnFileMove.enabled": "never",
"editor.tabSize": 2,
"editor.foldingStrategy": "indentation",
"html.format.indentHandlebars": true,
"html.format.indentInnerHtml": true,
"liveServer.settings.port": 3900,
"editor.suggest.preview": true,
"github.copilot.inlineSuggest.enable": true,
"editor.inlineSuggest.enabled": true,
"editor.inlineSuggest.allowQuickSuggestions": true,
"workbench.list.openMode": "doubleClick",
"search.quickOpen.includeHistory": false,
"workbench.editor.enablePreview": false,
"liveServer.settings.CustomBrowser": "chrome:PrivateMode",
"liveServer.settings.NoBrowser": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"window.restoreWindows": "none",
"clipboard-manager.maxClipboardSize": 100000,
"git.openRepositoryInParentFolders": "never",
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"codeium.enableConfig": {
"*": false
},
"[typescriptreact]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"explorer.compactFolders": false,
"remote.SSH.defaultForwardedPorts": [

],
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.unicodeHighlight.ambiguousCharacters": false,
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"editor.unicodeHighlight.invisibleCharacters": false,
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": "off"
},
"prettier.ignorePath": "",
"editor.fontFamily": "'Input', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"indentRainbow.indicatorStyle": "light",
"indenticator.inner.showIndentGuide": true,
"editor.accessibilitySupport": "off",
"git.countBadge": "tracked",
"git.untrackedChanges": "separate",
"workbench.editor.empty.hint": "hidden",
"window.commandCenter": false,
"files.hotExit": "onExitAndWindowClose",
"editor.lineNumbers": "relative",
"notebook.lineNumbers": "on",
"zenMode.hideLineNumbers": false,
"window.zoomLevel": 1,
"editor.mouseWheelScrollSensitivity": 3,
"workbench.list.mouseWheelScrollSensitivity": 3,
"typescript.preferences.includePackageJsonAutoImports": "on",
"typescript.tsdk": "./node_modules/typescript/lib",
"lldb.library": "/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB",
"lldb.launch.expressions": "native",
"apple-swift-format.configSearchPaths": [
".swift-format",
],
"diffEditor.ignoreTrimWhitespace": false
}

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1038856

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX