add vim bindings to split input movement
This commit is contained in:
@@ -246,6 +246,54 @@ void SplitInput::installKeyPressedEvent()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (event->key() == Qt::Key_H &&
|
||||||
|
event->modifiers() == Qt::AltModifier)
|
||||||
|
{
|
||||||
|
// h: vim binding for left
|
||||||
|
SplitContainer *page = this->split_->getContainer();
|
||||||
|
event->accept();
|
||||||
|
|
||||||
|
if (page != nullptr)
|
||||||
|
{
|
||||||
|
page->selectNextSplit(SplitContainer::Left);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event->key() == Qt::Key_J &&
|
||||||
|
event->modifiers() == Qt::AltModifier)
|
||||||
|
{
|
||||||
|
// j: vim binding for down
|
||||||
|
SplitContainer *page = this->split_->getContainer();
|
||||||
|
event->accept();
|
||||||
|
|
||||||
|
if (page != nullptr)
|
||||||
|
{
|
||||||
|
page->selectNextSplit(SplitContainer::Below);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event->key() == Qt::Key_K &&
|
||||||
|
event->modifiers() == Qt::AltModifier)
|
||||||
|
{
|
||||||
|
// k: vim binding for up
|
||||||
|
SplitContainer *page = this->split_->getContainer();
|
||||||
|
event->accept();
|
||||||
|
|
||||||
|
if (page != nullptr)
|
||||||
|
{
|
||||||
|
page->selectNextSplit(SplitContainer::Above);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event->key() == Qt::Key_L &&
|
||||||
|
event->modifiers() == Qt::AltModifier)
|
||||||
|
{
|
||||||
|
// l: vim binding for right
|
||||||
|
SplitContainer *page = this->split_->getContainer();
|
||||||
|
event->accept();
|
||||||
|
|
||||||
|
if (page != nullptr)
|
||||||
|
{
|
||||||
|
page->selectNextSplit(SplitContainer::Right);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (event->key() == Qt::Key_Down)
|
else if (event->key() == Qt::Key_Down)
|
||||||
{
|
{
|
||||||
if ((event->modifiers() & Qt::ShiftModifier) != 0)
|
if ((event->modifiers() & Qt::ShiftModifier) != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user