Kate
katecmds.cpp
Go to the documentation of this file.
103 "<p>Cleans up the indentation of the selected lines or current line according to the indentation settings in the document. </p>");
107 "<p>Inserts comment markers to make the selection or selected lines or current line a comment according to the text format as defined by the syntax highlight definition for the document.</p>");
111 "<p>Removes comment markers from the selection or selected lines or current line according to the text format as defined by the syntax highlight definition for the document.</p>");
119 "<p>If enabled, indentation of text pasted from the clipboard is adjusted using the current indenter.</p>"
154 "<p>Sets the indentation width to the number <b>width</b>. Used only if you are indenting with spaces.</p>");
192 "<p>Sets the line width for hard wrapping to <b>width</b>. This is used if you are having your text wrapped automatically.</p>");
202 "<p>Sets the syntax highlighting system for the document. The argument must be a valid highlight name, as seen in the Tools → Highlighting menu. This command provides an autocompletion list for its argument.</p>");
286 return (v->textFolding().newFoldingRange (range.isValid() ? range : v->selectionRange(), Kate::TextFolding::Persistent | Kate::TextFolding::Folded) != -1);
290 return (v->textFolding().newFoldingRange (range.isValid() ? range : v->selectionRange(), Kate::TextFolding::Folded) != -1);
294 QVector<QPair<qint64, Kate::TextFolding::FoldingRangeFlags> > startingRanges = v->textFolding().foldingRangesStartingOnLine (v->cursorPosition().line());
509 KCompletion *KateCommands::CoreCommands::completionObject( KTextEditor::View *view, const QString &cmd )
555 l << mappingCommands() << "d" << "delete" << "j" << "c" << "change" << "<" << ">" << "y" << "yank" <<
604 msg = KateGlobal::self()->viInputModeGlobal()->getMapping( modeForMapCommand(cmd), args.at( 0 ), true );
612 KateViGlobal::MappingRecursion mappingRecursion = (isMapCommandRecursive(cmd)) ? KateViGlobal::Recursive : KateViGlobal::NonRecursive;
613 KateGlobal::self()->viInputModeGlobal()->addMapping( modeForMapCommand(cmd), args.at( 0 ), args.at( 1 ), mappingRecursion);
714 KCompletion *KateCommands::ViCommands::completionObject( KTextEditor::View *view, const QString &cmd )
722 QStringList l = KateGlobal::self()->viInputModeGlobal()->getMappings( KateViGlobal::NormalModeMapping );
747 KateViGlobal::MappingMode KateCommands::ViCommands::modeForMapCommand(const QString& mapCommand)
974 QSharedPointer<InteractiveSedReplacer> interactiveSedReplacer(new InteractiveSedReplacer(doc, find, replace, !noCase, !repeat, startLine, endLine));
986 kDebug(13025) << "Interactive sedreplace is only currently supported with Vi mode plus Vi emulated command bar.";
999 bool KateCommands::SedReplace::parse(const QString& sedReplaceString, QString& destDelim, int& destFindBeginPos, int& destFindEndPos, int& destReplaceBeginPos, int& destReplaceEndPos)
1024 KateCommands::SedReplace::InteractiveSedReplacer::InteractiveSedReplacer(KateDocument* doc, const QString& findPattern, const QString& replacePattern, bool caseSensitive, bool onlyOnePerLine, int startLine, int endLine)
1077 const int moveChar = currentMatch.isEmpty() ? 1 : 0; // if the search was for \s*, make sure we advance a char
1114 QString KateCommands::SedReplace::InteractiveSedReplacer::currentMatchReplacementConfirmationMessage()
1147 const QString replacementText = m_regExpSearch.buildReplacement(m_replacePattern, captureTexts, 0);
1159 bool KateCommands::Character::help (class KTextEditor::View *, const QString &cmd, QString &msg)
1163 "<p>This command allows you to insert literal characters by their numerical identifier, in decimal, octal or hexadecimal form.</p>"
1224 "<p>Inserts a date/time string as defined by the specified format, or the format yyyy-MM-dd hh:mm:ss if none is specified.</p>"
1236 "<tr><td>h</td><td>The hour without a leading zero (0..23 or 1..12 if AM/PM display).</td></tr>"
1237 "<tr><td>hh</td><td>The hour with a leading zero (00..23 or 01..12 if AM/PM display).</td></tr>"
1244 "<tr><td>AP</td><td>Use AM/PM display. AP will be replaced by either \"AM\" or \"PM\".</td></tr>"
1245 "<tr><td>ap</td><td>Use am/pm display. ap will be replaced by either \"am\" or \"pm\".</td></tr>"
1258 view->document()->insertText(view->cursorPosition(), QDateTime::currentDateTime().toString(cmd.mid(5, cmd.length()-5)));
1260 view->document()->insertText(view->cursorPosition(), QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"));
int pos(int nth) const
void startInteractiveSearchAndReplace(QSharedPointer< KateCommands::SedReplace::InteractiveSedReplacer > interactiveSedReplace)
Definition: kateviemulatedcommandbar.cpp:1222
QString toString(Qt::DateFormat format) const
This KTextEditor::Command provides access to a lot of the core functionality of kate part...
Definition: katecmds.h:49
QString cap(int nth) const
QScriptValue i18n(QScriptContext *context, QScriptEngine *engine)
i18n("text", arguments [optional])
Definition: katescripthelpers.cpp:186
void setIndentationMode(const QString &identationMode)
Definition: kateconfig.cpp:500
bool exec(class KTextEditor::View *view, const QString &cmd, QString &errorMsg)
Execute command.
Definition: katecmds.cpp:920
bool viInputModeEmulateCommandBar() const
Definition: kateconfig.cpp:1862
const QString getMapping(MappingMode mode, const QString &from, bool decode=false) const
Definition: kateviglobal.cpp:186
bool supportsRange(const QString &range)
Definition: katecmds.cpp:498
KCompletion * completionObject(KTextEditor::View *, const QString &)
override completionObject from interfaces/document.h .
Definition: katecmds.cpp:509
InteractiveSedReplacer(KateDocument *doc, const QString &findPattern, const QString &replacePattern, bool caseSensitive, bool onlyOnePerLine, int startLine, int endLine)
Definition: katecmds.cpp:1024
bool supportsRange(const QString &range)
Definition: katecmds.cpp:703
void addMark(KateDocument *doc, const QChar &mark, const KTextEditor::Cursor &pos, const bool moveoninsert=true, const bool showmark=true)
Add a mark to the document.
Definition: kateviinputmodemanager.cpp:737
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
void rememberUserDidSetIndentationMode()
set indentation mode by user this will remember that a user did set it and will avoid reset on save ...
Definition: katedocument.h:952
virtual bool setMode(const QString &name)
Set the current mode of the document by giving its name.
Definition: katedocument.cpp:1462
Definition: kateviglobal.h:61
const QStringList getMappings(MappingMode mode, bool decode=false) const
Definition: kateviglobal.cpp:196
const T & at(int i) const
KCompletion * completionObject(KTextEditor::View *, const QString &)
override completionObject from interfaces/document.h .
Definition: katecmds.cpp:714
bool contains(const QString &str, Qt::CaseSensitivity cs) const
This KTextEditor::Command provides vi commands for the application.
Definition: katecmds.h:175
bool help(class KTextEditor::View *, const QString &, QString &)
This command does not have help.
Definition: katecmds.cpp:1159
T & first()
QString & remove(int position, int n)
bool help(class KTextEditor::View *, const QString &, QString &)
This command does not have help.
Definition: katecmds.cpp:1220
QString finalStatusReportMessage()
Definition: katecmds.cpp:1119
bool setCursorPosition(KTextEditor::Cursor position)
Definition: kateview.cpp:2418
bool exec(class KTextEditor::View *view, const QString &cmd, QString &msg)
execute command
Definition: katecmds.cpp:825
QString homePath()
Definition: kateviglobal.h:61
void indent(KTextEditor::Range range, int change)
Definition: katedocument.cpp:2899
QString currentMatchReplacementConfirmationMessage()
Definition: katecmds.cpp:1114
void removeMapping(MappingMode mode, const QString &from)
Definition: kateviglobal.cpp:181
QScriptValue i18ncp(QScriptContext *context, QScriptEngine *engine)
i18ncp("context", "singular", "plural", number, arguments [optional])
Definition: katescripthelpers.cpp:273
void addMapping(MappingMode mode, const QString &from, const QString &to, MappingRecursion recursion)
Definition: kateviglobal.cpp:171
KateViInputModeManager * getViInputModeManager()
Definition: kateview.cpp:1587
void comment(KateView *view, uint line, uint column, int change)
Definition: katedocument.cpp:3302
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
insert a unicode or ascii character base 9+1: 1234 hex: 0x1234 or x1234 octal: 01231 ...
Definition: katecmds.h:317
bool unfoldRange(qint64 id, bool remove=false)
Unfold the given range.
Definition: katetextfolding.cpp:191
virtual const KTextEditor::Range & selectionRange() const
Definition: kateview.cpp:2815
virtual bool setHighlightingMode(const QString &name)
Set the current mode of the document by giving its name.
Definition: katedocument.cpp:1484
int indexIn(const QString &str, int offset, CaretMode caretMode) const
QVector< QPair< qint64, FoldingRangeFlags > > foldingRangesStartingOnLine(int line) const
Queries which folding ranges start at the given line and returns the id + flags for all of them...
Definition: katetextfolding.cpp:476
bool empty() const
void replaceAllRemaining()
Definition: katecmds.cpp:1104
bool exec(class KTextEditor::View *view, const QString &cmd, QString &errorMsg)
execute command
Definition: katecmds.cpp:221
This KTextEditor::Command provides vi 'ex' commands.
Definition: katecmds.h:110
#define KCC_ERR(s)
int toInt(bool *ok, int base) const
bool isEmpty() const
bool isEmpty() const
QString trimmed() const
KateViNormalMode * getViNormalMode()
Definition: kateviinputmodemanager.cpp:546
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
bool help(class KTextEditor::View *, const QString &, QString &)
Help for AppCommands.
Definition: katecmds.cpp:851
bool exec(class KTextEditor::View *view, const QString &cmd, QString &msg)
execute command
Definition: katecmds.cpp:561
Definition: kateview.h:77
void replaceCurrentMatch()
Definition: katecmds.cpp:1064
Definition: kateviglobal.h:60
QString toLower() const
void setSearchPattern(const QString &searchPattern)
Set the current search pattern.
Definition: kateview.cpp:2476
Definition: katedocument.h:74
Definition: kateviglobal.h:61
bool contains(QChar ch, Qt::CaseSensitivity cs) const
QString & replace(int position, int n, QChar after)
Definition: kateviglobal.h:60
QDateTime currentDateTime()
QString mid(int position, int n) const
KateViEmulatedCommandBar * viModeEmulatedCommandBar()
Definition: kateview.cpp:3051
bool isEmpty() const
int count() const
QChar fromAscii(char c)
bool exec(class KTextEditor::View *view, const QString &cmd, QString &errorMsg)
execute command
Definition: katecmds.cpp:1252
int length() const
bool help(class KTextEditor::View *, const QString &, QString &)
This command does not have help.
Definition: katecmds.cpp:90
Definition: kateconfig.h:145
qint64 newFoldingRange(const KTextEditor::Range &range, FoldingRangeFlags flags=FoldingRangeFlags())
Create a new folding range.
Definition: katetextfolding.cpp:99
bool commandUnindentLine()
Definition: katevinormalmode.cpp:1576
KTextEditor::Range currentMatch()
Will return invalid Range if there are no further matches.
Definition: katecmds.cpp:1039
iterator insert(const Key &key, const T &value)
bool isEmpty() const
bool exec(class KTextEditor::View *view, const QString &cmd, QString &errorMsg)
execute command
Definition: katecmds.cpp:1173
void setIndentPastedText(bool on)
Definition: kateconfig.cpp:619
A KCompletion object that completes last ?unquoted? word in the string passed.
Definition: katecmd.h:67
void editStart()
Enclose editor actions with editStart() and editEnd() to group them.
Definition: katedocument.cpp:776
void setShowIndentLines(bool showLines)
Set whether a guide should be painted to help identifying indent lines.
Definition: katerenderer.cpp:125
int size() const
static int backslashString(const QString &haystack, const QString &needle, int index)
Definition: katecmds.cpp:873
void setIndentationWidth(int indentationWidth)
Definition: kateconfig.cpp:476
A KateViewBarWidget that attempts to emulate some of the features of Vim's own command bar...
Definition: kateviemulatedcommandbar.h:40
void skipCurrentMatch()
Definition: katecmds.cpp:1054
static bool parse(const QString &sedReplaceString, QString &destDelim, int &destFindBeginPos, int &destFindEndPos, int &destReplaceBeginPos, int &destReplaceEndPos)
Parses sedReplaceString to see if it is a valid sed replace expression (e.g.
Definition: katecmds.cpp:999
ushort toUShort(bool *ok, int base) const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.