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

Re: Effect of 'equalalways' on VimResized event

Expand Messages
  • Christian Brabandt
    ... window is split or closed. However, it doesn t when the Vim window (either ... or ... inner ... proper way is, AFAIK, to insert the following in the
    Message 1 of 7 , Jul 31 7:37 AM
    • 0 Attachment
      On Mon, July 29, 2013 19:32, Seungbeom Kim wrote:
      > The 'equalalways' option makes all the windows the same size after a
      window is split or closed. However, it doesn't when the Vim window
      (either
      > the terminal or the GUI) is resized. I hear many people run [g]vimdiff
      or
      > ':vsplit', enlarge the Vim window, only to find only one of the two
      inner
      > windows is enlarged, and ask how to make them equal automatically. The
      proper way is, AFAIK, to insert the following in the .vimrc: autocmd
      VimResized * if &equalalways | wincmd = | endif
      > " To be complete, it should be enclosed by if has("autocmd")...endif. I
      wonder if the effect of 'equalalways' failing to cover the VimResized
      event was an oversight, and should be considered as a bug. Shouldn't it
      be
      > the default that windows be made the same size when 'equalalways' is on?

      One more patch.

      regards,
      Christian

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Bram Moolenaar
      [Christian, for some reason quoted long lines are wrapped badly] ... I don t think this should be the default behavior. We could add another option, or make
      Message 2 of 7 , Jul 31 11:52 AM
      • 0 Attachment
        [Christian, for some reason quoted long lines are wrapped badly]


        > On Mon, July 29, 2013 19:32, Seungbeom Kim wrote:
        > > The 'equalalways' option makes all the windows the same size after a
        > > window is split or closed. However, it doesn't when the Vim window
        > > (either
        > > the terminal or the GUI) is resized. I hear many people run [g]vimdiff or
        > > ':vsplit', enlarge the Vim window, only to find only one of the two inner
        > > windows is enlarged, and ask how to make them equal automatically. The
        > > proper way is, AFAIK, to insert the following in the .vimrc: autocmd
        > > VimResized * if &equalalways | wincmd = | endif
        > > " To be complete, it should be enclosed by if has("autocmd")...endif.
        > > I wonder if the effect of 'equalalways' failing to cover the
        > > VimResized event was an oversight, and should be considered as a bug.
        > > Shouldn't it be
        > > the default that windows be made the same size when 'equalalways' is on?
        >
        > One more patch.

        I don't think this should be the default behavior. We could add another
        option, or make the autocommand simpler.

        --
        'Well, here's something to occupy you and keep your mind off things.'
        'It won't work, I have an exceptionally large mind.'
        -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Christian Brabandt
        Hi Bram! ... Yeah, Squirrelmail messed it up. I usually reformat mails using Vim (of course! ;)), but forgot this time. [adjust Vim windows, when vim is
        Message 3 of 7 , Jul 31 12:35 PM
        • 0 Attachment
          Hi Bram!

          On Mi, 31 Jul 2013, Bram Moolenaar wrote:

          >
          > [Christian, for some reason quoted long lines are wrapped badly]

          Yeah, Squirrelmail messed it up. I usually reformat mails using Vim (of
          course! ;)), but forgot this time.

          [adjust Vim windows, when vim is resized and 'equalalways' is set]
          > > One more patch.

          > I don't think this should be the default behavior. We could add another
          > option, or make the autocommand simpler.

          Well, for what it's worth, I am always annoyed, that resizing the main
          Vim Window, messes up my carefully adjusted different windows and it
          feels logically, that when 'ea' is set, it should be respected, even
          when resizing Vim.

          It doesn't actually sound right to have yet another option, that only
          applies when a different option is set and additionally Vim is resized.
          Perhaps make 'ead' accept several option values and include a new value
          'resize'? (not sure, how complex that change would be)

          What exactly do you mean, by making the autocommand simpler?

          regards,
          Christian
          --
          Wie man sein Kind nicht nennen sollte:
          Ken Guru

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Bram Moolenaar
          ... I basically only want ea to apply when splitting a window, so that the new window gets a reasonable size. I often resize the Vim window for a moment to
          Message 4 of 7 , Aug 1, 2013
          • 0 Attachment
            Christian wrote:

            > On Mi, 31 Jul 2013, Bram Moolenaar wrote:
            >
            > >
            > > [Christian, for some reason quoted long lines are wrapped badly]
            >
            > Yeah, Squirrelmail messed it up. I usually reformat mails using Vim (of
            > course! ;)), but forgot this time.
            >
            > [adjust Vim windows, when vim is resized and 'equalalways' is set]
            > > > One more patch.
            >
            > > I don't think this should be the default behavior. We could add another
            > > option, or make the autocommand simpler.
            >
            > Well, for what it's worth, I am always annoyed, that resizing the main
            > Vim Window, messes up my carefully adjusted different windows and it
            > feels logically, that when 'ea' is set, it should be respected, even
            > when resizing Vim.
            >
            > It doesn't actually sound right to have yet another option, that only
            > applies when a different option is set and additionally Vim is resized.
            > Perhaps make 'ead' accept several option values and include a new value
            > 'resize'? (not sure, how complex that change would be)
            >
            > What exactly do you mean, by making the autocommand simpler?

            I basically only want 'ea' to apply when splitting a window, so that the
            new window gets a reasonable size. I often resize the Vim window for a
            moment to see a long line, I don't want that to mess up the window
            layout. When I put the window size back to what it was the window
            layout should be back to what it was.

            What would work better is a relative resizing. Thus if the user makes
            the Vim window 20% wider, then all split windows become 20% wider.
            Similar to what happens to the cursor line when making a window taller
            or smaller.

            Because of round-off errors Vim would need to snapshot the window layout
            before the resizing. Or perhaps floats can be used. Thus besides
            storing the absolute size of a window, the percentage of the total
            window size needs to be kept. Only needs to be udpate before doing the
            resizing.

            --
            Due knot trussed yore spell chequer two fined awl miss steaks.

            /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
            /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
            \\\ an exciting new programming language -- http://www.Zimbu.org ///
            \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Ingo Karkat
            ... FYI, I ve implemented something like this in Vimscript: My ProportionalResize plugin http://www.vim.org/scripts/script.php?script_id=4462 It would work
            Message 5 of 7 , Aug 1, 2013
            • 0 Attachment
              On 01-Aug-2013 14:16 +0200, Bram Moolenaar wrote:

              > [...]
              >
              > What would work better is a relative resizing. Thus if the user makes
              > the Vim window 20% wider, then all split windows become 20% wider.
              > Similar to what happens to the cursor line when making a window taller
              > or smaller.
              >
              > Because of round-off errors Vim would need to snapshot the window layout
              > before the resizing. Or perhaps floats can be used. Thus besides
              > storing the absolute size of a window, the percentage of the total
              > window size needs to be kept. Only needs to be udpate before doing the
              > resizing.

              FYI, I've implemented something like this in Vimscript: My
              ProportionalResize plugin

              http://www.vim.org/scripts/script.php?script_id=4462

              It would work even better if there were a VimResizedPre event. So far
              I'm snapshotting the current window dimensions only occasionally.

              -- regards, ingo

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Seungbeom Kim
              ... That would be really nice, and it is the way it really should work. That being said, what I proposed and I saw many people use is a workaround that works
              Message 6 of 7 , Aug 22, 2013
              • 0 Attachment
                On Thursday, August 1, 2013 5:16:48 AM UTC-7, Bram Moolenaar wrote:
                >
                > What would work better is a relative resizing. Thus if the user makes
                > the Vim window 20% wider, then all split windows become 20% wider.

                That would be really nice, and it is the way it really should work.

                That being said, what I proposed and I saw many people use is a
                'workaround' that works in many cases (I believe) where split windows
                have equal sizes. Because maximizing the whole window and getting
                disproportionate sizes happens more often and feels worse than having
                had split windows of unequal sizes and getting them all equalized after
                another split. (I had never thought of the latter possibility.) YMMV.

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              Your message has been successfully submitted and would be delivered to recipients shortly.