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

Re: Feature request: more sophisticated command-line history

Expand Messages
  • Thomas Köhler
    ... I disagree. I tend to use this as a feature: For example, I use ... Now when I want cmd2, I type :% , but when I want cmd1, I type ... Oh well. YAO? :-)
    Message 1 of 9 , Apr 4 4:55 AM
      Gavin Sinclair wrote [020404 14:32]:
      > Say you enter this command:
      >
      > :'<,'>cmd
      >
      > Now the cursor is in some other place and you wish to apply the
      > same command over 4 lines. You type 4:c to get
      >
      > :.,.+3c
      >
      > When you hit <Up>, the command-line should complete to:
      >
      > :.,.+3cmd
      >
      > That is, vim should not consider the RANGE as part of the
      > COMMAND for the sake of completing a command based on history.
      >
      > Agree? Disagree? Either way, I hope this description is clear.

      I disagree. I tend to use this as a feature: For example, I use
      :1,$cmd1
      :%cmd2

      Now when I want cmd2, I type :%<UP>, but when I want cmd1, I type
      :1<UP> :-)

      Oh well. YAO? :-)

      > PS. Should this be sent to the general or development mailing list?

      It's in the right place on the development mailing list.

      Ciao,
      Thomas

      --
      Thomas Köhler Email: jean-luc@... | LCARS - Linux
      <>< WWW: http://jeanluc-picard.de | for Computers
      IRC: jeanluc | on All Real
      PGP public key available from Homepage! | Starships
    • Preben Guldberg
      ... I don t like it too much. Perhaps I just can t seperate the two enough. Besides the point that a range in itself is a command, I m not sure how you would
      Message 2 of 9 , Apr 4 5:23 AM
        Thus wrote Gavin Sinclair (gsinclair@...) on [020404]:

        > That is, vim should not consider the RANGE as part of the COMMAND for the sake of completing a command based on history.

        I don't like it too much. Perhaps I just can't seperate the two enough.

        Besides the point that a range in itself is a command, I'm not sure
        how you would handle partly finished ranges like

        :1
        :1/foo/
        :1,/foo/
        :1,$-

        Ranges can be as significant as commands, so I would not like to miss
        out on range completion for eg.

        :0/^$/+2,/^-- $/?.?

        Peppe
        --
        "Before you criticize someone, walk
        Preben "Peppe" Guldberg __/-\__ a mile in his shoes. That way, if
        c928400@... (o o) he gets angry, he'll be a mile away
        ----------------------oOOo (_) oOOo-- - and barefoot." --Sarah Jackson
      • Gavin Sinclair
        Fair enough; I must say I haven t really explored the command window. In fact I find it an annoyance when it pops up when I least expect it. However, the
        Message 3 of 9 , Apr 4 5:24 AM
          Fair enough; I must say I haven't really explored the command window. In
          fact I find it an annoyance when it pops up when I least expect it.

          However, the point of the command-line history is that you don't *have* to
          find the previous command. Editing the range is fiddly as well.

          The mental process for entering most commands is:
          - enter the range
          - start entering the command
          - complete it, *hoping that it will match a previous range*

          My point is that I should be able to complete it without having to hope for
          a match.

          Ask yourself. Are the following commands really that different that they
          shouldn't be 'grouped' in the history:
          :'<,'>normal 3Wf"dt"A = "^V^P^[
          :'%normal 3Wf"dt"A = "^V^P^[
          :.,.+3normal 3Wf"dt"A = "^V^P^[
          :5,9normal 3Wf"dt"A = "^V^P^[
          :.,/}/normal 3Wf"dt"A = "^V^P^[

          Vim should make logical things logical, not merely possible. Having entered
          a complicated command (the source of great power in vim), you should be able
          to recall that command with a different range in a *logical* way. Thus,
          given that I have entered the above commands, I should be able to enter it
          again, with a different range, by typing the following:

          :.,.+7no<Up>


          --Gavin

          ----- Original Message -----
          From: "Vince Negri" <vnegri@...>
          To: "'Gavin Sinclair'" <gsinclair@...>; <vim-dev@...>
          Sent: Thursday, April 04, 2002 10:42 PM
          Subject: RE: Feature request: more sophisticated command-line history


          > Why not use the command window (entered with q: )?
          >
          > Just locate the previous command, edit the range, and bingo..
          >
          >
        • Gavin Sinclair
          Fair point. However, my request is quite logical. Ranges should not be considered part of commands. If you mean that a range by itself takes you to the
          Message 4 of 9 , Apr 4 5:31 AM
            Fair point. However, my request is quite logical. Ranges should not be
            considered part of commands. If you mean that a range by itself takes you
            to the given line, then this can be explained another way - i.e. the command
            is absent.

            Your retort about partially completed ranges is good, and also logical. I'm
            sure there must be a way to address it, though. If there's any support for
            the deature, that is!

            The difference between your usage and mine, I expect, is that you like to
            specify complex ranges up front to achieve everything you want your ex
            command to so, whereas I prefer complex commands with simple ranges, so I
            can easily verify their effect, and I know I can easily repeat the command
            with a different range.

            Gavin

            ----- Original Message -----
            From: "Preben Guldberg" <c928400@...>
            To: <vim-dev@...>
            Sent: Thursday, April 04, 2002 11:23 PM
            Subject: Re: Feature request: more sophisticated command-line history


            > Thus wrote Gavin Sinclair (gsinclair@...) on [020404]:
            >
            > > That is, vim should not consider the RANGE as part of the COMMAND for
            the sake of completing a command based on history.
            >
            > I don't like it too much. Perhaps I just can't seperate the two enough.
            >
            > Besides the point that a range in itself is a command, I'm not sure
            > how you would handle partly finished ranges like
            >
            > :1
            > :1/foo/
            > :1,/foo/
            > :1,$-
            >
            > Ranges can be as significant as commands, so I would not like to miss
            > out on range completion for eg.
            >
            > :0/^$/+2,/^-- $/?.?
            >
            > Peppe
            > --
            > "Before you criticize someone, walk
            > Preben "Peppe" Guldberg __/-\__ a mile in his shoes. That way, if
            > c928400@... (o o) he gets angry, he'll be a mile away
            > ----------------------oOOo (_) oOOo-- - and barefoot." --Sarah Jackson
          • Gavin Sinclair
            Having reread my other post on the matter, I propse the following way to deal with partial ranges: - if a command has been started, complete that command
            Message 5 of 9 , Apr 4 5:34 AM
              Having reread my other post on the matter, I propse the following way to
              deal with partial ranges:
              - if a command has been started, complete that command regardless of its
              previous range (as I want)
              - if a command has not been started (or is ambiguous), complete a
              range+command

              This is not taking any functionality away from anyone. People can still
              enter a range and have it complete all commands that used that range before.

              ----- Original Message -----
              From: "Preben Guldberg" <c928400@...>
              To: <vim-dev@...>
              Sent: Thursday, April 04, 2002 11:23 PM
              Subject: Re: Feature request: more sophisticated command-line history


              > Thus wrote Gavin Sinclair (gsinclair@...) on [020404]:
              >
              > > That is, vim should not consider the RANGE as part of the COMMAND for
              the sake of completing a command based on history.
              >
              > I don't like it too much. Perhaps I just can't seperate the two enough.
              >
              > Besides the point that a range in itself is a command, I'm not sure
              > how you would handle partly finished ranges like
              >
              > :1
              > :1/foo/
              > :1,/foo/
              > :1,$-
              >
              > Ranges can be as significant as commands, so I would not like to miss
              > out on range completion for eg.
              >
              > :0/^$/+2,/^-- $/?.?
              >
              > Peppe
              > --
              > "Before you criticize someone, walk
              > Preben "Peppe" Guldberg __/-\__ a mile in his shoes. That way, if
              > c928400@... (o o) he gets angry, he'll be a mile away
              > ----------------------oOOo (_) oOOo-- - and barefoot." --Sarah Jackson
            • Gavin Sinclair
              ... From: Thomas Köhler ... I disagree. I tend to use this as a feature: For example, I use ... Now when I want cmd2, I type
              Message 6 of 9 , Apr 4 5:37 AM
                ----- Original Message -----
                From: "Thomas Köhler" <jean-luc@...>

                > Agree? Disagree? Either way, I hope this description is clear.

                I disagree. I tend to use this as a feature: For example, I use
                :1,$cmd1
                :%cmd2

                Now when I want cmd2, I type :%<UP>, but when I want cmd1, I type
                :1<UP> :-)

                Oh well. YAO? :-)

                [ END PREVIOUS POST ]


                Hmmm.... great for whole-of-buffer commands, but a bit limited beyond that!

                Gavin
              • Thomas Köhler
                ... Depends. ... Quite different at the beginning, eh? :-) ... Ciao, Thomas -- Thomas Köhler Email: jean-luc@picard.franken.de | LCARS - Linux
                Message 7 of 9 , Apr 4 1:28 PM
                  Gavin Sinclair wrote [020404 15:40]:
                  > ----- Original Message -----
                  > From: "Thomas Köhler" <jean-luc@...>
                  >
                  > > > Agree? Disagree? Either way, I hope this description is clear.
                  > >
                  > > I disagree. I tend to use this as a feature: For example, I use
                  > > :1,$cmd1
                  > > :%cmd2
                  > >
                  > > Now when I want cmd2, I type :%<UP>, but when I want cmd1, I type
                  > > :1<UP> :-)
                  > >
                  > > Oh well. YAO? :-)
                  >
                  > [ END PREVIOUS POST ]
                  >
                  >
                  > Hmmm.... great for whole-of-buffer commands, but a bit limited
                  > beyond that!

                  Depends.

                  :5,10cmd1
                  :4+1,10cmd2

                  Quite different at the beginning, eh? :-)

                  > Gavin

                  Ciao,
                  Thomas

                  --
                  Thomas Köhler Email: jean-luc@... | LCARS - Linux
                  <>< WWW: http://jeanluc-picard.de | for Computers
                  IRC: jeanluc | on All Real
                  PGP public key available from Homepage! | Starships
                Your message has been successfully submitted and would be delivered to recipients shortly.