Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping ALt + Key is not working #4747

Closed
ginoblue opened this issue Apr 17, 2020 · 4 comments
Closed

Mapping ALt + Key is not working #4747

ginoblue opened this issue Apr 17, 2020 · 4 comments

Comments

@ginoblue
Copy link

As the title, it's my setting below, by the way, the before:["C-k"] is wroking nomrally
in setting.json
"vim.normal..." :{
"before":["A-k"],
"after":["C-i"],
}
Is there something other setting in vscode which i need to handle?

@sql-koala
Copy link
Contributor

Hi, afaik alt key mappings are not supported as of now:
#2713

For your special case, C-i is jump forward, right? If there is an equivalent vscode function, one could create a keybinding to that.

@lucastrvsn
Copy link

Hi, ALT key is not been mapped. I'm trying to map keys to move lines up and down with and but not working. When changes to and works as expected. Tried on Ubuntu and Windows 10, no success.

"vim.visualModeKeyBindingsNonRecursive": [
    {
      "before": ["<A-j>"],
      "commands": ["editor.action.moveLinesDownAction"]
    },
    {
      "before": ["<A-k>"],
      "commands": ["editor.action.moveLinesUpAction"]
    }
]

I don't get why its happening because in previous releases alt key is supported (#2713 (comment)). Maybe a bug is still occurring?

@berknam
Copy link
Contributor

berknam commented Jun 20, 2020

As far as I know there is currently no support for 'Alt' keys combinations. For now as a workaround you can change the keybindings directly in VSCode.

If you go to VSCode's 'Keyboard Shortcuts' (you can press Ctrl+Shift+P to open command palette then type 'Preferences: Open Keyboard Shortcuts (JSON)' to open the shortcuts file) and then you can add the following shortcuts:

    {
        "key": "alt+j",
        "command": "editor.action.moveLinesDownAction",
        "when": "editorTextFocus && !editorReadonly"
    },
    {
        "key": "alt+k",
        "command": "editor.action.moveLinesUpAction",
        "when": "editorTextFocus && !editorReadonly"
    },

This will allow you to also use 'Alt+k' and 'Alt+j' to move lines up and down respectively. And since this is native to VSCode it will work no matter what mode you are in.

@J-Fields
Copy link
Member

J-Fields commented Mar 5, 2021

Closing as duplicate of #2713

@J-Fields J-Fields closed this as completed Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants