diff --git a/example/editor.cpp b/example/editor.cpp index b3a8cd1..6876e75 100644 --- a/example/editor.cpp +++ b/example/editor.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #define EDITOR(editor, call) \ if (QPlainTextEdit *ed = qobject_cast(editor)) { \ @@ -475,6 +476,17 @@ void initHandler(FakeVimHandler *handler) handler->handleCommand(_("set autoindent")); handler->handleCommand(_("set smartindent")); + QString vimrc = QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +#ifdef Q_OS_WIN + + "/_vimrc"; +#else + + "/.vimrc"; +#endif + + if (QFile::exists(vimrc)) { + handler->handleCommand("source " + vimrc); + } + handler->installEventFilter(); handler->setupWidget(); }