Need help with GoldenView.Vim?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

218 Stars 14 Forks 66 Commits 22 Opened issues


Always have a nice view for vim split windows!

Services available


Need anything else?

Contributors list

# 82,121
55 commits
# 45,152
1 commit
# 189,388
1 commit

Always have a nice view for vim split windows

------------- - -----------------------------------------------
Plugin        : GoldenView.vim
Author        : Zhao Cai
EMail         : [email protected]
Homepage      :       :
Version       : 1.3.6
Date Created  : Tue 18 Sep 2012 05:23:13 PM EDT
Last Modified : Mon 22 Apr 2013 05:55:22 PM EDT
------------- - -----------------------------------------------

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

First and the most important one, auto-resizing should play nicely with existing plugins like

, etc. These windows should manage there own window size.

Second, auto-resizing 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, auto-resizing may just make a mess out of it.

GoldView Screencast


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


2. Tiled Windows Management

Second, it maps a single key (

 by default) to nicely split windows to tiled windows.
|   |                |            |   |
| F |                |    S1      | T |
| I |                +------------| A |
| L |                |    S2      | G |
| E |   MAIN PANE    +------------+ B |
| R |                |    S3      | A |
|   |                |            | R |
|   |                |            |   |

To get this view, just hit

 4 times. or, if you have a large monitor, you may get tiled windows below.
|   |               |              |            |   |
| F |               |              |    S1      | T |
| I |               |              +------------| A |
| L |               |      M2      |    S2      | G |
| E |   MAIN PANE   |              +------------+ B |
| R |               |              |    S3      | A |
|   |               |              |            | B |
|   |               |              |            |   |

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

  • Focus to the main window
  • Switch with the
    , the largest, smallest, etc.
  • Jump to the next and previous window


Install GoldenView is the same as installing other vim plugins. If experienced with vim, you can skim the example below and move to next section.

Option A - With Plugin Manager ( recommended )

If you use plugin managers like Pathogen, vundle, neobundle, vim-addon-manager, etc., just unarchive the zip file or clone the GoldenView repo from

into your local plugin installation directory (most likely
). Then add corresponding scripts in .vimrc for the bundle manager you are using.


  • neobundle:
    NeoBundle 'zhaocai/GoldenView.Vim' "Always have a nice view for vim split windows
  • vundle:
    Bundle 'zhaocai/GoldenView.Vim'
  • vim-addon-manager:
    call vam#ActivateAddons(['GoldenView.Vim'], {'auto_install' : 1})

Option B - Without Plugin Manager

Unarchive the zip file into a directory that is under

of your vim,
for example.

Quick Start

GoldenView should work out of the box without configuration. It should automatically start to resize focused window to golden ratio based on

and vim available size. You may start to play with it now.

To get you started, a few default keys are mapped as below:

" 1. split to tiled windows
nmap    GoldenViewSplit

" 2. quickly switch current window with the main pane " and toggle back nmap GoldenViewSwitchMain nmap GoldenViewSwitchToggle

" 3. jump to next and previous window nmap GoldenViewNext nmap GoldenViewPrevious

The meaning of those keys are self-explaining. A general workflow would be

key to quickly and nicely split windows to the layout as below. Then you may open your files.
|   |                |            |   |
| F |                |    S1      | T |
| I |                +------------| A |
| L |                |    S2      | G |
| E |   MAIN PANE    +------------+ B |
| R |                |    S3      | A |
|   |                |            | R |
|   |                |            |   |

To switch

, in
and hit
. To switch back, hit
in either


Every experienced vim user has a different set of key mappings. If you you are (most likely) unhappy about some of the mappings, map you own keys as below:

let g:goldenview__enable_default_mapping = 0

nmap GoldenViewSplit " ... and so on


if you do not want to start auto-resizing automatically, you can put the following script in your vimrc.

let g:goldenview__enable_at_startup = 0

More Commands and Mappings




These commands toggle, enable, and disable GoldenView auto-resizing.


this command do manual resizing of focused window.

You can also map a key for this as below:

nmap   GoldenViewResize




these commands do as it named.

You can also add mappings as below. ( no default keys for these mappings) ```vim nmap GoldenViewSwitchWithLargest nmap GoldenViewSwitchWithSmallest

Other switch rules can be easily defined. If you have some ideas, please post to [github issue][GoldenViewIssue] for discussion.


[GoldenView][] defines two rules:


is to "ignore" - allow those special buffers to manage their own window size.


is to "restore" - restore window size of some of special buffers.

The urule (user rules) are like this, which will be normalize at runtime for faster processing.

```vim { \ 'filetype' : [ \ '' , \ 'qf' , 'vimpager', 'undotree', 'tagbar', \ 'nerdtree', 'vimshell', 'vimfiler', 'voom' , \ 'tabman' , 'unite' , 'quickrun', 'Decho' , \ ], \ 'buftype' : [ \ 'nofile' , \ ], \ 'bufname' : [ \ 'GoToFile' , 'diffpanel_\d+' , \ 'Gundo_Preview__' , 'Gundo' , \ '[LustyExplorer-Buffers]' , '-MiniBufExplorer-' , \ 'VOOM\d+$' , '__Urannotate_\d+_' , \ '__MRU_Files' , \ ], },


GoldenView defines two profile:


defines the functions and preferences to auto resize windows.


defines reset preferences to restore everything to default.

function GoldenView#ExtendProfile()
is provided to customize preferences.

For more details, please read the source code! :)


Please do not resize me!

GoldenView maintains rules for "common" cases. But vim offers a great variety of plugins which defines buffers for special purposes. If you find some special buffers which is supposed to not be auto-resized. Please check

. You may extend the
yourself or post the issue to github issue for adding it to builtin support.

minibufexpl.vim takes 5+ lines

Check my fork minibufexpl.vim to see if it is working for you. I have send pull request to the origin repo.

I cannot resize window height to < 7

This is features. As mentioned in the Introduction section, there is no normal cases to have a normal window too small. For special cases like minibufexpl.vim, it can be handled case by case.

However, if you really want to have small windows. It can be done by :

" Extend a new profile named 'small-height' from default profile.
" 1. Change "2" to your desire minimal height
" 2. Change "small-height" to the profile name you like
" ---------------------------------------------------------------
call GoldenView#ExtendProfile('small-height', {
\   'other_window_winheight'  : 2  ,
\ })

let g:goldenview__active_profile = 'small-height'

(refer to issue #5)

I still have Issues:

If you have any issues, please post it to github issue for discussion.

Remember to run the following command and post the results.

echo GoldenView#Info()



Refer to


Copyright (c) 2013 Zhao Cai <[email protected]>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.