From 9db2fa1ad20f847e0162a3845ac5d7d450298b10 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 31 May 2010 18:25:04 +0200 Subject: [PATCH] Rename _bkdate to insert-datestamp and enter date at cursor position instead of end of line. Thanks to Martin Krafft for the inspiration. --- etc/zsh/zshrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 430d9a7..a1853f3 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -906,11 +906,11 @@ if is4 && [[ -n ${(k)modules[zsh/complist]} ]] ; then fi # press "ctrl-e d" to insert the actual date in the form yyyy-mm-dd -_bkdate() { BUFFER="$BUFFER$(date '+%F')"; CURSOR=$#BUFFER; } -zle -N _bkdate +insert-datestamp() { LBUFFER+=${(%):-'%D{%Y-%m-%d}'}; } +zle -N insert-datestamp #k# Insert a timestamp on the command line (yyyy-mm-dd) -bindkey '^Ed' _bkdate +bindkey '^Ed' insert-datestamp # press esc-m for inserting last typed word again (thanks to caphuso!) insert-last-typed-word() { zle insert-last-word -- 0 -1 }; -- 2.1.4