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

6.0 request- : [range]so

Expand Messages
  • Ron Aaron
    It would be very handy and probably easy to implement, to allow the :so command to accept a range. The idea would be to be able to say /begin/+, /end/- so to
    Message 1 of 4 , Jul 31, 2001
    • 0 Attachment
      It would be very handy and probably easy to implement, to allow the ":so"
      command to accept a range.

      The idea would be to be able to say

      /begin/+, /end/- so

      to source a part of a file.

      Ideas?

      Ron
    • Benji Fisher
      ... Are you thinking that the line numbers (or search pattern) would apply to the :sourced file? I am not sure I like that idea: the range normally refers to
      Message 2 of 4 , Jul 31, 2001
      • 0 Attachment
        Ron Aaron wrote:
        >
        > It would be very handy and probably easy to implement, to allow the ":so"
        > command to accept a range.
        >
        > The idea would be to be able to say
        >
        > /begin/+, /end/- so
        >
        > to source a part of a file.
        >
        > Ideas?
        >
        > Ron

        Are you thinking that the line numbers (or search pattern) would apply to
        the :sourced file? I am not sure I like that idea: the range normally refers
        to lines in the current buffer. How about something along the lines of the :e
        +{cmd} syntax, like

        :source +/ThirdFunction( MyVimLib.vim

        I am not sure how best to specify the end of the desired range. Maybe

        :source +/ThirdFunction(/,/endfunction/ MyVimLib.vim

        where you could also use 2/endfunction/ to go up to the second occurrence of
        "endfunction".

        Do you have any serious applications in mind?

        --Benji Fisher
      • Walter Briscoe
        In article of Tue, 31 Jul 2001 22:20:39 in !vim-dev, Benji Fisher writes ... It looks like feature
        Message 3 of 4 , Aug 1, 2001
        • 0 Attachment
          In article <3B676777.50C46DBA@...> of Tue, 31 Jul 2001
          22:20:39 in !vim-dev, Benji Fisher <benji@...> writes
          >Ron Aaron wrote:
          >>
          >> It would be very handy and probably easy to implement, to allow the ":so"
          >> command to accept a range.
          >>
          >> The idea would be to be able to say
          >>
          >> /begin/+, /end/- so
          >>
          >> to source a part of a file.
          >>
          >> Ideas?
          >>
          >> Ron
          >
          > Are you thinking that the line numbers (or search pattern) would apply to
          >the :sourced file? I am not sure I like that idea: the range normally refers
          >to lines in the current buffer. How about something along the lines of the :e
          >+{cmd} syntax, like

          It looks like feature bloat to me. I would do that via a window for that
          file. I imagine that Ron could cook up a function to encapsulate the
          requirement. What advantages would such a command offer? How frequently
          would it be used? I can't imagine using it often enough to justify
          remembering it.
          --
          Walter Briscoe
        • Ron Aaron
          ... I have a mapping to scoop up parts of a vim file and source them. e.g., I ll visually highlight some lines, press ;x and the text that was hl gets
          Message 4 of 4 , Aug 1, 2001
          • 0 Attachment
            >
            > Do you have any serious applications in mind?
            >
            > --Benji Fisher
            >

            I have a mapping to scoop up parts of a vim file and source them. e.g.,
            I'll visually highlight some lines, press ;x and the text that was hl gets
            executed.

            This is very useful, and it would be nice if it could be done more simply
            than how I do it (e.g. destroying a register, etc.).

            Ron
          Your message has been successfully submitted and would be delivered to recipients shortly.