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

Always open help window above current window

Expand Messages
  • Spencer Collyer
    ... mode. If there is a help window open already, use that one. Otherwise, if the current window uses the full width of the screen or is at least 80
    Message 1 of 4 , Sep 1, 2009
    • 0 Attachment
      In the help for the 'help' command it states the following:

      -----8<--------8<--------------------8<--------8<--------------------8<-------
      :h[elp] Open a window and display the help file in read-only
      mode. If there is a help window open already, use
      that one. Otherwise, if the current window uses the
      full width of the screen or is at least 80 characters
      wide, the help window will appear just above the
      current window. Otherwise the new window is put at
      the very top.
      -----8<--------8<--------------------8<--------8<--------------------8<-------

      However, I have the 'splitbelow' option set and my help windows always
      open below the current window. This is consistent with the help for
      'splitbelow' but not for the help for 'help'. Is this a bug in the help
      or the behaviour of 'help' when splitbelow is set?

      What I'd really like is for the help window to _always_ appear above
      the current window (as stated in the above help text), ignoring the
      value of 'splitbelow'. Is there any easy way I can do that?

      Spencer

      --
      <<< Eagles may soar, but weasels don't get sucked into jet engines >>>
      11:29am up 4 days 17:23, 1 user, load average: 1.74, 1.62, 1.41
      Registered Linux User #232457 | LFS ID 11703

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... I think that the fact that the help window obeys the splitbelow setting is the desired behaviour, and that the text under :help :help (and maybe at
      Message 2 of 4 , Sep 18, 2009
      • 0 Attachment
        On 01/09/09 12:35, Spencer Collyer wrote:
        >
        > In the help for the 'help' command it states the following:
        >
        > -----8<--------8<--------------------8<--------8<--------------------8<-------
        > :h[elp] Open a window and display the help file in read-only
        > mode. If there is a help window open already, use
        > that one. Otherwise, if the current window uses the
        > full width of the screen or is at least 80 characters
        > wide, the help window will appear just above the
        > current window. Otherwise the new window is put at
        > the very top.
        > -----8<--------8<--------------------8<--------8<--------------------8<-------
        >
        > However, I have the 'splitbelow' option set and my help windows always
        > open below the current window. This is consistent with the help for
        > 'splitbelow' but not for the help for 'help'. Is this a bug in the help
        > or the behaviour of 'help' when splitbelow is set?
        >
        > What I'd really like is for the help window to _always_ appear above
        > the current window (as stated in the above help text), ignoring the
        > value of 'splitbelow'. Is there any easy way I can do that?
        >
        > Spencer
        >

        I think that the fact that the help window obeys the 'splitbelow'
        setting is the desired behaviour, and that the text under ":help :help"
        (and maybe at some other places) has not been updated due to an
        oversight at the time the 'splitbelow' option was introduced.

        I use the following to open the help window at the very bottom when I
        use F1, ":h" or ":h {subject}" (typing ":help" in full would revert to
        default behaviour); you could use the :abo[veleft] prefix instead of
        :bo[tright] to open just above the current window instead. Only if there
        is no help window yet, of course: an existing help window in the current
        tab page will always be reused, as mentioned in the help text you quoted.

        " open help window at bottom unless :help typed in full
        if version < 700
        cnoreabbrev h bot h
        else
        cnoreabbrev <expr> h
        \ ((getcmdtype() == ':' && getcmdpos() <= 2)? 'bot h' : 'h')
        endif
        map <F1> :bot help<CR>



        Best regards,
        Tony.
        --
        hundred-and-one symptoms of being an internet addict:
        132. You come back and check this list every half-hour.

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Spencer Collyer
        ... --
        Message 3 of 4 , Sep 20, 2009
        • 0 Attachment
          On Sat, 19 Sep 2009 05:48:12 +0200, Tony Mechelynck wrote:
          >
          > On 01/09/09 12:35, Spencer Collyer wrote:
          > >
          > > In the help for the 'help' command it states the following:
          > >
          > > -----8<--------8<--------------------8<--------8<--------------------8<-------
          > > :h[elp] Open a window and display the help file in
          > > read-only mode. If there is a help window open already, use
          > > that one. Otherwise, if the current
          > > window uses the full width of the screen or is at least 80
          > > characters wide, the help window will appear just above the
          > > current window. Otherwise the new window
          > > is put at the very top.
          > > -----8<--------8<--------------------8<--------8<--------------------8<-------
          > >
          > > However, I have the 'splitbelow' option set and my help windows
          > > always open below the current window. This is consistent with the
          > > help for 'splitbelow' but not for the help for 'help'. Is this a
          > > bug in the help or the behaviour of 'help' when splitbelow is set?
          > >
          > > What I'd really like is for the help window to _always_ appear above
          > > the current window (as stated in the above help text), ignoring the
          > > value of 'splitbelow'. Is there any easy way I can do that?
          > >
          > > Spencer
          > >
          >
          > I think that the fact that the help window obeys the 'splitbelow'
          > setting is the desired behaviour, and that the text under
          > ":help :help" (and maybe at some other places) has not been updated
          > due to an oversight at the time the 'splitbelow' option was
          > introduced.
          >
          > I use the following to open the help window at the very bottom when I
          > use F1, ":h" or ":h {subject}" (typing ":help" in full would revert
          > to default behaviour); you could use the :abo[veleft] prefix instead
          > of :bo[tright] to open just above the current window instead. Only if
          > there is no help window yet, of course: an existing help window in
          > the current tab page will always be reused, as mentioned in the help
          > text you quoted.
          >
          > " open help window at bottom unless :help typed in full
          > if version < 700
          > cnoreabbrev h bot h
          > else
          > cnoreabbrev <expr> h
          > \ ((getcmdtype() == ':' && getcmdpos() <= 2)? 'bot h' : 'h')
          > endif
          > map <F1> :bot help<CR>
          >
          >
          >
          > Best regards,
          > Tony.


          --
          <<< Eagles may soar, but weasels don't get sucked into jet engines >>>
          9:15am up 23 days 15:10, 1 user, load average: 0.59, 0.84, 1.26
          Registered Linux User #232457 | LFS ID 11703

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Spencer Collyer
          ... (Apologies for the previous post - I hit Send before I d edited it :-( ) Thanks for that Tony. I also had a suggestion on the -dev list to use filetype
          Message 4 of 4 , Sep 20, 2009
          • 0 Attachment
            On Sat, 19 Sep 2009 05:48:12 +0200, Tony Mechelynck wrote:

            > I use the following to open the help window at the very bottom when I
            > use F1, ":h" or ":h {subject}" (typing ":help" in full would revert
            > to default behaviour); you could use the :abo[veleft] prefix instead
            > of :bo[tright] to open just above the current window instead. Only if
            > there is no help window yet, of course: an existing help window in
            > the current tab page will always be reused, as mentioned in the help
            > text you quoted.
            >
            > " open help window at bottom unless :help typed in full
            > if version < 700
            > cnoreabbrev h bot h
            > else
            > cnoreabbrev <expr> h
            > \ ((getcmdtype() == ':' && getcmdpos() <= 2)? 'bot h' : 'h')
            > endif
            > map <F1> :bot help<CR>
            >

            (Apologies for the previous post - I hit 'Send' before I'd edited it :-( )

            Thanks for that Tony. I also had a suggestion on the -dev list to use filetype detection for help files. I'll implement something like what you've given me here, and then probably have a go at doing the filetype stuff afterwards.

            --
            <<< Eagles may soar, but weasels don't get sucked into jet engines >>>
            9:15am up 23 days 15:10, 1 user, load average: 0.62, 0.84, 1.26
            Registered Linux User #232457 | LFS ID 11703

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