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

Keybindings command to move lines up or down does not work #3325

Open
akim1995 opened this issue Mar 24, 2021 · 2 comments
Open

Keybindings command to move lines up or down does not work #3325

akim1995 opened this issue Mar 24, 2021 · 2 comments
Labels
A-editor-component Area: Editor component/UI A-input Area: Input management, keyboard layout, IME etc. bug Something isn't working

Comments

@akim1995
Copy link

I want to move lines up or down by pressing alt + k or alt + j
vs code have command editor.action.moveLinesUpAction
but onivim2, unfortunately, does nothing.

keybindings.json

[
  {
    "key": "A-k",
    "command": "editor.action.moveLinesUpAction",
    "when": "normalMode",
  },
  {
    "key": "A-j",
    "command": "editor.action.moveLinesDownAction",
    "when": "normalMode"
  },
]
@SimonEggert
Copy link

Using vim's built in :move command worked for me.

  {
    "key": "A-k",
    "command": ":m-2",
    "when": "normalMode"
  },
  {
    "key": "A-j",
    "command": ":m+",
    "when": "normalMode"
  }

@bryphe
Copy link
Member

bryphe commented Mar 30, 2021

Nice catch @SimonEggert !

I'd like to add this as the default for editor.action.moveLines[Up|Down]Action - the main thing to add is setting the appropriate value in visual / select mode (the :m+ command needs to be adjusted if there is a multi-line selection).

Related to #2735

@bryphe bryphe added A-editor-component Area: Editor component/UI A-input Area: Input management, keyboard layout, IME etc. bug Something isn't working labels Mar 31, 2021
bryphe added a commit that referenced this issue Mar 31, 2021
bryphe added a commit that referenced this issue Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-editor-component Area: Editor component/UI A-input Area: Input management, keyboard layout, IME etc. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants