diff --git a/src/utils/application.cpp b/src/utils/application.cpp index 0fe7c44e..3b14ed9e 100644 --- a/src/utils/application.cpp +++ b/src/utils/application.cpp @@ -1,169 +1,169 @@ /* * This file is part of the KDE project. * * Copyright (C) 2013 Christoph Cullmann * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include #include #include #include "kateglobal.h" namespace KTextEditor { Application::Application(QObject *parent) : QObject(parent) , d(nullptr) { } Application::~Application() { } bool Application::quit() { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "quit" , Qt::DirectConnection , Q_RETURN_ARG(bool, success)); return success; } QList Application::mainWindows() { /** * dispatch to parent */ QList mainWindow; QMetaObject::invokeMethod(parent() , "mainWindows" , Qt::DirectConnection - , Q_RETURN_ARG(QList, mainWindow)); + , Q_RETURN_ARG(QList, mainWindow)); return mainWindow; } KTextEditor::MainWindow *Application::activeMainWindow() { /** * dispatch to parent */ KTextEditor::MainWindow *window = nullptr; QMetaObject::invokeMethod(parent() , "activeMainWindow" , Qt::DirectConnection - , Q_RETURN_ARG(KTextEditor::MainWindow *, window)); + , Q_RETURN_ARG(KTextEditor::MainWindow*, window)); /** * always return some kind of window to not need to check for valid pointer */ return window ? window : KTextEditor::EditorPrivate::self()->dummyMainWindow(); } QList Application::documents() { /** * dispatch to parent */ QList documents; QMetaObject::invokeMethod(parent() , "documents" , Qt::DirectConnection - , Q_RETURN_ARG(QList, documents)); + , Q_RETURN_ARG(QList, documents)); return documents; } KTextEditor::Document *Application::findUrl(const QUrl &url) { /** * dispatch to parent */ KTextEditor::Document *document = nullptr; QMetaObject::invokeMethod(parent() , "findUrl" , Qt::DirectConnection - , Q_RETURN_ARG(KTextEditor::Document *, document) - , Q_ARG(const QUrl &, url)); + , Q_RETURN_ARG(KTextEditor::Document*, document) + , Q_ARG(QUrl, url)); return document; } KTextEditor::Document *Application::openUrl(const QUrl &url, const QString &encoding) { /** * dispatch to parent */ KTextEditor::Document *document = nullptr; QMetaObject::invokeMethod(parent() , "openUrl" , Qt::DirectConnection - , Q_RETURN_ARG(KTextEditor::Document *, document) - , Q_ARG(const QUrl &, url) - , Q_ARG(const QString &, encoding)); + , Q_RETURN_ARG(KTextEditor::Document*, document) + , Q_ARG(QUrl, url) + , Q_ARG(QString, encoding)); return document; } bool Application::closeDocument(KTextEditor::Document *document) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "closeDocument" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(KTextEditor::Document *, document)); + , Q_ARG(KTextEditor::Document*, document)); return success; } bool Application::closeDocuments(const QList &documents) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "closeDocuments" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(const QList &, documents)); + , Q_ARG(QList, documents)); return success; } KTextEditor::Plugin *Application::plugin(const QString &name) { /** * dispatch to parent */ Plugin *plugin = nullptr; QMetaObject::invokeMethod(parent() , "plugin" , Qt::DirectConnection - , Q_RETURN_ARG(KTextEditor::Plugin *, plugin) - , Q_ARG(const QString &, name)); + , Q_RETURN_ARG(KTextEditor::Plugin*, plugin) + , Q_ARG(QString, name)); return plugin; } } // namespace KTextEditor diff --git a/src/utils/mainwindow.cpp b/src/utils/mainwindow.cpp index f389311a..48da3b81 100644 --- a/src/utils/mainwindow.cpp +++ b/src/utils/mainwindow.cpp @@ -1,310 +1,310 @@ /* * This file is part of the KDE project. * * Copyright (C) 2013 Christoph Cullmann * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include #include #include namespace KTextEditor { MainWindow::MainWindow(QObject *parent) : QObject(parent) , d(nullptr) { } MainWindow::~MainWindow() { } QWidget *MainWindow::window() { /** * dispatch to parent */ QWidget *window = nullptr; QMetaObject::invokeMethod(parent() , "window" , Qt::DirectConnection - , Q_RETURN_ARG(QWidget *, window)); + , Q_RETURN_ARG(QWidget*, window)); return window; } KXMLGUIFactory *MainWindow::guiFactory() { /** * dispatch to parent */ KXMLGUIFactory *guiFactory = nullptr; QMetaObject::invokeMethod(parent() , "guiFactory" , Qt::DirectConnection - , Q_RETURN_ARG(KXMLGUIFactory *, guiFactory)); + , Q_RETURN_ARG(KXMLGUIFactory*, guiFactory)); return guiFactory; } QList MainWindow::views() { /** * dispatch to parent */ QList views; QMetaObject::invokeMethod(parent() , "views" , Qt::DirectConnection - , Q_RETURN_ARG(QList, views)); + , Q_RETURN_ARG(QList, views)); return views; } KTextEditor::View *MainWindow::activeView() { /** * dispatch to parent */ KTextEditor::View *view = nullptr; QMetaObject::invokeMethod(parent() , "activeView" , Qt::DirectConnection - , Q_RETURN_ARG(KTextEditor::View *, view)); + , Q_RETURN_ARG(KTextEditor::View*, view)); return view; } KTextEditor::View *MainWindow::activateView(KTextEditor::Document *document) { /** * dispatch to parent */ KTextEditor::View *view = nullptr; QMetaObject::invokeMethod(parent() , "activateView" , Qt::DirectConnection - , Q_RETURN_ARG(KTextEditor::View *, view) - , Q_ARG(KTextEditor::Document *, document)); + , Q_RETURN_ARG(KTextEditor::View*, view) + , Q_ARG(KTextEditor::Document*, document)); return view; } KTextEditor::View *MainWindow::openUrl(const QUrl &url, const QString &encoding) { /** * dispatch to parent */ KTextEditor::View *view = nullptr; QMetaObject::invokeMethod(parent() , "openUrl" , Qt::DirectConnection - , Q_RETURN_ARG(KTextEditor::View *, view) - , Q_ARG(const QUrl &, url) - , Q_ARG(const QString &, encoding)); + , Q_RETURN_ARG(KTextEditor::View*, view) + , Q_ARG(QUrl, url) + , Q_ARG(QString, encoding)); return view; } bool MainWindow::closeView(KTextEditor::View *view) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "closeView" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(KTextEditor::View *, view)); + , Q_ARG(KTextEditor::View*, view)); return success; } void MainWindow::splitView(Qt::Orientation orientation) { /** * dispatch to parent */ QMetaObject::invokeMethod(parent() , "splitView" , Qt::DirectConnection , Q_ARG(Qt::Orientation, orientation)); } bool MainWindow::closeSplitView(KTextEditor::View *view) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "closeSplitView" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(KTextEditor::View *, view)); + , Q_ARG(KTextEditor::View*, view)); return success; } bool MainWindow::viewsInSameSplitView(KTextEditor::View *view1, KTextEditor::View *view2) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "viewsInSameSplitView" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(KTextEditor::View *, view1) - , Q_ARG(KTextEditor::View *, view2)); + , Q_ARG(KTextEditor::View*, view1) + , Q_ARG(KTextEditor::View*, view2)); return success; } QWidget *MainWindow::createViewBar(KTextEditor::View *view) { /** * dispatch to parent */ QWidget *viewBar = nullptr; QMetaObject::invokeMethod(parent() , "createViewBar" , Qt::DirectConnection - , Q_RETURN_ARG(QWidget *, viewBar) - , Q_ARG(KTextEditor::View *, view)); + , Q_RETURN_ARG(QWidget*, viewBar) + , Q_ARG(KTextEditor::View*, view)); return viewBar; } void MainWindow::deleteViewBar(KTextEditor::View *view) { /** * dispatch to parent */ QMetaObject::invokeMethod(parent() , "deleteViewBar" , Qt::DirectConnection - , Q_ARG(KTextEditor::View *, view)); + , Q_ARG(KTextEditor::View*, view)); } void MainWindow::addWidgetToViewBar(KTextEditor::View *view, QWidget *bar) { /** * dispatch to parent */ QMetaObject::invokeMethod(parent() , "addWidgetToViewBar" , Qt::DirectConnection - , Q_ARG(KTextEditor::View *, view) - , Q_ARG(QWidget *, bar)); + , Q_ARG(KTextEditor::View*, view) + , Q_ARG(QWidget*, bar)); } void MainWindow::showViewBar(KTextEditor::View *view) { /** * dispatch to parent */ QMetaObject::invokeMethod(parent() , "showViewBar" , Qt::DirectConnection - , Q_ARG(KTextEditor::View *, view)); + , Q_ARG(KTextEditor::View*, view)); } void MainWindow::hideViewBar(KTextEditor::View *view) { /** * dispatch to parent */ QMetaObject::invokeMethod(parent() , "hideViewBar" , Qt::DirectConnection - , Q_ARG(KTextEditor::View *, view)); + , Q_ARG(KTextEditor::View*, view)); } QWidget *MainWindow::createToolView(KTextEditor::Plugin *plugin, const QString &identifier, KTextEditor::MainWindow::ToolViewPosition pos, const QIcon &icon, const QString &text) { /** * dispatch to parent */ QWidget *toolView = nullptr; QMetaObject::invokeMethod(parent() , "createToolView" , Qt::DirectConnection - , Q_RETURN_ARG(QWidget *, toolView) - , Q_ARG(KTextEditor::Plugin *, plugin) - , Q_ARG(const QString &, identifier) + , Q_RETURN_ARG(QWidget*, toolView) + , Q_ARG(KTextEditor::Plugin*, plugin) + , Q_ARG(QString, identifier) , Q_ARG(KTextEditor::MainWindow::ToolViewPosition, pos) - , Q_ARG(const QIcon &, icon) - , Q_ARG(const QString &, text)); + , Q_ARG(QIcon, icon) + , Q_ARG(QString, text)); return toolView; } bool MainWindow::moveToolView(QWidget *widget, KTextEditor::MainWindow::ToolViewPosition pos) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "moveToolView" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(QWidget *, widget) + , Q_ARG(QWidget*, widget) , Q_ARG(KTextEditor::MainWindow::ToolViewPosition, pos)); return success; } bool MainWindow::showToolView(QWidget *widget) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "showToolView" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(QWidget *, widget)); + , Q_ARG(QWidget*, widget)); return success; } bool MainWindow::hideToolView(QWidget *widget) { /** * dispatch to parent */ bool success = false; QMetaObject::invokeMethod(parent() , "hideToolView" , Qt::DirectConnection , Q_RETURN_ARG(bool, success) - , Q_ARG(QWidget *, widget)); + , Q_ARG(QWidget*, widget)); return success; } QObject *MainWindow::pluginView(const QString &name) { /** * dispatch to parent */ QObject *pluginView = nullptr; QMetaObject::invokeMethod(parent() , "pluginView" , Qt::DirectConnection - , Q_RETURN_ARG(QObject *, pluginView) - , Q_ARG(const QString &, name)); + , Q_RETURN_ARG(QObject*, pluginView) + , Q_ARG(QString, name)); return pluginView; } } // namespace KTextEditor diff --git a/src/vimode/modes/visualvimode.cpp b/src/vimode/modes/visualvimode.cpp index 38f8f379..a1ecfee5 100644 --- a/src/vimode/modes/visualvimode.cpp +++ b/src/vimode/modes/visualvimode.cpp @@ -1,412 +1,412 @@ /* This file is part of the KDE libraries and the Kate part. * * Copyright (C) 2008 Erlend Hamberg * Copyright (C) 2011 Svyatoslav Kuzmich * Copyright (C) 2012 - 2013 Simon St James * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include #include #include #include #include #include #include using namespace KateVi; #define ADDCMD(STR,FUNC, FLGS) m_commands.push_back( \ new Command( this, QStringLiteral(STR), &NormalViMode::FUNC, FLGS ) ); #define ADDMOTION(STR, FUNC, FLGS) m_motions.push_back( new \ Motion( this, QStringLiteral(STR), &NormalViMode::FUNC, FLGS ) ); VisualViMode::VisualViMode(InputModeManager *viInputModeManager, KTextEditor::ViewPrivate *view, KateViewInternal *viewInternal) : NormalViMode(viInputModeManager, view, viewInternal) { m_start.setPosition(-1, -1); m_mode = ViMode::VisualMode; initializeCommands(); - connect(m_view, SIGNAL(selectionChanged(KTextEditor::View *)), + connect(m_view, SIGNAL(selectionChanged(KTextEditor::View*)), this, SLOT(updateSelection())); } VisualViMode::~VisualViMode() { } void VisualViMode::selectInclusive(const KTextEditor::Cursor &c1, const KTextEditor::Cursor &c2) { if (c1 >= c2) { m_view->setSelection(KTextEditor::Range(c1.line(), c1.column() + 1, c2.line(), c2.column())); } else { m_view->setSelection(KTextEditor::Range(c1.line(), c1.column(), c2.line(), c2.column() + 1)); } } void VisualViMode::selectBlockInclusive(const KTextEditor::Cursor &c1, const KTextEditor::Cursor &c2) { m_view->setBlockSelection(true); if (c1.column() >= c2.column()) { m_view->setSelection(KTextEditor::Range(c1.line(), c1.column() + 1, c2.line(), c2.column())); } else { m_view->setSelection(KTextEditor::Range(c1.line(), c1.column(), c2.line(), c2.column() + 1)); } } void VisualViMode::selectLines(const KTextEditor::Range &range) { int sline = qMin(range.start().line(), range.end().line()); int eline = qMax(range.start().line(), range.end().line()); int ecol = m_view->doc()->lineLength(eline) + 1; m_view->setSelection(KTextEditor::Range(KTextEditor::Cursor(sline, 0), KTextEditor::Cursor(eline, ecol))); } void VisualViMode::goToPos(const Range &r) { KTextEditor::Cursor c = m_view->cursorPosition(); if (r.startLine != -1 && r.startColumn != -1 && c == m_start) { m_start.setLine(r.startLine); m_start.setColumn(r.startColumn); c.setLine(r.endLine); c.setColumn(r.endColumn); } else if (r.startLine != -1 && r.startColumn != -1 && m_motionCanChangeWholeVisualModeSelection) { const KTextEditor::Cursor textObjectBegin(r.startLine, r.startColumn); if (textObjectBegin < m_start) { m_start.setLine(r.startLine); m_start.setColumn(r.startColumn); c.setLine(r.endLine); c.setColumn(r.endColumn); } } else { c.setLine(r.endLine); c.setColumn(r.endColumn); } if (c.line() >= doc()->lines()) { c.setLine(doc()->lines() - 1); } updateCursor(c); // Setting range for a command m_commandRange = Range(m_start, c, m_commandRange.motionType); // If visual mode is blockwise if (isVisualBlock()) { selectBlockInclusive(m_start, c); // Need to correct command range to make it inclusive. if ((c.line() < m_start.line() && c.column() > m_start.column()) || (c.line() > m_start.line() && c.column() < m_start.column())) { qSwap(m_commandRange.endColumn, m_commandRange.startColumn); } return; } else { m_view->setBlockSelection(false); } // If visual mode is linewise if (isVisualLine()) { selectLines(KTextEditor::Range(m_start, c)); return; } // If visual mode is charwise selectInclusive(m_start, c); } void VisualViMode::reset() { m_mode = ViMode::VisualMode; // only switch to normal mode if still in visual mode. commands like c, s, ... // can have switched to insert mode if (m_viInputModeManager->isAnyVisualMode()) { saveRangeMarks(); m_lastVisualMode = m_viInputModeManager->getCurrentViMode(); // Return the cursor back to start of selection after. if (!m_pendingResetIsDueToExit) { KTextEditor::Cursor c = m_view->cursorPosition(); if (m_start.line() != -1 && m_start.column() != -1) { if (m_viInputModeManager->getCurrentViMode() == ViMode::VisualLineMode) { if (m_start.line() < c.line()) { updateCursor(KTextEditor::Cursor(m_start.line(), 0)); m_stickyColumn = -1; } } else { updateCursor(qMin(m_start, c)); m_stickyColumn = -1; } } } if (m_viInputModeManager->getPreviousViMode() == ViMode::InsertMode) { startInsertMode(); } else { startNormalMode(); } } if (!m_commandShouldKeepSelection) { m_view->removeSelection(); } else { m_commandShouldKeepSelection = false; } m_start.setPosition(-1, -1); m_pendingResetIsDueToExit = false; } void VisualViMode::saveRangeMarks() { // DO NOT save these marks if the // action that exited visual mode deleted the selection if (m_deleteCommand == false) { m_viInputModeManager->marks()->setSelectionStart(m_start); m_viInputModeManager->marks()->setSelectionFinish(m_view->cursorPosition()); } } void VisualViMode::init() { // when using "gv" we already have a start position if (!m_start.isValid()) { m_start = m_view->cursorPosition(); } if (isVisualLine()) { KTextEditor::Cursor c = m_view->cursorPosition(); selectLines(KTextEditor::Range(c, c)); } m_commandRange = Range(m_start, m_start, m_commandRange.motionType); } void VisualViMode::setVisualModeType(ViMode mode) { Q_ASSERT(mode == ViMode::VisualMode || mode == ViMode::VisualLineMode || mode == ViMode::VisualBlockMode); m_mode = mode; } void VisualViMode::switchStartEnd() { KTextEditor::Cursor c = m_start; m_start = m_view->cursorPosition(); updateCursor(c); m_stickyColumn = -1; } void VisualViMode::goToPos(const KTextEditor::Cursor &c) { Range r(c, InclusiveMotion); goToPos(r); } void VisualViMode::updateSelection() { if (!m_viInputModeManager->inputAdapter()->isActive()) { return; } if (m_viInputModeManager->isHandlingKeypress() && !m_isUndo) { return; } // If we are there it's already not VisualBlock mode. m_view->setBlockSelection(false); // If not valid going back to normal mode KTextEditor::Range r = m_view->selectionRange(); if (!r.isValid()) { // Don't screw up the cursor's position. See BUG #337286. m_pendingResetIsDueToExit = true; reset(); return; } // If alredy not in visual mode, it's time to go there. if (m_viInputModeManager->getCurrentViMode() != ViMode::VisualMode) { commandEnterVisualMode(); } // Set range for commands m_start = (m_view->cursorPosition() == r.start()) ? r.end() : r.start(); m_commandRange = Range(r.start(), r.end(), m_commandRange.motionType); // The end of the range seems to be one space forward of where it should be. m_commandRange.endColumn--; } void VisualViMode::initializeCommands() { // Remove the commands put in here by NormalMode qDeleteAll(m_commands); m_commands.clear(); // Remove the motions put in here by NormalMode qDeleteAll(m_motions); m_motions.clear(); ADDCMD("J", commandJoinLines, IS_CHANGE); ADDCMD("c", commandChange, IS_CHANGE); ADDCMD("s", commandChange, IS_CHANGE); ADDCMD("C", commandChangeToEOL, IS_CHANGE); ADDCMD("S", commandChangeToEOL, IS_CHANGE); ADDCMD("d", commandDelete, IS_CHANGE); ADDCMD("", commandDelete, IS_CHANGE); ADDCMD("D", commandDeleteToEOL, IS_CHANGE); ADDCMD("x", commandDeleteChar, IS_CHANGE); ADDCMD("X", commandDeleteCharBackward, IS_CHANGE); ADDCMD("gu", commandMakeLowercase, IS_CHANGE); ADDCMD("u", commandMakeLowercase, IS_CHANGE); ADDCMD("gU", commandMakeUppercase, IS_CHANGE); ADDCMD("g~", commandChangeCaseRange, IS_CHANGE); ADDCMD("U", commandMakeUppercase, IS_CHANGE); ADDCMD("y", commandYank, 0); ADDCMD("Y", commandYankToEOL, 0); ADDCMD("p", commandPaste, IS_CHANGE); ADDCMD("P", commandPasteBefore, IS_CHANGE); ADDCMD("r.", commandReplaceCharacter, IS_CHANGE | REGEX_PATTERN); ADDCMD(":", commandSwitchToCmdLine, SHOULD_NOT_RESET); ADDCMD("m.", commandSetMark, REGEX_PATTERN | SHOULD_NOT_RESET); ADDCMD(">", commandIndentLines, IS_CHANGE); ADDCMD("<", commandUnindentLines, IS_CHANGE); ADDCMD("", commandAbort, 0); ADDCMD("", commandAbort, 0); ADDCMD("ga", commandPrintCharacterCode, SHOULD_NOT_RESET); ADDCMD("v", commandEnterVisualMode, SHOULD_NOT_RESET); ADDCMD("V", commandEnterVisualLineMode, SHOULD_NOT_RESET); ADDCMD("o", commandToOtherEnd, SHOULD_NOT_RESET); ADDCMD("=", commandAlignLines, SHOULD_NOT_RESET); ADDCMD("~", commandChangeCase, IS_CHANGE); ADDCMD("I", commandPrependToBlock, IS_CHANGE); ADDCMD("A", commandAppendToBlock, IS_CHANGE); ADDCMD("gq", commandFormatLines, IS_CHANGE); ADDCMD("q.", commandStartRecordingMacro, REGEX_PATTERN | SHOULD_NOT_RESET); ADDCMD("@.", commandReplayMacro, REGEX_PATTERN | SHOULD_NOT_RESET); ADDCMD("z.", commandCenterViewOnNonBlank, 0); ADDCMD("zz", commandCenterViewOnCursor, 0); ADDCMD("z", commandTopViewOnNonBlank, 0); ADDCMD("zt", commandTopViewOnCursor, 0); ADDCMD("z-", commandBottomViewOnNonBlank, 0); ADDCMD("zb", commandBottomViewOnCursor, 0); // regular motions ADDMOTION("h", motionLeft, 0); ADDMOTION("", motionLeft, 0); ADDMOTION("", motionLeft, 0); ADDMOTION("j", motionDown, 0); ADDMOTION("", motionDown, 0); ADDMOTION("k", motionUp, 0); ADDMOTION("", motionUp, 0); ADDMOTION("l", motionRight, 0); ADDMOTION("", motionRight, 0); ADDMOTION(" ", motionRight, 0); ADDMOTION("$", motionToEOL, 0); ADDMOTION("", motionToEOL, 0); ADDMOTION("0", motionToColumn0, 0); ADDMOTION("", motionToColumn0, 0); ADDMOTION("^", motionToFirstCharacterOfLine, 0); ADDMOTION("f.", motionFindChar, REGEX_PATTERN); ADDMOTION("F.", motionFindCharBackward, REGEX_PATTERN); ADDMOTION("t.", motionToChar, REGEX_PATTERN); ADDMOTION("T.", motionToCharBackward, REGEX_PATTERN); ADDMOTION(";", motionRepeatlastTF, 0); ADDMOTION(",", motionRepeatlastTFBackward, 0); ADDMOTION("n", motionFindNext, 0); ADDMOTION("N", motionFindPrev, 0); ADDMOTION("gg", motionToLineFirst, 0); ADDMOTION("G", motionToLineLast, 0); ADDMOTION("w", motionWordForward, 0); ADDMOTION("W", motionWORDForward, 0); ADDMOTION("", motionWordForward, IS_NOT_LINEWISE); ADDMOTION("", motionWordBackward, IS_NOT_LINEWISE); ADDMOTION("b", motionWordBackward, 0); ADDMOTION("B", motionWORDBackward, 0); ADDMOTION("e", motionToEndOfWord, 0); ADDMOTION("E", motionToEndOfWORD, 0); ADDMOTION("ge", motionToEndOfPrevWord, 0); ADDMOTION("gE", motionToEndOfPrevWORD, 0); ADDMOTION("|", motionToScreenColumn, 0); ADDMOTION("%", motionToMatchingItem, 0); ADDMOTION("`.", motionToMark, REGEX_PATTERN); ADDMOTION("'.", motionToMarkLine, REGEX_PATTERN); ADDMOTION("[[", motionToPreviousBraceBlockStart, 0); ADDMOTION("]]", motionToNextBraceBlockStart, 0); ADDMOTION("[]", motionToPreviousBraceBlockEnd, 0); ADDMOTION("][", motionToNextBraceBlockEnd, 0); ADDMOTION("*", motionToNextOccurrence, 0); ADDMOTION("#", motionToPrevOccurrence, 0); ADDMOTION("", motionPageDown, 0); ADDMOTION("", motionPageDown, 0); ADDMOTION("", motionPageUp, 0); ADDMOTION("", motionPageUp, 0); ADDMOTION("gj", motionToNextVisualLine, 0); ADDMOTION("gk", motionToPrevVisualLine, 0); ADDMOTION("(", motionToPreviousSentence, 0); ADDMOTION(")", motionToNextSentence, 0); ADDMOTION("{", motionToBeforeParagraph, 0); ADDMOTION("}", motionToAfterParagraph, 0); ADDMOTION("", motionHalfPageUp, 0); ADDMOTION("", motionHalfPageDown, 0); // text objects ADDMOTION("iw", textObjectInnerWord, 0); ADDMOTION("aw", textObjectAWord, 0); ADDMOTION("iW", textObjectInnerWORD, 0); ADDMOTION("aW", textObjectAWORD, IS_NOT_LINEWISE); ADDMOTION("is", textObjectInnerSentence, IS_NOT_LINEWISE); ADDMOTION("as", textObjectASentence, IS_NOT_LINEWISE); ADDMOTION("ip", textObjectInnerParagraph, IS_NOT_LINEWISE); ADDMOTION("ap", textObjectAParagraph, IS_NOT_LINEWISE); ADDMOTION("i\"", textObjectInnerQuoteDouble, CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION); ADDMOTION("a\"", textObjectAQuoteDouble, 0); ADDMOTION("i'", textObjectInnerQuoteSingle, CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION); ADDMOTION("a'", textObjectAQuoteSingle, 0); ADDMOTION("i[()b]", textObjectInnerParen, REGEX_PATTERN | CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION); ADDMOTION("a[()b]", textObjectAParen, REGEX_PATTERN); ADDMOTION("i[{}B]", textObjectInnerCurlyBracket, REGEX_PATTERN | IS_NOT_LINEWISE | CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION); ADDMOTION("a[{}B]", textObjectACurlyBracket, REGEX_PATTERN | IS_NOT_LINEWISE); ADDMOTION("i[><]", textObjectInnerInequalitySign, REGEX_PATTERN | IS_NOT_LINEWISE | CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION); ADDMOTION("i[\\[\\]]", textObjectInnerBracket, REGEX_PATTERN | CAN_CHANGE_WHOLE_VISUAL_MODE_SELECTION); ADDMOTION("a[\\[\\]]", textObjectABracket, REGEX_PATTERN); ADDMOTION("i,", textObjectInnerComma, 0); ADDMOTION("a,", textObjectAComma, 0); ADDMOTION("/", motionToIncrementalSearchMatch, 0); ADDMOTION("?", motionToIncrementalSearchMatch, 0); }