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

Re: :help WITHOUT split screen

Expand Messages
  • Tony Mechelynck
    ... One slight disadvantage of the above (which can be worked around in recent versions) is that if you ever type the word help on a command lne, it will be
    Message 1 of 22 , Apr 1, 2012
    • 0 Attachment
      On 30/03/12 15:35, Tarlika Elisabeth Schmitz wrote:
      > On Fri, 30 Mar 2012 14:39:33 +0200
      > Guido Van Hoecke <guivho@...> wrote:
      >
      >>> Is there a way to prevent :help from splitting the window?!
      >> cabbrev h tab help
      >
      > Many thanks - works fine here.
      >
      > I've covered all options in .vimrc now:
      >
      > " always open help in new tab
      > cabbrev help tab help
      > cabbrev he tab help
      > cabbrev h tab help
      >
      >
      >
      >
      >


      One slight disadvantage of the above (which can be worked around in
      recent versions) is that if you ever type the word "help" on a command
      lne, it will be abbreviated even if not at the start. For example, the
      (very useful) command

      :help help

      will become

      :tab help tab help

      which not only is not what you want, it is illegal. In addition, the
      abbreviation will be triggered also in / or ? (search) command-lines,
      which you don't want either.

      The way to work around it is as follows:

      if version < 700
      cnoreabbrev h tab h
      cnoreabbrev he tab he
      cnoreabbrev hel tab hel
      cnoreabbrev help tab help
      " in Vim 6.x or earlier (which is now obsolete
      " but hasn't got :abbr <expr> )
      " we'll need to break the abbrev halfway
      " (e.g. by <Left><Right>)
      " to avoid expanding the argument of :help help
      " or h he hel help in a search command
      else
      cnoreabbrev <expr> h
      \ ((getcmdtype() == ':' && getcmdpos() <= 2)?
      \ 'tab h' : 'h')
      cnoreabbrev <expr> he
      \ ((getcmdtype() == ':' && getcmdpos() <= 3)?
      \ 'tab he' : 'he')
      cnoreabbrev <expr> hel
      \ ((getcmdtype() == ':' && getcmdpos() <= 4)?
      \ 'tab hel' : 'hel')
      cnoreabbrev <expr> help
      \ ((getcmdtype() == ':' && getcmdpos() <= 5)?
      \ 'tab help' : 'help')
      endif

      Notes:
      -----
      - The above (meant for cut'n paste) assumes 'nocompatible', which is the
      default if your vimrc is named .vimrc or _vimrc but not .exrc or _exrc
      - The deprecated (but still valid) variable name "version" is used in
      preference to "v:version" for compatibility with some even older
      obsolete versions.


      Best regards,
      Tony.
      --
      Once Law was sitting on the bench
      And Mercy knelt a-weeping.
      "Clear out!" he cried, "disordered wench!
      Nor come before me creeping.
      Upon you knees if you appear,
      'Tis plain you have no standing here."

      Then Justice came. His Honor cried:
      "YOUR states? -- Devil seize you!"
      "Amica curiae," she replied --
      "Friend of the court, so please you."
      "Begone!" he shouted -- "There's the door --
      I never saw your face before!"
      -- Ambrose Bierce, "The Devil's Dictionary"

      --
      You received this message from the "vim_use" 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
    • Charles E Campbell Jr
      ... Hello! I just downloaded v24d myself from my website -- and TMan is there (its actually defined as a command in manpageviewPlugin.vim). It worked for me
      Message 2 of 22 , Apr 1, 2012
      • 0 Attachment
        Tarlika Elisabeth Schmitz wrote:
        > On Fri, 30 Mar 2012 15:32:59 -0400
        > Charles Campbell<Charles.E.Campbell@...> wrote:
        >
        >
        >> Tarlika Elisabeth Schmitz wrote:
        >>
        >>> On Fri, 30 Mar 2012 13:17:44 -0400
        >>> Charles Campbell<Charles.E.Campbell@...> wrote:
        >>>
        >>>
        >>>
        >>>> Manpageview (see
        >>>> http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW), which
        >>>> handles several kinds of help (vim, manpages, perl, php, and
        >>>> python), has a TMan command, which provides help in a separate tab.
        >>>>
        >>>>
        >>> Just installed (v24c).
        >>>
        >>> There doesn't seem to be a TMan though.
        >>>
        >>>
        >> I've now loaded v24d on my website; its the one with TMan.
        >>
        >
        > I installed v24d but the plugin/manpageviewPlugin.vim is from 16/9/2008
        > and doesn't define TMan. (unless I've done something dumb?)
        >
        >
        Hello!

        I just downloaded v24d myself from my website -- and TMan is there (its
        actually defined as a command in manpageviewPlugin.vim). It worked for
        me when I tested it, too.

        Please check again... (and be sure that you're actually getting v24d,
        it'll say so in manpageview.vim -- perhaps the browser cache is causing
        problems?).

        Regards,
        Chip Campbell


        --
        You received this message from the "vim_use" 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
      • Tarlika Elisabeth Schmitz
        On Sun, 01 Apr 2012 21:58:01 -0400 ... ok, got it now. No idea where I went wrong. -- Best Regards, Tarlika Elisabeth Schmitz, Scotland -- You received this
        Message 3 of 22 , Apr 2, 2012
        • 0 Attachment
          On Sun, 01 Apr 2012 21:58:01 -0400
          Charles E Campbell Jr <drchip@...> wrote:

          >I just downloaded v24d myself from my website -- and TMan is there

          ok, got it now. No idea where I went wrong.



          --

          Best Regards,
          Tarlika Elisabeth Schmitz, Scotland

          --
          You received this message from the "vim_use" 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
        • Ben Fritz
          ... Yes, you could also use &buftype rather than &filetype. But this will never allow you to intentionally split a help window and look up a new topic to see
          Message 4 of 22 , Apr 2, 2012
          • 0 Attachment
            On Sunday, April 1, 2012 5:52:39 AM UTC-5, Thilo Six wrote:
            > Hello Ben
            >
            >
            > Excerpt from Ben Fritz:
            > -- <snip> --
            > > I would lean toward something like this, were I to want an automatic method:
            > >
            > > au bufwinenter *.txt
            > > \ if &filetype=='help' | wincmd p |
            > > \ if &filetype!='help' | wincmd p | wincmd T |
            > > \ else | wincmd p | endif |
            > > \ endif
            >
            > How about:
            > au bufwinenter *.txt
            > \ if &buftype == "help"
            > \ | wincmd T
            > \ | endif
            >
            >

            Yes, you could also use &buftype rather than &filetype. But this will never allow you to intentionally split a help window and look up a new topic to see two of them side-by-side. Hence the wincmd p stuff in my suggestion.

            --
            You received this message from the "vim_use" 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
          • Francis (Grizzly) Smit
            ... if your using gvim then :tab help cmd will give you the help in a new tab no split window -- .~. In my life God comes first.... /V but Linux
            Message 5 of 22 , Apr 2, 2012
            • 0 Attachment
              On 02/04/12 23:58, Ben Fritz wrote:
              > On Sunday, April 1, 2012 5:52:39 AM UTC-5, Thilo Six wrote:
              >> Hello Ben
              >>
              >>
              >> Excerpt from Ben Fritz:
              >> -- <snip> --
              >>> I would lean toward something like this, were I to want an automatic method:
              >>>
              >>> au bufwinenter *.txt
              >>> \ if&filetype=='help' | wincmd p |
              >>> \ if&filetype!='help' | wincmd p | wincmd T |
              >>> \ else | wincmd p | endif |
              >>> \ endif
              >> How about:
              >> au bufwinenter *.txt
              >> \ if&buftype == "help"
              >> \ | wincmd T
              >> \ | endif
              >>
              >>
              > Yes, you could also use&buftype rather than&filetype. But this will never allow you to intentionally split a help window and look up a new topic to see two of them side-by-side. Hence the wincmd p stuff in my suggestion.
              >
              if your using gvim then :tab help cmd will give you the help in a new
              tab no split window

              --


              .~. In my life God comes first....
              /V\ but Linux is pretty high after that :-D
              /( )\ Francis (Grizzly) Smit
              ^^-^^ http://www.smit.id.au/

              --
              You received this message from the "vim_use" 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
            • Thilo Six
              Hello Ben, Excerpt from Ben Fritz: -- -- ... Good Point. This version seem to resemble this: au bufwinenter *.txt if &buftype == help | if
              Message 6 of 22 , Apr 2, 2012
              • 0 Attachment
                Hello Ben,


                Excerpt from Ben Fritz:

                -- <snip> --
                > Yes, you could also use &buftype rather than &filetype. But this will never
                > allow you to intentionally split a help window and look up a new topic to see
                > two of them side-by-side. Hence the wincmd p stuff in my suggestion.

                Good Point. This version seem to resemble this:

                au bufwinenter *.txt
                \ if &buftype == "help"
                \ | if getwinvar(winnr("#"), '&ft') != 'help'
                \ | wincmd T
                \ | endif
                \ | endif


                --
                Regards,
                Thilo

                4096R/0xC70B1A8F
                721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F


                --
                You received this message from the "vim_use" 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
              • Tarlika Elisabeth Schmitz
                On Fri, 30 Mar 2012 15:32:59 -0400 ... Did you ever get a chance to look into this? -- Tarlika Elisabeth Schmitz, Scotland Saor Alba -- You received this
                Message 7 of 22 , Apr 18, 2012
                • 0 Attachment
                  On Fri, 30 Mar 2012 15:32:59 -0400
                  Charles Campbell <Charles.E.Campbell@...> wrote:

                  >Tarlika Elisabeth Schmitz wrote:
                  >> On Fri, 30 Mar 2012 13:17:44 -0400
                  >> Charles Campbell<Charles.E.Campbell@...> wrote:
                  >>
                  >>
                  >>> Manpageview (see
                  >>> http://www.drchip.org/astronaut/vim/index.html#MANPAGEVIEW), which
                  >>> handles several kinds of help (vim, manpages, perl, php, and
                  >>> python), has a TMan command, which provides help in a separate tab.
                  >>>
                  >> On vim help pages PgUp, PgDn work but on bash man pages and python
                  >> help they don't; there I need to scroll using the scroll bars.
                  >>
                  >I'll have to look into PgUp and PgDn later...

                  Did you ever get a chance to look into this?

                  --

                  Tarlika Elisabeth Schmitz, Scotland
                  Saor Alba

                  --
                  You received this message from the "vim_use" 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
                Your message has been successfully submitted and would be delivered to recipients shortly.