Vim EasyMotion for VS Code not activating
Asked Answered
B

3

6

Does anyone use Vim with VSCode? For some reason, my <leader> key (space), does not activate the easy-motion plugin (I made sure it is enabled in the settings), but just moves the cursor to the right once. I am new to VS Code, am I missing something? I still haven't figured out how .vimrc works with VS Code.

TIA!

Bailee answered 6/8, 2020 at 19:49 Comment(2)
Looks like your .vimrc file is conflicting with the vim plugin, first disable use of vimrc and then try to use easymotion.Deepdyed
@Deepdyed tried this, thank you. I believe VS Code does not emulate vim properly, so I might as well fully switch back to the regular terminal vim. Thank you tho! I will still appreciate any useful advice :)Bailee
L
15

It's not nessesary to use .vimrc file for vscode unless you want some customized behaviors.

  • Make sure you've enbaled the easymotion in vsvim settings:

    "vim.easymotion": true

    (in your settings.json file)

  • When it comes to VSCode, easymotion will be triggered by double press <leader> key.
    Different from Terminal Vim, for example: (in your case <leader> is set to space)

    space + space + 2 + s

    after you press the above keys, your status bar should look like this.

Hope it would help you get into Visual Studio Code quickly.

Libb answered 20/8, 2020 at 8:1 Comment(1)
Thank you for mentioning the double press on leader. I was confused as to why EasyMotion wasn't working when leader works fine in consoles. VS Code quirks! \o/Jamiejamieson
B
11

As far as I know, vim mode in VS code isn't configured by .vimrc file, instead, it's configured by setting.json. You can find how to configure them in this README.md.

Check that:

  • "vim.leader"is set to <Space>
  • go to preference -> Keyboard shortcut in VS code. Make sure that you did not customize any command to any shortcut starting with <space>. (I made this mistake before)
  • the timeout length of the leader key is pretty short, make sure you press, let's say, 'w' key right after <leader><leader>

I hope this would help

Berzelius answered 12/8, 2020 at 9:47 Comment(3)
Another thing I needed to do was disable "Add period with double-space" on OSX so that the <leader><leader> combo registered smoothly.Wilful
@tiki: tysm for it as i was confused why easymotion was not being triggered smoothlyKnitter
Same here, I was searching endlessly for why there was a bizarre delay when using <space> as my leader key!Going
W
3

This has been bugging me forever. I just realized that my mac keyboard settings have a “Add period with double-space” configuration.

Disabling this fixed the issue for me.

'System Preferences' -> 'keyboard' -> 'input sources' -> toggle off 'Add period with double-space'

MacOs 13.x

Wax answered 29/9, 2023 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.