请问VSpaceCode有详细的教程或者配置可供参考吗?

本人主要使用Spacemacs进行python编程,在不能联网的Windows电脑中Spacemacs迟迟不能达到正常的补全效果(联网Windows电脑通过lsp-bridge与lsp-pyright都实现了)。

近期看到VSCode中的VSpaceCode插件能基本实现Spacemacs功能就尝试,但安装后不知为什么只实现了vim插件,按下SPC只会向右移一个字符。Spacemacs中的"按下 SPC f f打开文件选择器"没有实现也不知道怎么实现,参考了VSpaceCode 使用教程-CSDN博客 ,配置如下图(最后三行的字体字号能生效)。

应该怎么实现Spacemacs类似的功能?我看VSpaceCode的页面https://gitcode.com/gh_mirrors/vs/VSpaceCode 也没有找到详细的使用教程。请问各位大佬在哪有比较详细的学习资料吗?

可以参考我这个gist试一下,我目前用的就是VSpaceCode插件

我默认就有的呢, 不需要额外配置。

你可以先试试默认配置是否生效,然后再删减,没必要自己重头写

F1 打开命令面板,搜索 VSpaceCode, 可以找到几条生成 config 的指令,运行后会在你的 settings 和 keybindings 里添加他的默认配置

请问您的gist在哪?有没有VSpaceCode的配置文件供参考,谢谢

谢谢,按您说的F1打开了配置文件,目前两个配置文件如下图,按SPC还是向右移动一个字符,请问是配置文件被破坏了吗?

我看Installation | VSpaceCode 的说明“ you only need to update keybindings.json , settings.json doesn’t need to be updated.” VSpaceCode快捷键是不是应该在keybindings.json中配置?这个配置文件中已经有了SPACE的设置,请问为什么normal模式下按SPC还是向右移动一个字符,就像是hjkl中的l一样?

方便将您keybindings.jsonsettings.json这两个文件的全文共享给我,我复制过来看看是否正常吗? 谢谢

把你settings.json和keybindings.json这些按键的设置都删了,重新安装一遍就好了。本来就不需要任何设置,设置之后反而可能有冲突了。

谢谢您的建议。我将这两个文件内容清空了,然后卸载VSpaceCode,再重启VSCode,安装VSpaceCode,现在settings.json依然是空的,keybindings.json应该是初始化状态吧,按SPC依然是向右移动一个字符。

linux用户表示俩文件跟你都不一样,其实你这种情况最好去报个issue,如果安装方式都没有问题,那就出bug了。

看到这个帖子,我由衷感觉到我们论坛和Emacser是多么的“兼容并包” 01

要不加个vim的channel,把它们也拉进来吧

(教父脸:你们讨论VSCode也就罢了,你们都不愿意配个Emacs keybindings,居然在实现Vim模式)

bro,这样,你把 settings 和 keybindings 都备份到其他地方,然后 F1 运行 VSpaceCode: Configure Default Settings and Keybindings,也就是从零配置试试

vscode 有缓存,卸载重装插件后不会重新弹出 VSpaceCode 那个【配置提示页】

得手动调 VSpaceCode: Configure Default Settings and Keybindings 生成配置

谢谢您的建议。 我将所有内容删除后,再打开设置文件,又会自动恢复原样。 后来试了只删除最上面一段“space”的设置并保存,再打开就不会恢复初始状态,就像下图,现在看起来正常了,按两次spc相当于F1,spc f f 会转到打开文件。 不知道我安装后的默认配置为什么会有2个“space”设置(之前回复中的截图有显示),目前还有2个tab设置。

现在keybindings.json完整的配置是这样的:

[
	{
		"key": "space",
		"command": "vspacecode.space",
		"when": "sideBarFocus && !inputFocus && !whichkeyActive"
	},
	{
		"key": "tab",
		"command": "extension.vim_tab",
		"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'"
	},
	{
		"key": "tab",
		"command": "-extension.vim_tab",
		"when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
	},
	{
		"key": "x",
		"command": "magit.discard-at-point",
		"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
	},
	{
		"key": "k",
		"command": "-magit.discard-at-point"
	},
	{
		"key": "-",
		"command": "magit.reverse-at-point",
		"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
	},
	{
		"key": "v",
		"command": "-magit.reverse-at-point"
	},
	{
		"key": "shift+-",
		"command": "magit.reverting",
		"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
	},
	{
		"key": "shift+v",
		"command": "-magit.reverting"
	},
	{
		"key": "shift+o",
		"command": "magit.resetting",
		"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
	},
	{
		"key": "shift+x",
		"command": "-magit.resetting"
	},
	{
		"key": "x",
		"command": "-magit.reset-mixed"
	},
	{
		"key": "ctrl+u x",
		"command": "-magit.reset-hard"
	},
	{
		"key": "y",
		"command": "-magit.show-refs"
	},
	{
		"key": "y",
		"command": "vspacecode.showMagitRefMenu",
		"when": "editorTextFocus && editorLangId == 'magit' && vim.mode == 'Normal'"
	},
	{
		"key": "g",
		"command": "-magit.refresh",
		"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
	},
	{
		"key": "g",
		"command": "vspacecode.showMagitRefreshMenu",
		"when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/"
	},
	{
		"key": "ctrl+j",
		"command": "workbench.action.quickOpenSelectNext",
		"when": "inQuickOpen"
	},
	{
		"key": "ctrl+k",
		"command": "workbench.action.quickOpenSelectPrevious",
		"when": "inQuickOpen"
	},
	{
		"key": "ctrl+j",
		"command": "selectNextSuggestion",
		"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
	},
	{
		"key": "ctrl+k",
		"command": "selectPrevSuggestion",
		"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
	},
	{
		"key": "ctrl+l",
		"command": "acceptSelectedSuggestion",
		"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus"
	},
	{
		"key": "ctrl+j",
		"command": "showNextParameterHint",
		"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
	},
	{
		"key": "ctrl+k",
		"command": "showPrevParameterHint",
		"when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible"
	},
	{
		"key": "ctrl+j",
		"command": "selectNextCodeAction",
		"when": "codeActionMenuVisible"
	},
	{
		"key": "ctrl+k",
		"command": "selectPrevCodeAction",
		"when": "codeActionMenuVisible"
	},
	{
		"key": "ctrl+l",
		"command": "acceptSelectedCodeAction",
		"when": "codeActionMenuVisible"
	},
	{
		"key": "ctrl+h",
		"command": "file-browser.stepOut",
		"when": "inFileBrowser"
	},
	{
		"key": "ctrl+l",
		"command": "file-browser.stepIn",
		"when": "inFileBrowser"
	},
	{
		"key": "space",
		"command": "vspacecode.space",
		"when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus"
	}
]

settings.json自动变成这样了:

{
    "vim.easymotion": true,
    "vim.useSystemClipboard": true,
    "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": [
                "<space>"
            ],
            "commands": [
                "vspacecode.space"
            ]
        },
        {
            "before": [
                ","
            ],
            "commands": [
                "vspacecode.space",
                {
                    "command": "whichkey.triggerKey",
                    "args": "m"
                }
            ]
        }
    ],
    "vim.visualModeKeyBindingsNonRecursive": [
        {
            "before": [
                "<space>"
            ],
            "commands": [
                "vspacecode.space"
            ]
        },
        {
            "before": [
                ","
            ],
            "commands": [
                "vspacecode.space",
                {
                    "command": "whichkey.triggerKey",
                    "args": "m"
                }
            ]
        },
        {
            "before": [
                ">"
            ],
            "commands": [
                "editor.action.indentLines"
            ]
        },
        {
            "before": [
                "<"
            ],
            "commands": [
                "editor.action.outdentLines"
            ]
        }
    ]
}

你们 VSC/Vim 人都没有自己的论坛吗? :new_moon_with_face:

1 个赞

这就很灵性 :rofl:

别别别,我没有别的意思,我也用用vim/neovim的 :see_no_evil:

有两个 space 配置其实是正常的,不同场景需要分别配置。你删了一个,在标签页关完之后的空页面估计就没法用 SPC+SPC 弹出命令窗口了

你要找的默认配置其实就在官方文档里啦…

The settings.jsonc and keybindings.jsonc in the repo contains the configurations needed. You can merge them manually to your user’s settings.json and keybindings.json.

Spacemacs 补全应该不用联网的。

刚装了下 VSpaceCode,默认配置,工作正常。

VSpaceCode 不是学 Spacemacs 么,跟 VIM 没关系,反倒是 Spacevim / AstroVim / NVChat / LazyVim / LunarVim 全都在学 Spacemacs,还有新秀 Doom Emacs。

Vim 插件、Emacs 插件攻入 VSCode,挺好!

1 个赞