Home > Enterprise >  When I type the letter f in VSCode Vim, it deletes the text
When I type the letter f in VSCode Vim, it deletes the text

Time:10-29

I installed the vim extension in vscode. I pressed i to enter in insert mode. I can type all the letters except f. It deletes the text. Is it supposed that d deletes the text, not f? Is this a bug or am I in the wrong vim mode? I use i for insert mode and Ctrl [ for returning to normal mode.

I searched for how to remap vim shortcuts to change the function of the letter f. I pressed Ctrl Shift P then opened Keyboard Shortcuts (JSON) but I did not find any vim shortcuts. I looked through the sortcuts list in the vscode vim marketplace but couldn't find a shortcut for the letter f. How can I change the letter f from deleting the text? I can not even write the letter f.

Edit: After searching, I found that I had messed up with the shortcuts in the keybindings.json without noticing. this shortcut that cause me the problem:

{
        "key": "f f",
        "command": "editor.action.deleteLines",
        "when": "textInputFocus && !editorReadonly"
 },

I don't know how I didn't notice that. I was focused on the vim's shortcuts, just typing Vim in the search, and looking for the shortcut that deletes the line. And in the end it wasn't in Vim shortcuts at all. I just deleted this shortcut and it works fine.

CodePudding user response:

I changed this shortcut without noticing. I made the letter f delete the lines.

{
        "key": "f f",
        "command": "editor.action.deleteLines",
        "when": "textInputFocus && !editorReadonly"
 },

Just delete this shortcut or change it to another key.

I think why I made this mistake is because when I went to preferences > keyboard shortcuts > then I typed vim in the search bar to see which shortcut deleted the line and ended up only checking vim shortcuts. But when I searched for the letter f, I found it was not in the list of vim shortcuts.

  • Related