From 2ee91c8aabbfdff86f873a5383dc0b246f17d475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Aum=C3=BCller?= <aumuell@reserv.at> Date: Thu, 18 Mar 2010 13:15:59 +0100 Subject: [PATCH] fakevim: map ctrl-] (follow tag in vim) to "Follow symbol under cursor" and ctrl-t (move up in tag stack) to "Go Back" Merge-request: 131 Reviewed-by: hjk <qtc-committer@nokia.com> --- src/plugins/fakevim/fakevimhandler.cpp | 4 ++++ src/plugins/fakevim/fakevimplugin.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index b45d1510dbe..61a50b61cdd 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -1772,6 +1772,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, m_movetype = MoveExclusive; m_subsubmode = FtSubSubMode; m_subsubdata = key; + } else if (key == control('t')) { + handleCommand("pop"); } else if (!m_gflag && key == 'u') { undo(); } else if (key == control('u')) { @@ -1928,6 +1930,8 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, removeSelectedText(); } else if (key == Key_BracketLeft || key == Key_BracketRight) { + } else if (key == control(Key_BracketRight)) { + handleCommand("tag"); } else if (key == Key_Escape) { if (isVisualMode()) { leaveVisualMode(); diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index d4d26aeee34..5c6aa71004e 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -67,6 +67,8 @@ #include <utils/savedaction.h> #include <utils/treewidgetcolumnstretcher.h> +#include <cppeditor/cppeditorconstants.h> + #include <cpptools/cpptoolsconstants.h> #include <indenter.h> @@ -553,6 +555,8 @@ FakeVimPluginPrivate::FakeVimPluginPrivate(FakeVimPlugin *plugin) s_defaultExCommandMap[ProjectExplorer::Constants::BUILD] = QRegExp("^make$"); s_defaultExCommandMap["Coreplugin.OutputPane.previtem"] = QRegExp("^(cN(ext)?|cp(revious)?)!?( (.*))?$"); s_defaultExCommandMap["Coreplugin.OutputPane.nextitem"] = QRegExp("^cn(ext)?!?( (.*))?$"); + s_defaultExCommandMap[CppEditor::Constants::JUMP_TO_DEFINITION] = QRegExp("^tag?$"); + s_defaultExCommandMap[Core::Constants::GO_BACK] = QRegExp("^pop?$"); } FakeVimPluginPrivate::~FakeVimPluginPrivate() -- GitLab