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

Permanent Splits

Expand Messages
  • Martin Donlon
    Is there any way to specify that a split or a window should be permanent or unremovable? In certain situations I have windows set up in a certain way but I
    Message 1 of 10 , Oct 18, 2004
    • 0 Attachment
      Is there any way to specify that a split or a window should be permanent
      or unremovable? In certain situations I have windows set up in a certain
      way but I usually end up deleting them accidentally. Maybe I should just
      be more careful....

      --
      Martin - http://akawaka.csn.ul.ie/
      "Bother" said Pooh when he was arrested for dealing in dust on the zocalo.
    • Dave Silvia
      Yes, I ve made similar inquiries for different reasons. But, the question remains. Mostly there are only events and win parameters. WinEnter WinLeave
      Message 2 of 10 , Oct 18, 2004
      • 0 Attachment
        Yes, I've made similar inquiries for different reasons. But, the question
        remains. Mostly there are only events and win parameters.

        WinEnter
        WinLeave
        BufWinEnter
        BufWinLeave

        winheight
        winwidth
        winminheight
        winminwidth
        winfixheight

        And these are quite limited. For instance, the win[min|fix][height|width]
        can all be overridden. In short, no, it would seem there is no way to
        specify a window and its size and location and keep it that way (at least
        not permanently and not easily).

        Yes, it would be nice to be able to say to Vim 'I want window #1 at the
        bottom, x-cols by y-rows permanently until specifically changed/deleted
        (i.e., not accidentally)'

        Also, since window numbering is a function not of a specific window, but of
        the current number of windows from top-left to bottom-right, it would be
        nice to have a way to 'label' a window (not necessarily by the buffer it
        contains) and keep window label 'top-left' as #1 if you so desire. Maybe
        something like:

        let winlabel1='top-left'
        set winnr(1)=winlabel1

        So that winlabel1 is always #1, top-left, regardless of new windows and/or
        any contents. Of course, that implies being able to set a buffer to be the
        contents of winlabel1 until unset or changed.

        It would seem there is not a lot one can do to manage windows in Vim yet.

        MfG,
        Dave S.

        -----Original Message-----
        From: Martin Donlon [mailto:akawaka@...]
        Sent: Monday, October 18, 2004 9:31 PM
        To: vim@...
        Subject: Permanent Splits

        Is there any way to specify that a split or a window should be permanent
        or unremovable? In certain situations I have windows set up in a certain
        way but I usually end up deleting them accidentally. Maybe I should just
        be more careful....

        --
        Martin - http://akawaka.csn.ul.ie/
        "Bother" said Pooh when he was arrested for dealing in dust on the zocalo.
      • Hari Krishna Dara
        ... It is theoretically possible to give persistent labels to windows. All that you have to do is give your own numbering, something like: let w:myWindowNumber
        Message 3 of 10 , Oct 19, 2004
        • 0 Attachment
          On Mon, 18 Oct 2004 at 11:56pm, Dave Silvia wrote:

          > Yes, I've made similar inquiries for different reasons. But, the question
          > remains. Mostly there are only events and win parameters.
          >
          > WinEnter
          > WinLeave
          > BufWinEnter
          > BufWinLeave
          >
          > winheight
          > winwidth
          > winminheight
          > winminwidth
          > winfixheight
          >
          > And these are quite limited. For instance, the win[min|fix][height|width]
          > can all be overridden. In short, no, it would seem there is no way to
          > specify a window and its size and location and keep it that way (at least
          > not permanently and not easily).
          >
          > Yes, it would be nice to be able to say to Vim 'I want window #1 at the
          > bottom, x-cols by y-rows permanently until specifically changed/deleted
          > (i.e., not accidentally)'
          >
          > Also, since window numbering is a function not of a specific window, but of
          > the current number of windows from top-left to bottom-right, it would be
          > nice to have a way to 'label' a window (not necessarily by the buffer it
          > contains) and keep window label 'top-left' as #1 if you so desire. Maybe
          > something like:
          >
          > let winlabel1='top-left'
          > set winnr(1)=winlabel1
          >
          > So that winlabel1 is always #1, top-left, regardless of new windows and/or
          > any contents. Of course, that implies being able to set a buffer to be the
          > contents of winlabel1 until unset or changed.
          >
          > It would seem there is not a lot one can do to manage windows in Vim yet.
          >
          > MfG,
          > Dave S.

          It is theoretically possible to give persistent labels to windows. All
          that you have to do is give your own numbering, something like:

          let w:myWindowNumber = winnr()

          Once initialized, it will ensure that the value is not changed, and
          allows you to detect the windows when they are rearranged. The variable
          is not lost or changed simply because the buffer is changed or the
          window is moved around. At the same time, it is lost, if you close the
          window and reopen the same buffer in a new window. So if you try hard
          enough, you can create a workging script which will first label the
          existing windows, and on demand can rearrange, resize and reopen the
          closed windows (by detecting the labels that are missing).

          The biggest problem to solve is however rearranging/resizing. Vim
          doesn't have full set of commands to rearrange the window order without
          first closing and recreating them (it might however be possible to first
          order all of them in a row/column and then move them around, but it
          involves some mathematical solution, I guess). Setting the sizes
          accurately is also impossible in complex arrangement (because resizing
          some windows automatically resize other windows too). I have been
          collecting and writing building blocks for window management in my
          genutils.vim plugin and hope to write a useful window management script
          in the future (especially that more and more scripts are written to
          open temporary windows).

          --
          HTH,
          Hari

          >
          > -----Original Message-----
          > From: Martin Donlon [mailto:akawaka@...]
          > Sent: Monday, October 18, 2004 9:31 PM
          > To: vim@...
          > Subject: Permanent Splits
          >
          > Is there any way to specify that a split or a window should be permanent
          > or unremovable? In certain situations I have windows set up in a certain
          > way but I usually end up deleting them accidentally. Maybe I should just
          > be more careful....
          >
          > --
          > Martin - http://akawaka.csn.ul.ie/
          > "Bother" said Pooh when he was arrested for dealing in dust on the zocalo.
          >
          >
          >



          _______________________________
          Do you Yahoo!?
          Declare Yourself - Register online to vote today!
          http://vote.yahoo.com
        • Dave Silvia
          ... Yes, but without an event to tell you the windows have been rearranged, how do you go about finding out? Polling? Very expensive! Capture all possible
          Message 4 of 10 , Oct 20, 2004
          • 0 Attachment
            >let w:myWindowNumber = winnr()
            >
            >Once initialized, it will ensure that the value is not changed, and
            >allows you to detect the windows when they are rearranged.

            Yes, but without an event to tell you the windows have been rearranged, how
            do you go about finding out? Polling? Very expensive! Capture all
            possible events? Again, expensive, and not foolproof.

            It would be nice if there were more window mgmt events in Vim, IMHO. (and
            one for modes would be nice, too).

            MfG,
            Dave S.

            -----Original Message-----
            From: Hari Krishna Dara [mailto:hari_vim@...]
            Sent: Tuesday, October 19, 2004 3:24 PM
            To: Dave Silvia
            Cc: Martin Donlon; vim@...
            Subject: RE: Permanent Splits


            On Mon, 18 Oct 2004 at 11:56pm, Dave Silvia wrote:

            > Yes, I've made similar inquiries for different reasons. But, the question
            > remains. Mostly there are only events and win parameters.
            >
            > WinEnter
            > WinLeave
            > BufWinEnter
            > BufWinLeave
            >
            > winheight
            > winwidth
            > winminheight
            > winminwidth
            > winfixheight
            >
            > And these are quite limited. For instance, the win[min|fix][height|width]
            > can all be overridden. In short, no, it would seem there is no way to
            > specify a window and its size and location and keep it that way (at least
            > not permanently and not easily).
            >
            > Yes, it would be nice to be able to say to Vim 'I want window #1 at the
            > bottom, x-cols by y-rows permanently until specifically changed/deleted
            > (i.e., not accidentally)'
            >
            > Also, since window numbering is a function not of a specific window, but
            of
            > the current number of windows from top-left to bottom-right, it would be
            > nice to have a way to 'label' a window (not necessarily by the buffer it
            > contains) and keep window label 'top-left' as #1 if you so desire. Maybe
            > something like:
            >
            > let winlabel1='top-left'
            > set winnr(1)=winlabel1
            >
            > So that winlabel1 is always #1, top-left, regardless of new windows and/or
            > any contents. Of course, that implies being able to set a buffer to be
            the
            > contents of winlabel1 until unset or changed.
            >
            > It would seem there is not a lot one can do to manage windows in Vim yet.
            >
            > MfG,
            > Dave S.

            It is theoretically possible to give persistent labels to windows. All
            that you have to do is give your own numbering, something like:

            let w:myWindowNumber = winnr()

            Once initialized, it will ensure that the value is not changed, and
            allows you to detect the windows when they are rearranged. The variable
            is not lost or changed simply because the buffer is changed or the
            window is moved around. At the same time, it is lost, if you close the
            window and reopen the same buffer in a new window. So if you try hard
            enough, you can create a workging script which will first label the
            existing windows, and on demand can rearrange, resize and reopen the
            closed windows (by detecting the labels that are missing).

            The biggest problem to solve is however rearranging/resizing. Vim
            doesn't have full set of commands to rearrange the window order without
            first closing and recreating them (it might however be possible to first
            order all of them in a row/column and then move them around, but it
            involves some mathematical solution, I guess). Setting the sizes
            accurately is also impossible in complex arrangement (because resizing
            some windows automatically resize other windows too). I have been
            collecting and writing building blocks for window management in my
            genutils.vim plugin and hope to write a useful window management script
            in the future (especially that more and more scripts are written to
            open temporary windows).

            --
            HTH,
            Hari

            >
            > -----Original Message-----
            > From: Martin Donlon [mailto:akawaka@...]
            > Sent: Monday, October 18, 2004 9:31 PM
            > To: vim@...
            > Subject: Permanent Splits
            >
            > Is there any way to specify that a split or a window should be permanent
            > or unremovable? In certain situations I have windows set up in a certain
            > way but I usually end up deleting them accidentally. Maybe I should just
            > be more careful....
            >
            > --
            > Martin - http://akawaka.csn.ul.ie/
            > "Bother" said Pooh when he was arrested for dealing in dust on the zocalo.
            >
            >
            >



            _______________________________
            Do you Yahoo!?
            Declare Yourself - Register online to vote today!
            http://vote.yahoo.com
          • Hari Krishna Dara
            ... Yes, you are right, there doesn t seem to be a way to detect a rearrangement, even by monitoring all the events. But, by demand I meant by demand from
            Message 5 of 10 , Oct 20, 2004
            • 0 Attachment
              On Wed, 20 Oct 2004 at 2:38pm, Dave Silvia wrote:

              > >let w:myWindowNumber = winnr()
              > >
              > >Once initialized, it will ensure that the value is not changed, and
              > >allows you to detect the windows when they are rearranged.
              >
              > Yes, but without an event to tell you the windows have been rearranged, how
              > do you go about finding out? Polling? Very expensive! Capture all
              > possible events? Again, expensive, and not foolproof.
              >
              > It would be nice if there were more window mgmt events in Vim, IMHO. (and
              > one for modes would be nice, too).
              >
              > MfG,
              > Dave S.
              >
              > -----Original Message-----
              > From: Hari Krishna Dara [mailto:hari_vim@...]
              > Sent: Tuesday, October 19, 2004 3:24 PM
              > To: Dave Silvia
              > Cc: Martin Donlon; vim@...
              > Subject: RE: Permanent Splits
              >
              >
              > On Mon, 18 Oct 2004 at 11:56pm, Dave Silvia wrote:
              >
              > > Yes, I've made similar inquiries for different reasons. But, the question
              > > remains. Mostly there are only events and win parameters.
              > >
              > > WinEnter
              > > WinLeave
              > > BufWinEnter
              > > BufWinLeave
              > >
              > > winheight
              > > winwidth
              > > winminheight
              > > winminwidth
              > > winfixheight
              > >
              > > And these are quite limited. For instance, the win[min|fix][height|width]
              > > can all be overridden. In short, no, it would seem there is no way to
              > > specify a window and its size and location and keep it that way (at least
              > > not permanently and not easily).
              > >
              > > Yes, it would be nice to be able to say to Vim 'I want window #1 at the
              > > bottom, x-cols by y-rows permanently until specifically changed/deleted
              > > (i.e., not accidentally)'
              > >
              > > Also, since window numbering is a function not of a specific window, but
              > of
              > > the current number of windows from top-left to bottom-right, it would be
              > > nice to have a way to 'label' a window (not necessarily by the buffer it
              > > contains) and keep window label 'top-left' as #1 if you so desire. Maybe
              > > something like:
              > >
              > > let winlabel1='top-left'
              > > set winnr(1)=winlabel1
              > >
              > > So that winlabel1 is always #1, top-left, regardless of new windows and/or
              > > any contents. Of course, that implies being able to set a buffer to be
              > the
              > > contents of winlabel1 until unset or changed.
              > >
              > > It would seem there is not a lot one can do to manage windows in Vim yet.
              > >
              > > MfG,
              > > Dave S.
              >
              > It is theoretically possible to give persistent labels to windows. All
              > that you have to do is give your own numbering, something like:
              >
              > let w:myWindowNumber = winnr()
              >
              > Once initialized, it will ensure that the value is not changed, and
              > allows you to detect the windows when they are rearranged. The variable
              > is not lost or changed simply because the buffer is changed or the
              > window is moved around. At the same time, it is lost, if you close the
              > window and reopen the same buffer in a new window. So if you try hard
              > enough, you can create a workging script which will first label the
              > existing windows, and on demand can rearrange, resize and reopen the
              > closed windows (by detecting the labels that are missing).
              >
              > The biggest problem to solve is however rearranging/resizing. Vim
              > doesn't have full set of commands to rearrange the window order without
              > first closing and recreating them (it might however be possible to first
              > order all of them in a row/column and then move them around, but it
              > involves some mathematical solution, I guess). Setting the sizes
              > accurately is also impossible in complex arrangement (because resizing
              > some windows automatically resize other windows too). I have been
              > collecting and writing building blocks for window management in my
              > genutils.vim plugin and hope to write a useful window management script
              > in the future (especially that more and more scripts are written to
              > open temporary windows).
              >
              > --
              > HTH,
              > Hari
              >
              > >
              > > -----Original Message-----
              > > From: Martin Donlon [mailto:akawaka@...]
              > > Sent: Monday, October 18, 2004 9:31 PM
              > > To: vim@...
              > > Subject: Permanent Splits
              > >
              > > Is there any way to specify that a split or a window should be permanent
              > > or unremovable? In certain situations I have windows set up in a certain
              > > way but I usually end up deleting them accidentally. Maybe I should just
              > > be more careful....
              > >


              Yes, you are right, there doesn't seem to be a way to detect a
              rearrangement, even by monitoring all the events. But, "by demand" I
              meant "by demand from the user". I was referring more to having window
              management commands, but you have a valid point.

              --
              Thanks,
              Hari



              _______________________________
              Do you Yahoo!?
              Declare Yourself - Register online to vote today!
              http://vote.yahoo.com
            • Keith Roberts
              ... Any plugins which create new windows *must* therefore screw up you window setup. :) ... You have some nice ideas there, Hari. What I think would help most
              Message 6 of 10 , Oct 28, 2004
              • 0 Attachment
                >-----Original Message-----
                >From: Hari Krishna Dara [mailto:hari_vim@...]
                >Sent: Tuesday, October 19, 2004 12:24 PM
                >To: Dave Silvia
                >Cc: Martin Donlon; vim@...
                >Subject: RE: Permanent Splits
                >
                >
                >On Mon, 18 Oct 2004 at 11:56pm, Dave Silvia wrote:
                >
                >> [snip] In short, no, it
                >> would seem there is no way to specify a window and its size and
                >> location and keep it that way (at least not permanently and
                >not easily).
                >>
                >> Yes, it would be nice to be able to say to Vim 'I want window #1 at
                >> the bottom, x-cols by y-rows permanently until specifically
                >> changed/deleted (i.e., not accidentally)'
                >>
                >> Also, since window numbering is a function not of a specific window,
                >> but of the current number of windows from top-left to
                >bottom-right, it
                >> would be nice to have a way to 'label' a window (not necessarily by
                >> the buffer it
                >> contains) and keep window label 'top-left' as #1 if you so desire.
                >> Maybe something like:
                >>
                >> let winlabel1='top-left'
                >> set winnr(1)=winlabel1
                >>
                >> So that winlabel1 is always #1, top-left, regardless of new windows
                >> and/or any contents. Of course, that implies being able to set a
                >> buffer to be the contents of winlabel1 until unset or changed.

                The problem is that there are only 2 places to create a window:
                :aboveleft/:belowright and :topleft/:bottomright

                Any plugins which create new windows *must* therefore screw up you
                window setup. :)

                >> It would seem there is not a lot one can do to manage
                >windows in Vim yet.
                >>
                >> MfG,
                >> Dave S.
                >
                >It is theoretically possible to give persistent labels to
                >windows. All that you have to do is give your own numbering,
                >something like:
                >
                >let w:myWindowNumber = winnr()
                >
                >Once initialized, it will ensure that the value is not
                >changed, and allows you to detect the windows when they are
                >rearranged. The variable is not lost or changed simply because
                >the buffer is changed or the window is moved around. At the
                >same time, it is lost, if you close the window and reopen the
                >same buffer in a new window. So if you try hard enough, you
                >can create a workging script which will first label the
                >existing windows, and on demand can rearrange, resize and
                >reopen the closed windows (by detecting the labels that are missing).
                >
                >The biggest problem to solve is however rearranging/resizing.
                >Vim doesn't have full set of commands to rearrange the window
                >order without first closing and recreating them (it might
                >however be possible to first order all of them in a row/column
                >and then move them around, but it involves some mathematical
                >solution, I guess). Setting the sizes accurately is also
                >impossible in complex arrangement (because resizing some
                >windows automatically resize other windows too). I have been
                >collecting and writing building blocks for window management
                >in my genutils.vim plugin and hope to write a useful window
                >management script in the future (especially that more and more
                >scripts are written to open temporary windows).
                >
                >--
                >HTH,
                >Hari

                You have some nice ideas there, Hari. What I think would help most are
                two commands which save_window_setup and restore_window_setup. The info
                saved would include window placement, size, etc., so that the windows
                can be restored EXACTLY as they were when saved. Now this runs into the
                issue of whether any new windows created in the meantime are modified
                and not hidden, but that's soluble. :) This would, after all, be
                primarily for script writers who should be cleaning that stuff up
                anyway. Any buffers they create should either be No_file, hidden or
                written out.

                -Keith
              • Antoine J. Mechelynck
                Keith Roberts wrote: [...] ... [...] The way I count, that s more than two: -1- :to[pleft] -- above everything -2-
                Message 7 of 10 , Oct 28, 2004
                • 0 Attachment
                  Keith Roberts <kroberts@...> wrote:
                  [...]
                  > The problem is that there are only 2 places to create a window:
                  > :aboveleft/:belowright and :topleft/:bottomright
                  [...]

                  The way I count, that's more than two:

                  -1- :to[pleft] -- above everything
                  -2- :vert[ical] to[pleft] -- to the left of everything
                  -3- :bo[tright] -- below everything
                  -4- :vert[ical] bo[tright] -- to the right of everything
                  -5- :abo[veleft] -- immediately above current window
                  -6- :vert[ical] lefta[bove] -- immediately to the left of
                  current window
                  -7- :bel[owright] -- immediately below current window
                  -8- :vert[ical] rightb[elow] -- immediately to the right of
                  current window

                  In the latter half of the above cases, make the proper "mother" window
                  current just before splitting and you get quite fine control on how the
                  split happens.

                  Just my 0.02 €
                  Tony.
                • Keith Roberts
                  ... I won t pick nits, but that s still essentially 2 ways, reducing it to the kernel of functionality :) 1) top or bottom of the primary horizontal stack
                  Message 8 of 10 , Oct 29, 2004
                  • 0 Attachment
                    >-----Original Message-----
                    >From: Antoine J. Mechelynck [mailto:antoine.mechelynck@...]
                    >Sent: Thursday, October 28, 2004 3:19 PM
                    >To: Keith Roberts; Hari Krishna Dara; Dave Silvia
                    >Cc: Martin Donlon; vim@...
                    >Subject: Re: Permanent Splits
                    >
                    >Keith Roberts <kroberts@...> wrote:
                    >[...]
                    >> The problem is that there are only 2 places to create a window:
                    >> :aboveleft/:belowright and :topleft/:bottomright
                    >[...]
                    >
                    >The way I count, that's more than two:
                    >
                    > -1- :to[pleft] -- above everything
                    > -2- :vert[ical] to[pleft] -- to the left of everything
                    > -3- :bo[tright] -- below everything
                    > -4- :vert[ical] bo[tright] -- to the right of everything
                    > -5- :abo[veleft] -- immediately above current window
                    > -6- :vert[ical] lefta[bove] -- immediately to the left of
                    >current window
                    > -7- :bel[owright] -- immediately below current window
                    > -8- :vert[ical] rightb[elow] -- immediately to
                    >the right of
                    >current window
                    >
                    >In the latter half of the above cases, make the proper
                    >"mother" window current just before splitting and you get
                    >quite fine control on how the split happens.
                    >
                    >Just my 0.02 €
                    >Tony.


                    I won't pick nits, but that's still essentially 2 ways, reducing it to the kernel of functionality :)

                    1) top or bottom of the primary horizontal stack (translated to all-the-way left/right for vertical splits), and
                    2) above or below the current window (translated to left/right of for vertical splits)

                    AFAIK, unless it was added in 6.3, there is no way (w/o knowing the existing layout) to open a window at the top/bottom of a secondary horizontal stack or the extreme left/right of a secondary vertical stack. By "secondary", I mean you've split the main window, then split one of one of them orthogonally, then split again in the original direction (:split|:vsplit|:split; or :vsplit|:split|:vsplit).

                    -Keith
                  • Yegappan Lakshmanan
                    Hi, ... Are you referring to the winrestcmd() function? ... - Yegappan ... _______________________________ Do you Yahoo!? Express yourself with Y! Messenger!
                    Message 9 of 10 , Oct 29, 2004
                    • 0 Attachment
                      Hi,

                      --- In vim@yahoogroups.com, "Keith Roberts" <kroberts@w...> wrote:
                      >
                      > You have some nice ideas there, Hari. What I think would help most are
                      > two commands which save_window_setup and restore_window_setup. The info

                      Are you referring to the winrestcmd() function?

                      :help winrestcmd()

                      - Yegappan

                      > saved would include window placement, size, etc., so that the windows
                      > can be restored EXACTLY as they were when saved. Now this runs into the
                      > issue of whether any new windows created in the meantime are modified
                      > and not hidden, but that's soluble. :) This would, after all, be
                      > primarily for script writers who should be cleaning that stuff up
                      > anyway. Any buffers they create should either be No_file, hidden or
                      > written out.
                      >
                      > -Keith





                      _______________________________
                      Do you Yahoo!?
                      Express yourself with Y! Messenger! Free. Download now.
                      http://messenger.yahoo.com
                    • Keith Roberts
                      ... Cool! I m still on 6.2.287 here at work, so I didn t see this. But I was talking about something which would go further. Not sure it is even needed,
                      Message 10 of 10 , Nov 1, 2004
                      • 0 Attachment
                        >-----Original Message-----
                        >From: Yegappan Lakshmanan [mailto:yegappan@...]
                        >Sent: Friday, October 29, 2004 10:58 AM
                        >To: vim@...
                        >Subject: Re: Permanent Splits
                        >
                        >Hi,
                        >
                        >--- In vim@yahoogroups.com, "Keith Roberts" <kroberts@w...> wrote:
                        >>
                        >> You have some nice ideas there, Hari. What I think would help most
                        >> are two commands which save_window_setup and restore_window_setup.
                        >> The info
                        >
                        >Are you referring to the winrestcmd() function?
                        >
                        > :help winrestcmd()
                        >
                        >- Yegappan

                        Cool! I'm still on 6.2.287 here at work, so I didn't see this. But I
                        was talking about something which would go further. Not sure it is even
                        needed, tho, so forget I mentioned it. :)

                        -Keith

                        >> saved would include window placement, size, etc., so that
                        >the windows
                        >> can be restored EXACTLY as they were when saved. Now this runs into
                        >> the issue of whether any new windows created in the meantime are
                        >> modified and not hidden, but that's soluble. :) This would, after
                        >> all, be primarily for script writers who should be cleaning
                        >that stuff
                        >> up anyway. Any buffers they create should either be No_file, hidden
                        >> or written out.
                        >>
                        >> -Keith
                      Your message has been successfully submitted and would be delivered to recipients shortly.