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

Is there a tool that can compute how many keystrokes are need to modify a file to another?

Expand Messages
  • Peng Yu
    I m wondering if there is a tool that can roughly estimate how many keystrokes (in vim) are needed to modify a file to another. -- You received this message
    Message 1 of 8 , Dec 22, 2009
      I'm wondering if there is a tool that can roughly estimate how many
      keystrokes (in vim) are needed to modify a file to another.

      --
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Christophe-Marie Duquesne
      ... Well, with diff and wc, depending on what you call roughly and depending on the text editor, you may obtain a satisfying result... What about diff
      Message 2 of 8 , Dec 22, 2009
        On 12/23/2009 12:23 AM, Peng Yu wrote:
        > I'm wondering if there is a tool that can roughly estimate how many
        > keystrokes (in vim) are needed to modify a file to another.
        >
        >

        Well, with diff and wc, depending on what you call "roughly" and
        depending on the text editor, you may obtain a satisfying result...

        What about

        diff <file1> <file2> | wc --chars

        --
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • Peng Yu
        On Dec 23, 6:34 pm, Christophe-Marie Duquesne ... This is too rough. I want a tool that can at least take consideration of copy and
        Message 3 of 8 , Dec 23, 2009
          On Dec 23, 6:34 pm, Christophe-Marie Duquesne <chm.duque...@...>
          wrote:
          > On 12/23/2009 12:23 AM, Peng Yu wrote:
          >
          > > I'm wondering if there is a tool that can roughly estimate how many
          > > keystrokes (in vim) are needed to modify a file to another.
          >
          > Well, with diff and wc, depending on what you call "roughly" and
          > depending on the text editor, you may obtain a satisfying result...
          >
          > What about
          >
          > diff <file1> <file2> | wc --chars

          This is too rough.

          I want a tool that can at least take consideration of copy and paste
          (e.g. 'yy' and 'p'). Or better, given a set of commonly used vim
          editing commands, to find the optimal number of keystrokes that are
          needed to achieve the final result. Essentially, I want to evaluate
          how much time it is need to edit a given file by a human being.

          --
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
        • Gary Johnson
          ... That would be a _huge_ task with little utility. For one thing, if you have a good estimate of what the final file would look like for comparison, you
          Message 4 of 8 , Dec 23, 2009
            On 2009-12-23, Peng Yu wrote:
            > On Dec 23, 6:34 pm, Christophe-Marie Duquesne <chm.duque...@...>
            > wrote:
            > > On 12/23/2009 12:23 AM, Peng Yu wrote:
            > >
            > > > I'm wondering if there is a tool that can roughly estimate how many
            > > > keystrokes (in vim) are needed to modify a file to another.
            > >
            > > Well, with diff and wc, depending on what you call "roughly" and
            > > depending on the text editor, you may obtain a satisfying result...
            > >
            > > What about
            > >
            > > diff <file1> <file2> | wc --chars
            >
            > This is too rough.
            >
            > I want a tool that can at least take consideration of copy and paste
            > (e.g. 'yy' and 'p'). Or better, given a set of commonly used vim
            > editing commands, to find the optimal number of keystrokes that are
            > needed to achieve the final result. Essentially, I want to evaluate
            > how much time it is need to edit a given file by a human being.

            That would be a _huge_ task with little utility.

            For one thing, if you have a good estimate of what the final file
            would look like for comparison, you wouldn't need to edit the first
            file--you'd be better off starting with your estimate of the final
            file.

            Secondly, a program's determination of the "optimal" editing tasks
            is likely to be different from a person's choice.

            Thirdly, the time I spend editing a file is not spent typing--it's
            spent thinking about the meaning of the changes that I'm making.

            I think the number of keystrokes needed to edit a file is a pretty
            meaningless metric, unless you're comparing editors. You'd be
            better off measuring how long it actually takes a person of a
            similar skill set to make similar types of changes to a
            similarly-sized file.

            Regards,
            Gary


            --
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
          • Christian Brabandt
            Hi Peng! ... I don t see how that helps, cause usually there are many different ways to achieve the same result. For example you might manually change every
            Message 5 of 8 , Dec 23, 2009
              Hi Peng!

              On Mi, 23 Dez 2009, Peng Yu wrote:

              > I want a tool that can at least take consideration of copy and paste
              > (e.g. 'yy' and 'p'). Or better, given a set of commonly used vim
              > editing commands, to find the optimal number of keystrokes that are
              > needed to achieve the final result. Essentially, I want to evaluate
              > how much time it is need to edit a given file by a human being.

              I don't see how that helps, cause usually there are many different ways
              to achieve the same result. For example you might manually change every
              line and append a value while the next user simply uses a regex. Or one
              user uses a normal mode command to achieve something and the next user
              uses an ex command. Additionally using multitasking this measure is
              actually useless. I usually switch a lot between different applications
              so I would look bad on that.

              Having said that, you could probably create a script that records all
              keys pressed, but I doubt this would be useful either.

              regards,
              Christian
              --
              hundred-and-one symptoms of being an internet addict:
              33. You name your children Eudora, Mozilla and Dotcom.

              --
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
            • Dominique Pellé
              ... diff -e does that: it outputs an ed script (see man diff ). So the lengh of diff -e output gives you the number of keystrokes. Of course, it won t
              Message 6 of 8 , Dec 23, 2009
                Peng Yu wrote:

                > I'm wondering if there is a tool that can roughly estimate how many
                > keystrokes (in vim) are needed to modify a file to another.

                'diff -e' does that: it outputs an 'ed' script (see 'man diff').
                So the lengh of 'diff -e' output gives you the number of
                keystrokes.

                Of course, it won't give you the minimal number of keystrokes
                in Vim. Finding the minimal number of keystrokes would be
                quite a challenge.

                -- Dominique

                --
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
              • Paul
                ... -- . -- You received this message from the vim_use maillist. For more information, visit http://www.vim.org/maillist.php
                Message 7 of 8 , Jan 1, 2010
                  On Tue, Dec 22, 2009 at 03:23:20PM -0800, Peng Yu wrote:
                  >I'm wondering if there is a tool that can roughly estimate how many
                  >keystrokes (in vim) are needed to modify a file to another.

                  At the risk of sounding obvious, it would be however many keystrokes it takes to do this:

                  :!cp <file1> <file2>

                  --

                  .

                  --
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                • Tony Mechelynck
                  ... I suppose you aren t going to accept my solution, but if the model file is there for comparison (and if it isn t, you can t estimate the keystrokes),
                  Message 8 of 8 , Feb 19, 2010
                    On 23/12/09 00:23, Peng Yu wrote:
                    > I'm wondering if there is a tool that can roughly estimate how many
                    > keystrokes (in vim) are needed to modify a file to another.
                    >

                    I suppose you aren't going to accept my solution, but if the "model
                    file" is there for comparison (and if it isn't, you can't estimate the
                    keystrokes), then copying it over the other file is a trivial solution
                    to the problem; and on Windows that solution is O(1) on [i.e.
                    proportional to] directory tree depth, because on that OS every file or
                    directory has a "short name" no longer than 12 characters (plus one for
                    the \ separator; and the X: drive letter at the start is itself O(0),
                    thus negligible). In Vim, if both files are already open, that O(1) part
                    is already taken care of, and what remains is O(0), namely, something like

                    :n
                    :sav! #
                    :up

                    (where the last command should be :up! if the file you are trying to
                    change may be a read-only file).

                    Best regards :-P
                    Tony.
                    --
                    Pecor's Health-Food Principle:
                    Never eat rutabaga on any day of the week that has a "y" in
                    it.

                    --
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                  Your message has been successfully submitted and would be delivered to recipients shortly.