Commit 6f6130ed authored by Michael Pyne's avatar Michael Pyne
Browse files

Since we're standardizing the source style, figured I'd throw in the Big Huge Vim Modeline

update.

All source now has a vim modeline, and all files use the same modeline (described in HACKING).

This will make it easier for vim users to stay HACKING-compatible in JuK.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=513935
parent 5e7be0ef
......@@ -6,18 +6,8 @@ save us both time when processing patches.
Indentation
================================================================================
The older files in JuK are indented using Qt-style. The first level was 4
spaces, the second one tab, the third one tab followed by 4 spaces. I'm not
particularly fond of this style anymore, but it used to be the Emacs default
when using the KDE Emacs scripts.
static void foo()
{
if(bar()) // <-- 4 spaces
baz() // <-- 1 tab
}
Newer files simply use 4 spaces at all levels. In most cases the style of the
Older versions of JuK had two different indenting schemes. Now all JuK source
code files simply use 4 spaces at all levels. In most cases the style of the
file currently being worked in should be followed. So:
static void foo()
......@@ -138,6 +128,36 @@ Pointer and Reference Operators
This one is pretty simple. I prefer "Foo *f" to "Foo* f" in function signatures
and declarations. The same goes for "Foo &f" over "Foo& f".
================================================================================
Editor Support
================================================================================
Most JuK files that Michael Pyne has touched will eventually have a vim modeline
at the bottom of the file (after any moc #includes). The current vim modeline
is the following:
// vim: set et sw=4 tw=0 sta:
The vim: ... : part encloses the commands to automatically use when opening the
file in vim. The following commands are set:
et : Uses spaces instead of the <TAB> when the Tab key is pressed. No
JuK source should have tab characters anymore, this helps enforce
that. Full name is expandtab.
sw = 4 : Makes indenting levels 4 spaces wide, for use with the vim indenting
features. Full name is shiftwidth.
tw = 0 : Prevents vim from wrapping lines as you are typing. Full name is
textwidth.
sta : Use shiftwidth to determine tab size at the beginning of the line,
instead of tabstop (which is normally 8 spaces wide). Full name is
smarttab.
Also, vim users will want to have the command "let c_space_errors=1" in their
.vimrc in order to flag extra whitespace at the end of lines, which is also a
no-no in source code.
There are vim and emacs scripts for KDE developers in kdesdk/scripts, you may
also want to see what is available there.
================================================================================
There are likely things missing here and I'll try to add them over time as I
......
......@@ -39,3 +39,5 @@ namespace ActionCollection
#endif
}
}
// vim: set et sw=4 tw=0 sta:
......@@ -43,3 +43,5 @@ namespace ActionCollection
}
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -177,3 +177,5 @@ void AdvancedSearchDialog::updateButtons()
}
#include "advancedsearchdialog.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -69,3 +69,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -168,3 +168,5 @@ void aKodePlayer::seekPosition(int position)
#include "akodeplayer.moc"
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -64,3 +64,5 @@ private:
#endif
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -291,4 +291,4 @@ bool ArtsPlayer::serverRunning() const
#endif
// vim: sw=4 ts=8 et
// vim: set et sw=4 tw=0 sta:
......@@ -92,4 +92,4 @@ private:
#endif
#endif
// vim: sw=4 ts=8 et
// vim: set et sw=4 tw=0 sta:
......@@ -321,3 +321,5 @@ void Cache::load()
FileHandle f(fileName, s);
}
}
// vim: set et sw=4 tw=0 sta:
......@@ -67,3 +67,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -64,4 +64,4 @@ QString CategoryReaderInterface::fixupTrack(const QString &track, unsigned categ
return str;
}
// vim: set et sw=4 ts=4:
// vim: set et sw=4 tw=0 sta:
......@@ -121,4 +121,4 @@ public:
#endif /* JUK_CATEGORYREADERINTERFACE_H */
// vim: set et sw=4 ts=4:
// vim: set et sw=4 tw=0 sta:
......@@ -513,3 +513,5 @@ bool CollectionListItem::checkCurrent()
}
#include "collectionlist.moc"
// vim: set et sw=4 tw=0 sta:
......@@ -198,3 +198,5 @@ private:
};
#endif
// vim: set et sw=4 tw=0 sta:
......@@ -167,4 +167,4 @@ void CoverDialog::removeSelectedCover()
#include "coverdialog.moc"
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -38,4 +38,4 @@ private slots:
#endif /* JUK_COVERDIALOG_H */
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -45,4 +45,4 @@ Q3DragObject *CoverIconView::dragObject()
return 0;
}
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -60,4 +60,4 @@ protected:
#endif /* JUK_COVERICONVIEW_H */
// vim: set et ts=4 sw=4:
// vim: set et sw=4 tw=0 sta:
......@@ -287,4 +287,4 @@ bool CoverInfo::convertOldStyleCover() const
}
}
// vim: set et sw=4 ts=8:
// vim: set et sw=4 tw=0 sta:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment