Describe the bug
I normally use <space>f, <space>e, <space>g, etc. for a lot of my Vim keystrokes. I can not seem to get them to work in VSCodeVim though. I'm on Windows 10 and I used to use GVim
To Reproduce
In my settings.json:
{
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<space>","f"],
"commands": ["workbench.action.files.save"]
},
}
Does nothing :( I've tried as many variations as I can think
Near workaround but that isn't enough
Previously, with a similar problem trying to bind <S-space>, I found a workaround by putting the following in keybindings.json (and skipping VSCodeVim's settings.json altogether)
[
{
"key": "shift+space",
"command": "extension.vim_escape",
"when": "editorTextFocus"
},
]
I thought maybe I'd give up on settings.json altogether and just only use VSCode commands in the keybindings.json:
{
"key": "space f",
"command": "workbench.action.files.save",
"when": "editorTextFocus"
},
Works like a charm. Actually see's my <space>f and does something :|
Except, I realized to my horror, doesn't care what Vim mode he's in. So I can't type anything with a space followed by an f while in insert mode. RIP
Environment (please complete the following information):
Extension | Author (truncated) | Version
-- | -- | --
elixir-ls | Jak | 0.2.21
vim | vsc | 0.15.0
CPUs | Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz (4 x 2904)
-- | --
GPU Status | 2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onnative_gpu_memory_buffers: disabled_softwarerasterization: disabled_softwarevideo_decode: enabledvideo_encode: enabledvpx_decode: enabledwebgl: enabledwebgl2: enabled
Memory (System) | 31.89GB (24.54GB free)
Process Argv | C:\Program Files\Microsoft VS Code\Code.exe D:\Eric\Backup\ProgProjs\ElixirProjects\2018-07-13_BowlingWilliam\README.md
Screen Reader | no
VM | 0%
what about
"before": [" ","f"],
I use space chords, either set "vim.leader": " " or use the above suggestion. Using vim.leader lets you map things as "before": ["<leader>","[key]"], and so on.
I run into this issue too. I tried both "before": ["<space>", "w"] and "before": [" ", "f"] but neither of them worked.
Currently I am using vim.leader and it is fine, though.
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["
"after": ["v", "a","\""]
},
{
"before": ["
"after": ["v", "a","\""]
},
i using space or tab ,it's also can't work......it's vscode vim ' problem?
Same problem. I noticed that these keybindings work:
["z", "x"]
["g", "x"]
["f", "x"]
["t", "x"]
["q", "x"]
["r", "x"]
and these do not
[" ", "x"]
["x", "x"]
["c", "x"]
["v", "x"]
["b", "x"]
["n", "x"]
["y", "x"]
["h", "x"]
["d", "x"]
["s", "x"]
Looks like commands
cannot be first in mapping. On the other side
can be used.
Note: all above "before" arrays were tested with following "commands" definition:
{
"before": [" ", "x"],
"commands": ["editor.action.referenceSearch.trigger"]
}
Looks like serious flaw in VSCodeVim mapping mechanism
Most helpful comment
I run into this issue too. I tried both
"before": ["<space>", "w"]and"before": [" ", "f"]but neither of them worked.Currently I am using
vim.leaderand it is fine, though.