FakeVim: Alias C-w C-h/j/k/l to C-w h/j/k/l

In Vim land do as Vim does.

Change-Id: I4172039804fbee2c596f02587028943ac9845164
Task-number: QTCREATORBUG-20923
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-08-14 12:13:23 +02:00
parent 7bae47642c
commit 96be20d816

View File

@@ -1677,13 +1677,13 @@ void FakeVimPluginPrivate::editorOpened(IEditor *editor)
triggerAction(Core::Constants::SPLIT_SIDE_BY_SIDE); triggerAction(Core::Constants::SPLIT_SIDE_BY_SIDE);
else if (key == "W" || key == "<C-W>") else if (key == "W" || key == "<C-W>")
triggerAction(Core::Constants::GOTO_NEXT_SPLIT); triggerAction(Core::Constants::GOTO_NEXT_SPLIT);
else if (key.contains("RIGHT") || key == "L" || key == "<S-L>") else if (key.contains("RIGHT") || key == "L" || key == "<S-L>" || key == "<C-L>")
moveSomewhere(handler, &moveRightWeight, key == "<S-L>" ? -1 : count); moveSomewhere(handler, &moveRightWeight, key == "<S-L>" ? -1 : count);
else if (key.contains("LEFT") || key == "H" || key == "<S-H>") else if (key.contains("LEFT") || key == "H" || key == "<S-H>" || key == "<C-H>")
moveSomewhere(handler, &moveLeftWeight, key == "<S-H>" ? -1 : count); moveSomewhere(handler, &moveLeftWeight, key == "<S-H>" ? -1 : count);
else if (key.contains("UP") || key == "K" || key == "<S-K>") else if (key.contains("UP") || key == "K" || key == "<S-K>" || key == "<C-K>")
moveSomewhere(handler, &moveUpWeight, key == "<S-K>" ? -1 : count); moveSomewhere(handler, &moveUpWeight, key == "<S-K>" ? -1 : count);
else if (key.contains("DOWN") || key == "J" || key == "<S-J>") else if (key.contains("DOWN") || key == "J" || key == "<S-J>" || key == "<C-J>")
moveSomewhere(handler, &moveDownWeight, key == "<S-J>" ? -1 : count); moveSomewhere(handler, &moveDownWeight, key == "<S-J>" ? -1 : count);
else else
qDebug() << "UNKNOWN WINDOW COMMAND: <C-W>" << map; qDebug() << "UNKNOWN WINDOW COMMAND: <C-W>" << map;