From 5860c6f16529009208220c9d1cc482e58f995c27 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 6 Aug 2012 23:25:30 -0500 Subject: [PATCH] personal: tweak #d to allow different email addresses --- plugin/00-dustin.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugin/00-dustin.vim b/plugin/00-dustin.vim index 5e4e964..9af3934 100644 --- a/plugin/00-dustin.vim +++ b/plugin/00-dustin.vim @@ -33,7 +33,18 @@ inoremap jj inoremap " Replace #d with a signature comment line -iab #d "# Dustin C. Hatch (" . strftime("%d %b %Y") . ")" +if !exists('my_email') + if exists('$USER') + let user = $USER + elseif exists('$USERNAME') + let user = $USERNAME + else + let user = 'dustin' + endif + let my_email = user . '@' . hostname() + unlet user +endif +iab #d "# Dustin C. Hatch <" . my_email . "> (" . strftime("%d %b %Y") . ")" " Platform specific stuff if has('win32')