You are not logged in.

#1 2010-06-08 16:16:35

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Is there a way to auto resize the active buffer in vim?

I use vim as my main code environment, and often have some vertical splits with multiple files. Is there a way that I can make it such that when I enter a  buffer and it becomes active, that it will automatically expand to at least 80c wide? And that it would also skip non-file windows like taglist?

Offline

#2 2010-06-08 16:25:27

saline
Member
Registered: 2010-02-20
Posts: 86

Re: Is there a way to auto resize the active buffer in vim?

For options on resizing a window, type ':help ^W' for the full list.  In the meantime, play with
Ctrl-W +
Ctrl-W -
Ctrl-W <
Ctrl-W >
Ctrl-W =
Ctrl-W _

As for automatically 80c, you'd might need to write a vim script or check if one already exists.

Last edited by saline (2010-06-08 16:27:38)

Offline

#3 2010-06-08 16:32:50

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Is there a way to auto resize the active buffer in vim?

Right now I can use :vertical res 80, but yeah, I think a custom function would be good... Check width, compare on 80, resize to 80 if less... Can't I also do something like auto onBufEnter or something? I'll have to look into this.

Offline

#4 2010-06-08 17:14:50

saline
Member
Registered: 2010-02-20
Posts: 86

Re: Is there a way to auto resize the active buffer in vim?

If you already have the function, I believe you can run it with the buffer triggers.

Offline

#5 2010-06-08 17:22:16

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Is there a way to auto resize the active buffer in vim?

Not yet, but I'll make it

Offline

Board footer

Powered by FluxBB