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

Re: Split windows and spanning width of screen

Expand Messages
  • Tim Chase
    ... In addition to Michael s answer to your question below, if you ve already got the QF window open and focused, you can use ^WJ (control-W, capital-j) to
    Message 1 of 9 , Sep 29, 2010
    • 0 Attachment
      On 09/29/10 16:55, Thomas Adam wrote:
      > +----------------+
      > | | |
      > | foo | baz.c |
      > |------ |------- |
      > | bar |quickfix|
      > +----------------+
      >
      > But because, most likely, "foo" and "bar" here also relate to baz.c in some
      > way, how would I get the quickfix window to open up across those, to it
      > looks likt his:
      >
      > +----------------+
      > | | |
      > | foo | baz.c |
      > |------ | |
      > | bar | |
      > |----------------|
      > | quickfix |
      > +----------------+
      >
      > Is that possible?

      In addition to Michael's answer to your question below, if you've
      already got the QF window open and focused, you can use ^WJ
      (control-W, capital-j) to move it to the bottom.

      :help CTRL-W_J

      the capital H/J/K/L move the current window as-far-as-possible in
      that direction

      > Furthermore, is it possible to apply this technique to
      > other potential :sp windows as well I might want to create?

      -tim


      --
      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
    • Thomas Adam
      Hi -- Ah, TIm. I thought you might chime in. :) ... This is really useful, thanks. I ve tried this, and it s working brilliantly, even for existing split
      Message 2 of 9 , Sep 29, 2010
      • 0 Attachment
        Hi --

        Ah, TIm. I thought you might chime in. :)

        On 29 September 2010 23:34, Tim Chase <vim@...> wrote:
        > In addition to Michael's answer to your question below, if you've already
        > got the QF window open and focused, you can use ^WJ (control-W, capital-j)
        > to move it to the bottom.
        >
        >  :help CTRL-W_J

        This is really useful, thanks. I've tried this, and it's working
        brilliantly, even for existing split windows.

        > the capital H/J/K/L move the current window as-far-as-possible in that
        > direction

        I'm adding this as a comment to my .vimrc - this is invaluable, thanks!

        I don't really want to hijack my own thread with other questions, but I'll ask:

        * Does the use of "CTRL-W_J" to move an existing window to the bottom
        then affect window rotation? Only, if I issue "CTRL-W_J" to a window
        and then in that window type:

        "CTRL-W_r" to rotate it, I get:

        E443: Cannot rotate window when another window is split

        Yet I was free to do that before before moving this window to the
        bottom -- or I am sure of it,

        Also:

        * Is there a way to always map the command ":copen" to provide:

        :botright copen

        ... although at this point, I feel I need to start reading some
        documentation, rather than looking like a n00b. :)

        Thanks again!

        -- Thomas Adam

        --
        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
      • Michael Henry
        ... I don t open the quickfix window manually often enough that I ve made such a mapping. But I believe this wiki page points out some techniques for doing
        Message 3 of 9 , Sep 29, 2010
        • 0 Attachment
          On 09/29/2010 06:44 PM, Thomas Adam wrote:
          > Also:
          >
          > * Is there a way to always map the command ":copen" to provide:
          >
          > :botright copen

          I don't open the quickfix window manually often enough that I've
          made such a mapping. But I believe this wiki page points out
          some techniques for doing what you're asking:
          http://vim.wikia.com/wiki/Replace_a_builtin_command_using_cabbrev

          However, I mostly find that I'm lazier than that. I'd like the
          quickfix window to open automatically. My most common use of
          the quickfix window is in conjunction with the Grep plugin:
          http://www.vim.org/scripts/script.php?script_id=311

          This plugin does the ":botright copen" command automatically
          after a search has been performed. I often already have the
          quickfix window open because of a prior search, so if I use
          something like :cfile to populate the quickfix list, I often
          don't need to manually open the quickfix window.

          But I've also mapped <F4> and <s-F4> to be, essentially, :cnext
          and :cprev, with the added benefit that a ":botright copen" is
          done automatically in case the window isn't open. So if the
          window's not already open, I can do <F4><s-F4> to bounce forward
          and backward, just to get the side-effect of :botright copen.
          If all that fails, I just manually type :botright copen myself
          :-)

          Below are my mappings for <F4> and <s-F4>. Recently I added
          another feature (based on a posting in this newsgroup, IIRC).
          When a "diff" window is active, the above mappings go forward
          and backward through the diffs instead of through the quickfix
          list. Finally, I also like to scroll the window to put the
          match in the center of the screen, which is what the "normal zz"
          commands are doing.

          -------- Start of mappings for message browsing ---------
          function! GotoPrev()
          if &diff
          normal [czz
          else
          botright copen
          wincmd p
          try
          cprev
          normal zz
          catch
          echo "No previous QuickFix messages"
          endtry
          endif
          endfunction

          function! GotoNext()
          if &diff
          normal ]czz
          else
          botright copen
          wincmd p
          try
          cnext
          normal zz
          catch
          echo "No more QuickFix messages"
          endtry
          endif
          endfunction

          " Setup message browsing using F4/Shift-F4. If the current
          " window is in diff mode, does diff next/prev; otherwise,
          " does :cnext/:cprev for QuickFix messages, opening the
          " QuickFix window if necessary.
          " Automatically scrolls the message to the center of the window.
          inoremap <silent> <F4> <C-O>:call GotoNext()<CR>
          nnoremap <silent> <F4> :call GotoNext()<CR>
          inoremap <silent> <S-F4> <C-O>:call GotoPrev()<CR>
          nnoremap <silent> <S-F4> :call GotoPrev()<CR>
          -------- End of mappings for message browsing ---------

          Michael Henry

          --
          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
        • Russell Urquhart
          Hi, Does anyone have any info on how to use xmltidy with macvim and/or vim? I m sure this is doable i just need some info! Thanks, Russ -- You received this
          Message 4 of 9 , Sep 29, 2010
          • 0 Attachment
            Hi,

            Does anyone have any info on how to use xmltidy with macvim and/or vim? I'm sure this is doable i just need some info!

            Thanks,

            Russ

            --
            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
          • Tim Chase
            [as a side note, you ll want to start a fresh thread for maximum exposure, rather than replying to an unrelated thread] ... Presuming you have xmltidy on your
            Message 5 of 9 , Sep 30, 2010
            • 0 Attachment
              [as a side note, you'll want to start a fresh thread for maximum
              exposure, rather than replying to an unrelated thread]

              > Does anyone have any info on how to use xmltidy with macvim and/or vim? I'm sure this is doable i just need some info!

              Presuming you have xmltidy on your machine, can you not just use

              :%!xmltidy

              to run the entire file contents through xmltidy (also assuming
              that xmltidy reads untidy input from stdin puts the tidied output
              on stdout). And as usual, this can always be mapped to your
              favorite key.

              -tim


              --
              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
            • Simon Ruderich
              ... If you want to run xmltidy on the current buffer, use ... (I ve never used xmltidy, if it s well written, this will works.) This works with all filter
              Message 6 of 9 , Sep 30, 2010
              • 0 Attachment
                On Wed, Sep 29, 2010 at 10:22:11PM -0500, Russell Urquhart wrote:
                > Hi,
                >
                > Does anyone have any info on how to use xmltidy with macvim
                > and/or vim? I'm sure this is doable i just need some info!
                >
                > Thanks,
                > Russ

                If you want to run xmltidy on the current buffer, use

                :%!xmltidy

                (I've never used xmltidy, if it's well written, this will works.)

                This works with all filter programs (sort, grep, etc.).

                Simon
                --
                + privacy is necessary
                + using gnupg http://gnupg.org
                + public key id: 0x92FEFDB7E44C32F9
              Your message has been successfully submitted and would be delivered to recipients shortly.