Regular expressions in VIM

An issue I often stumble across in VIM is the regular expression syntax (or “patterns” in VIM speak).

The main difference to other regular expression implementations is that some special meta-character have to be escaped to give them their special meaning. Its just the other way around; usually you would escape them to match the character itself.

Example: To match one ore more occurences of a digit you would normallry would write “\d+”. But in VIM you have to write “\d\+d” instead. This is also true for “\?” and “\{\}” patterns. See vim documenatation for more such patterns.

The behaviour can slightly be modified with the magic option.

Suchen offener Perforce-Dateien unter Windows

Alle Dateien, die unter Perforce auf die Platte gesynced werden und nicht lokal geändert wurden, haben ein Read-Only-Flag. Ausnahme: Gebranchte Dateien in einer CL, die lokal nicht geändert wurden.

Um auch ohne Perforce-Anbindung rauszufinden, welche Dateien gerade lokal geändert wurden, kann man also nach Dateien suchen, die kein Read-Only-Flag mehr haben. Unter Windows geht das so:

dir /b /d /s /a-r-d Client-Root-Verzeichnis

Wie gesagt, wenn man Dateien in einer Branch-CL offen hat, erscheinen die hier nicht!

Perforce unter Cygwin

Um ein Windows-Perforce unter Cygwin laufen zu lassen, müssen die Pfade entsprechend angepasst werden, da die Windows-Perforce-Clients für den Client-Root die Windows-Pfad-Notation verwenden.

Die Anpassung kann mit der folgenden Bash-Wrapper-Funktion angepasst werden:

[geshi lang=bash]
ntp4 ()
{
here=”`cygpath -w \”$PWD\”`”;
PWD=”$here” //c/Program\ Files/Perforce/p4 “$@”
}
[/geshi]

Quelle: http://maillist.perforce.com/pipermail/perforce-user/2001-September/006820.html

Work related to Courier-Server

I wrote this article originally back in 2005 and updated it the last time on 2007-10-14. It was originally available at http://www.georglutz.de/wiki/CourierServer.  The information you find below might be rather outdated now and I don’t plan to work on it further, but I put it in the blog for archival purposes on this particular date – Georg in June 2011.

Continue reading “Work related to Courier-Server”