Thursday, April 18, 2013

GoldenView.Vim: Always have a nice view for vim split windows

Hi, Everyone,

I would like to introduce a vim plugin named GoldenView I just released. Please take a look and give feedback. Thanks.

( For a better view of document, please go to http://zhaocai.github.io/GoldenView.Vim/. )

The initial motive for GoldenView comes from the frustration of using other vim plugins to autoresize split windows. The idea is deadly simple and very useful: resize the focused window to a proper size. However, in practice, many hiccups makes autoresizing not a smooth experience. Below are a list of issues I am trying to solve:

First and the most important one, autoresizing should play nicely with existing plugins like tagbarvimfileruniteVOoM,quickfixundotreegundo, etc. These windows should manage there own window size.

Second, autoresizing should take care of the other windows too. Resizing the focused window may cause the other windows become too small. When you have 4+ split windows, autoresizing may just make a mess out of it.

Features

GoldenView has preliminarily solved the issues described above. It also provides other features. Bascally, it does two things:

1. Autoresizing

First of all, it automatically resize the focused split window to a "golden" view based on golden ratio and textwidth.

2. Tiled Windows Management

Second, it maps a single key (<C-L> by default) to nicely split windows to tiled windows.

-----------------------------------  |              |        S1        |  |              |===================  |      V       |        S2        |  |              |===================  |              |        S3        |  -----------------------------------  

To get this view, just hit <C-L> 4 times. or, if you have a large monitor, you may get tiled windows below.

--------------------------------------------------  |              |              |        S1        |  |              |              |===================  |      V1      |      V2      |        S2        |  |              |              |===================  |              |              |        S3        |  --------------------------------------------------  

To quickly switch between those windows, a few keys are mapped to

  • Focuse to the main window (- the V pane above),
  • Switch with the largest, smallest, etc.
  • Jump to next and previous window


All the best,
Zhao Cai

No comments: