Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20923

Alias C-W C-H/J/K/L to C-W h/j/k/l

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.8.0-beta1
    • Qt Creator 4.7.0
    • FakeVim
    • None
    • 96be20d81653b1149848072b888415f000ecd07b

    Description

      It would be nice if FakeVIM, just like VIM, ignored Ctrl for window movement commands:

       command            action in Normal mode
      -------------------------------------------
       CTRL-W CTRL-H      same as "CTRL-W h"
       CTRL-W CTRL-J      same as "CTRL-W j"
       CTRL-W CTRL-K      same as "CTRL-W k"
       CTRL-W CTRL-L      same as "CTRL-W l"
      

      I propose an untested patch:

      --- fakevimplugin.cpp.orig	2018-08-07 18:49:12.707645940 +0200
      +++ fakevimplugin.cpp	2018-08-07 18:53:20.238481732 +0200
      @@ -1421,13 +1421,13 @@
               triggerAction(Core::Constants::SPLIT_SIDE_BY_SIDE);
           else if (key == "W" || key == "<C-W>")
               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);
      -    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);
      -    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);
      -    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);
           else
               qDebug() << "UNKNOWN WINDOW COMMAND: <C-W>" << map;
      

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-20923
        # Subject Branch Project Status CR V

        Activity

          People

            hjk hjk
            iptriz iptriz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes