Loading ...
Sorry, an error occurred while loading the content.

93722Re: time spent editing a file

Expand Messages
  • Richard Hartmann
    Jul 30, 2008
      On Tue, Jul 29, 2008 at 00:48, Marc Fournier <fournie@...> wrote:

      > I'm wondering if there is a way to know since when or for how long I
      > have been editing the current file (better: have this fact displayed
      > in the statusbar, like when typing CTRL-G).

      No idea if that ties into the way you work, but with ZSH, I am doing
      something similar, only for all programs I run from the shell. And yes,
      I am not converting seconds to anything, but that is personal
      preference.

      As always, beware evil GMail linebreaks.


      Richard



      preexec () {
      ZSHRC_LAST_TIME=$SECONDS
      ZSHRC_LAST_EXECUTE="1"
      }

      precmd () {
      buildRPS1
      }

      buildRPS1 () {
      autoload colors
      colors
      RPS1="%(?..%{$fg_bold[grey]%}[%{$fg_no_bold[red]%}%U%?%u%{$fg_bold[grey]%}]%{$fg_no_bold[default]%})
      "
      if [[ $ZSHRC_LAST_EXECUTE -eq 1 ]]
      then
      ZSHRC_NEW_TIME=$((SECONDS - ZSHRC_LAST_TIME))
      ZSHRC_LAST_EXECUTE="0"
      RPS1+="$ZSHRC_NEW_TIME "
      fi
      RPS1+="%h %D{%T %a %e.%m.%Y}"
      }

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Show all 15 messages in this topic