From: martin f. krafft Date: Wed, 20 Jun 2012 20:23:13 +0000 (+0200) Subject: add uuid autogen for vcards X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/609f11a33c3db88a146c5b1ba3a8bb97e4d17e4f?ds=inline add uuid autogen for vcards --- 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