hosttx.blogg.se

Horizontal resize macvim
Horizontal resize macvim










horizontal resize macvim

The function is used with the following autocommands: if has("gui_running")Īutocmd WinEnter * let w:count = 1 | call ResizeSplits()Īutocmd BufEnter * let w:count = 1 | call ResizeSplits()Īutocmd BufHidden * let w:count = 0 | call ResizeSplits()Īutocmd BufWinLeave * let w:count = 0 | call ResizeSplits() Where the important change is that I have defined a variable w:count that is either 0 or 1. Let l:totwidth = l:count - 1 + l:count*l:colwidth

horizontal resize macvim

First, I rewrote the ResizeSplits function: function! s:ResizeSplits() I found a solution that seems to work pretty well. It is trivial to get my plugin to work with mappings, but I am not able to get it to work reliably with ex commands like :only and :close.

#Horizontal resize macvim windows

Is there another autocommand that can be used to detect when the number of windows has been changed, or a BufLeave-like event that is guaranteed to be executed after windows are destroyed/removed? The problem is that the ResizeSplits function does not work, since it still counts the old number of windows. This is a problem for instance when I do o or :only. It seems like the BufLeave event (and similar ones) sometimes executes before windows are closed. The plugin almost works as I want it to, but not quite.

horizontal resize macvim

Let l:totwidth = l:count - 1 + l:count*80 Here ResizeSplits() is the function that resizes the gui window: function! s:ResizeSplits() The plugin works something like this if has("gui_running") I am writing a small plugin for gvim that automatically increases or decreases the width of the gui according to the number of vertical splits.












Horizontal resize macvim