From: Michael Prokop Date: Mon, 31 May 2010 16:25:04 +0000 (+0200) Subject: Rename _bkdate to insert-datestamp and enter date at cursor position instead of end... X-Git-Tag: v0.3.83~4 X-Git-Url: https://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=9db2fa1ad20f847e0162a3845ac5d7d450298b10 Rename _bkdate to insert-datestamp and enter date at cursor position instead of end of line. Thanks to Martin Krafft for the inspiration. --- 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 };