quit-another-window : Quickly close another window and keep working in current window
| script karma
Downloaded by 804
Comments, bugs, improvements
script versions (upload new version)
|Often I need to close some another window and keep working in the current window.
For example, when I read some help in the upper window, and edit code in the lower
window. At one time, 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 variant.
| 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 current window.
That's what i need to do:
Ctrl_W h Ctrl_W k :q Ctrl_W l
This is pretty long!
So, I wrote this plugin to make it easy.
It provides 5 commands.
Firstly, four commands for most-frequently actions:
:Qh means "close left window and go back"
:Qj means "close lower window and go back"
:Qk means "close upper window and go back"
:Ql means "close right window and go back"
And one universal command:
:Q <args>, where <args> is movement commands to needed window.
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 (vimscript #746).
If CmdAlias is installed, then lowercased aliases of commands will be available: :qh, :qj, :qk, :ql, :q <args>.
I found it useful.
1) if :Q without arguments is passed, then current window becomes closed.
(to provide compatibility of lowercased command :q)
2) If argument is passed, but target window is the same as current window, then
no window will be closed.
Or just unpack contents of the package in your .vim directory.
Click on the package to download.
ip used for rating: 220.127.116.11