V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
746970179
V2EX  ›  Visual Studio Code

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

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

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

    {
    "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
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   831 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 21:33 · PVG 05:33 · LAX 14:33 · JFK 17:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.