vim alt key behaviour #17454

Closed
opened 2026-01-31 05:42:58 +00:00 by claunia · 5 comments
Owner

Originally created by @seongbin on GitHub (May 10, 2022).

Windows Terminal version

1.11.3471.0

Windows build number

10.0.22000.613

Other Software

VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32)

Steps to reproduce

Windows Terminal JSON config

        {
            "command": "unbound",
            "keys": "alt+j"
        },
        {
            "command": "unbound",
            "keys": "alt+k"
        },

Vim key bindings

  1 nnoremap <A-k> :m .-2<CR>==
  2 inoremap <A-j> <Esc>:m .+1<CR>==gi
  3 inoremap <A-k> <Esc>:m .-2<CR>==gi
  4 vnoremap <A-j> :m '>+1<CR>gv=gv
  5 vnoremap <A-k> :m '<-2<CR>gv=gv

Expected Behavior

I tried to unbound ALT key in Windows Terminal by adding json config to move lines up or down in vim. Unfortunatlly, unbound feature looks like not working for me.

Actual Behavior

Normal j/k cursor move

Originally created by @seongbin on GitHub (May 10, 2022). ### Windows Terminal version 1.11.3471.0 ### Windows build number 10.0.22000.613 ### Other Software VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32) ### Steps to reproduce Windows Terminal JSON config ``` { "command": "unbound", "keys": "alt+j" }, { "command": "unbound", "keys": "alt+k" }, ``` Vim key bindings ``` 1 nnoremap <A-k> :m .-2<CR>== 2 inoremap <A-j> <Esc>:m .+1<CR>==gi 3 inoremap <A-k> <Esc>:m .-2<CR>==gi 4 vnoremap <A-j> :m '>+1<CR>gv=gv 5 vnoremap <A-k> :m '<-2<CR>gv=gv ``` ### Expected Behavior I tried to unbound ALT key in Windows Terminal by adding json config to move lines up or down in vim. Unfortunatlly, unbound feature looks like not working for me. ### Actual Behavior Normal j/k cursor move
claunia added the Needs-TriageIssue-BugNeeds-Tag-FixNeeds-Attention labels 2026-01-31 05:42:59 +00:00
Author
Owner

@DHowett commented on GitHub (May 10, 2022):

Curious. What keyboard layout are you using? Are you using an input method?

This works for me (US-104 keyboard, en-US):

vim-alt-k

@DHowett commented on GitHub (May 10, 2022): Curious. What keyboard layout are you using? Are you using an input method? This works for me (US-104 keyboard, en-US): ![vim-alt-k](https://user-images.githubusercontent.com/189190/167682265-2766bb1b-3ebd-4a32-981a-f92190b7d5a9.gif)
Author
Owner

@seongbin commented on GitHub (May 11, 2022):

In this PC, I have installed us-en and c/j/k input
image
And tried with en-us keyboard
Animation

!EDIT
When I bind shift key instead alt key to move line, it works.

@seongbin commented on GitHub (May 11, 2022): In this PC, I have installed us-en and c/j/k input ![image](https://user-images.githubusercontent.com/1720769/167756053-80d18a2e-0a74-4c67-ae9a-f107cd6e4d62.png) And tried with en-us keyboard ![Animation](https://user-images.githubusercontent.com/1720769/167756675-ed994dbd-4a3d-4999-b526-b1488165f36c.gif) !EDIT When I bind shift key instead alt key to move line, it works.
Author
Owner

@seongbin commented on GitHub (May 19, 2022):

NVM, after I unbind all unnecessary ALT key in Windows Terminal, it works.

@seongbin commented on GitHub (May 19, 2022): NVM, after I unbind all unnecessary ALT key in Windows Terminal, it works.
Author
Owner

@CervEdin commented on GitHub (Apr 21, 2023):

@seongbin what do you mean by "unbind all unnecessary ALT key"? Did you remove all Actions involving ALT?

@CervEdin commented on GitHub (Apr 21, 2023): @seongbin what do you mean by "unbind all unnecessary ALT key"? Did you remove all Actions involving ALT?
Author
Owner

@GTonehour commented on GitHub (Apr 11, 2025):

@CervEdin In Windows Terminal "Actions" settings, alt+shift+down is mapped to resize panel down (respectively up). Removing that keybinding solves the problem.

@GTonehour commented on GitHub (Apr 11, 2025): @CervEdin In Windows Terminal "Actions" settings, `alt+shift+down` is mapped to `resize panel down` (respectively up). Removing that keybinding solves the problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17454