Table of Contents

vim-quit-another-window

Vim plugin that offers a way to close arbitrary window without bothering to leave current window.

Rationale

During my daily vimming, I often need to close some another window and keep working in the current window. And I want to do it without bothering to leave my current window.

For example, when I read some help in the upper window, and edit code in the lower window. At some moment, I decide to close help window. To do it, I have to press “Ctrl_W k :q”: Not very short. And this is not the worse case.

Another case:

+-----------------+-----------------+
|      help       |                 |
|     window      |                 |
|                 |     current     |
+-----------------+     window      |
|                 |                 |
|                 | <cursor>        |
|                 |                 |
+-----------------+-----------------+ 

Focus is in the “current window”, cursor is on the <cursor> sign. I want to close “help window” and keep working in the current window.

Here's what I need to do: Ctrl_W h Ctrl_W k :q Ctrl_W l

That is a way too long! So, I wrote this plugin to make me feel better.

Plugin details

The plugin provides 5 commands. Firstly, four commands for most-frequently actions:

And one universal command:

For example, :Q hk means “Go to the left window, then go to upper window, close it and go back to source window”

So, this long long command “Ctrl_W h Ctrl_W k :q Ctrl_W l” is truncated to short expression: “:Q hk

There's one optional dependency: CmdAlias plugin. If it is installed, then lowercased aliases of commands will be available: :qh, :qj, :qk, :ql, :q <args>. I found it much more useful than capitalized ones.

Please note the following:

Download

Currently, the plugin is hosted at vim.org only: quit-another-window.