split question

25 views
Skip to first unread message

Kennedy, Marcus A.

unread,
Dec 1, 2021, 12:27:48 PM12/1/21
to vim...@googlegroups.com

Hello all!

I have three columns of files opened on my screen (I'm old school and
typically adhere to the 80colums wide lines). I may have 2-3 rows
windows in each, but each at a different size. I'm working with some
code that has some very long lines. I want that file at the bottom of
the middle and right columns.

Is there a straight forward way to do that?

ASCII art of what I want (hopefully LookOut! and Exchange doesn't screw
this up in flight):

-------------------
| | | |
| | |-----|
|-----|-----| |
| | |-----|
| | | |
| |-----------|
| | |
|-----|-----------|

That's what I'm going for -- if it doesn't render correctly for you, set
your font type to "Courier New" and maybe it will mono space everything
the right way.

Any ideas?

Thanks in advance,
Andy

Kennedy, Marcus A.

unread,
Dec 1, 2021, 12:58:30 PM12/1/21
to vim...@googlegroups.com

Additional info: Closest I could come up with was:

-------------------
| | | |
| | |-----|
|-----|-----| |
| | |-----|
| | | |
|-----|-----------|
| | |
|-----|-----------|

I cannot seem to make that bottom left window go away.

Anyone know how to close that and make the window above it expand to fill that spot?

The session file reports this:
set splitbelow splitright
wincmd _ | wincmd |
split
1wincmd k
wincmd _ | wincmd |
vsplit
wincmd _ | wincmd |
vsplit
2wincmd h
wincmd _ | wincmd |
split
1wincmd k
wincmd w
wincmd w
wincmd _ | wincmd |
split
1wincmd k
wincmd w
wincmd w
wincmd _ | wincmd |
split
wincmd _ | wincmd |
split
2wincmd k
wincmd w
wincmd w
wincmd w
wincmd _ | wincmd |
vsplit
1wincmd h
wincmd w
set nosplitbelow
set nosplitright
wincmd t
set winminheight=0
set winheight=1
set winminwidth=0
set winwidth=1
exe '1resize ' . ((&lines * 21 + 30) / 60)
exe 'vert 1resize ' . ((&columns * 90 + 135) / 271)
exe '2resize ' . ((&lines * 25 + 30) / 60)
exe 'vert 2resize ' . ((&columns * 90 + 135) / 271)
exe '3resize ' . ((&lines * 21 + 30) / 60)
exe 'vert 3resize ' . ((&columns * 90 + 135) / 271)
exe '4resize ' . ((&lines * 25 + 30) / 60)
exe 'vert 4resize ' . ((&columns * 90 + 135) / 271)
exe '5resize ' . ((&lines * 14 + 30) / 60)
exe 'vert 5resize ' . ((&columns * 89 + 135) / 271)
exe '6resize ' . ((&lines * 14 + 30) / 60)
exe 'vert 6resize ' . ((&columns * 89 + 135) / 271)
exe '7resize ' . ((&lines * 17 + 30) / 60)
exe 'vert 7resize ' . ((&columns * 89 + 135) / 271)
exe '8resize ' . ((&lines * 10 + 30) / 60)
exe 'vert 8resize ' . ((&columns * 90 + 135) / 271)
exe '9resize ' . ((&lines * 10 + 30) / 60)
exe 'vert 9resize ' . ((&columns * 180 + 135) / 271)

Andy
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_use/5ADFF93892EDB147B66FCBAB
> C8E4F27F5BD395EA%40prgmbx01.

Marvin Renich

unread,
Dec 1, 2021, 2:48:18 PM12/1/21
to vim...@googlegroups.com
* Kennedy, Marcus A. <Marcus....@Rocket.com> [211201 12:58]:
> > ASCII art of what I want (hopefully LookOut! and Exchange doesn't screw
> > this up in flight):
> >
> > -------------------
> > | | | |
> > | | |-----|
> > |-----|-----| |
> > | | |-----|
> > | | | |
> > | |-----------|
> > | | |
> > |-----|-----------|
> >
>
> Additional info: Closest I could come up with was:
>
> -------------------
> | | | |
> | | |-----|
> |-----|-----| |
> | | |-----|
> | | | |
> |-----|-----------|
> | | |
> |-----|-----------|
>
> I cannot seem to make that bottom left window go away.

Call the columns A, B, and C. Split the window vertically into A and B.
Now splitting A horizontally is independent of the rest.

Next, split B horizontally into rows F and G. Now you can split F
vertically, giving you column C in F only. Now splitting [F,B] and
[F,C] can be split horizontally as desired.

...Marvin

Kennedy, Marcus A.

unread,
Dec 1, 2021, 3:16:45 PM12/1/21
to vim...@googlegroups.com

> -----Original Message-----
> From: vim...@googlegroups.com <vim...@googlegroups.com> On
> Behalf Of Marvin Renich
> Sent: Wednesday, December 1, 2021 1:48 PM
> To: vim...@googlegroups.com
> Subject: [EXTERNAL] Re: split question
>
> * Kennedy, Marcus A. <mailto:Marcus....@Rocket.com> [211201 12:58]:
Thanks Marvin!

That sort of gets me what I want. The part that is missing is I don’t
want column C’s splits to line up with the splits of Column B.

At the moment, I’ve done a “:bo sp | vs” with a trash window in the
lower left. It’s annoying that I cannot fit all of my one file in that
bottom left window (missing 10 lines) but I’m dealing with it. The part
that was messing me up was trying to get my eyes to jump from the bottom
split back to the other place in the code. So, my eyes weren’t jumping
right.

Oh well, Thanks for the help!
Andy

Gary Johnson

unread,
Dec 1, 2021, 6:07:28 PM12/1/21
to vim...@googlegroups.com
As I understood Marvin's suggestion, the horizontal splits in column
B do not line up with the splits in column C. Here's a more
concrete example.

$ vim fileA
:belowright vsplit fileB
:split fileC
:vsplit fileD
:wincmd =

The layout should now look like this:

A B C
|-------|-------|-------|
| | | |
| | fileD | fileC |
| | | |
| fileA |---------------|
| | |
| | fileB |
| | |
|-------|---------------|

You can horizontally split all those windows to your heart's
content, and the new windows in column B (from fileD) will not be
aligned with any new windows in column C (from fileC). If you don't
need the wider window of fileB right away, you can minimize its
height to just the status bar with

:set winminheight=0

and, while your focus is in another window, pull the status line
above fileB down all the way.

HTH,
Gary

Kennedy, Marcus A.

unread,
Dec 2, 2021, 6:52:13 PM12/2/21
to vim...@googlegroups.com
Ha! That's it. So, it really is just that I didn't open them in the right order.

Thanks Gary for the clarification! Thanks Marvin for the initial info!

So, for completeness, my commands were:

:belowright vs
:sp
ctrl-w-<arrow to the top right window>
:vs
:sp
ctrl-w-<arrow to the top right window>
:sp
:sp

That did it. I then mouse set the window sizes to the way I want them

Thanks again!
Andy

Reply all
Reply to author
Forward
0 new messages