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

Re: [patch] CTRL-W_CTRL-_ enhancement

Expand Messages
  • Bram Moolenaar
    ... It has a nice idea, but I think there are quite a few situations where it doesn t work well. If the Visual selection doesn t fit in the window, doesn t
    Message 1 of 6 , Apr 5, 2009
    • 0 Attachment
      Lech Lorens wrote:

      > The attached patch enhances the behaviour of CTRL-W_CTRL-_ in visual mode.
      >
      > If CTRL-W_CTRL-_ is pressed in visual mode, Vim will try to change the
      > height of the current window to match the visual selection and scroll
      > the text so that all of the selection is visible.
      >
      > I didn't know whether to document it in visual.txt or window.txt...
      > Left it in window.txt along with documentation for the original
      > CTRL-W_CTRL-_.

      It has a nice idea, but I think there are quite a few situations where
      it doesn't work well. If the Visual selection doesn't fit in the
      window, doesn't this have the effect of changing the selected area?
      What happens if 'scrolloff' is non-zero?
      Do we want the window to become smaller? I would only want it to become
      bigger, and in a window that's already big enough the Visual selection
      would be centered.

      As Andreas mentioned, this should be put under another key, since some
      people might prefer the old behavior.

      --
      Ten million Linux users can't be wrong!

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Lech Lorens
      ... The feature is controversial and seems to raise more problems than it has solved. My need was actually decreasing the size of the window so that it would
      Message 2 of 6 , Apr 5, 2009
      • 0 Attachment
        05-04-2009 Bram Moolenaar <Bram@...>:
        >
        > It has a nice idea, but I think there are quite a few situations where
        > it doesn't work well. If the Visual selection doesn't fit in the
        > window, doesn't this have the effect of changing the selected area?
        > What happens if 'scrolloff' is non-zero?
        > Do we want the window to become smaller? I would only want it to become
        > bigger, and in a window that's already big enough the Visual selection
        > would be centered.
        >
        > As Andreas mentioned, this should be put under another key, since some
        > people might prefer the old behavior.

        The feature is controversial and seems to raise more problems than it
        has solved. My need was actually decreasing the size of the window so
        that it would show only selected information and wouldn't take too much
        space. Since I switched to using a Vim plugin I have no interest
        in developing this feature any more. Sorry for taking your time.

        --
        Cheers,
        Lech

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... With Vim as-is, you can sometimes alternate between Ctrl-W _ (which expands the current window to maximum size, or to the count provided) and Ctrl-W =
        Message 3 of 6 , Apr 5, 2009
        • 0 Attachment
          On 06/04/09 01:00, Lech Lorens wrote:
          >
          > 05-04-2009 Bram Moolenaar<Bram@...>:
          >>
          >> It has a nice idea, but I think there are quite a few situations where
          >> it doesn't work well. If the Visual selection doesn't fit in the
          >> window, doesn't this have the effect of changing the selected area?
          >> What happens if 'scrolloff' is non-zero?
          >> Do we want the window to become smaller? I would only want it to become
          >> bigger, and in a window that's already big enough the Visual selection
          >> would be centered.
          >>
          >> As Andreas mentioned, this should be put under another key, since some
          >> people might prefer the old behavior.
          >
          > The feature is controversial and seems to raise more problems than it
          > has solved. My need was actually decreasing the size of the window so
          > that it would show only selected information and wouldn't take too much
          > space. Since I switched to using a Vim plugin I have no interest
          > in developing this feature any more. Sorry for taking your time.
          >

          With Vim as-is, you can sometimes alternate between Ctrl-W _ (which
          expands the current window to maximum size, or to the count provided)
          and Ctrl-W = (which restores all windows to equal size).

          I'm conscious that this doesn't cover all possible use cases, of course;
          and personally I don't use it since (nowadays) I always expand the
          current window to maximum size (and when I want to check text from
          another window, well, I temporarily switch to that window).

          Happy Vimming!
          Tony.
          --
          Chef, n.:
          Any cook who swears in French.

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