From 609f11a33c3db88a146c5b1ba3a8bb97e4d17e4f Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 20 Jun 2012 22:23:13 +0200 Subject: [PATCH] add uuid autogen for vcards --- .vim/ftplugin/vcard.vim | 3 +++ .vimrc | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 .vim/ftplugin/vcard.vim diff --git a/.vim/ftplugin/vcard.vim b/.vim/ftplugin/vcard.vim new file mode 100644 index 0000000..15ffa31 --- /dev/null +++ b/.vim/ftplugin/vcard.vim @@ -0,0 +1,3 @@ +"autocmd BufWritePre *.vcf :/^REV:/s/:.*/\=strftime(":%Y%m%dT%H%M%S%z")/ge + +nmap :%s/^UID:.*/\="UID:urn:uuid:" . split(system("uuid"))[0]/:nohlsearch diff --git a/.vimrc b/.vimrc index 2b8686a..a012169 100644 --- a/.vimrc +++ b/.vimrc @@ -1461,6 +1461,8 @@ autocmd BufWrite * normal mw " keep an extra backup of vimperator's ctrl-i autocmd BufWritePost */vimperator-*.tmp exe 'write ' . fnameescape((exists('$TMPDIR') ? $TMPDIR : '/tmp') . '/vimperator.ctrl-i.' . strftime('%Y.%m.%d.%H%M%S')) +autocmd BufRead *.vcf set filetype=vcard + " leave the i mark whenever we go idle (after updatetime) "augroup markidle "autocmd CursorHold * normal mi -- 2.39.5