Aiming to mimic tmux's display-pane feature, which enables you to choose window interactively.
This plugin should be useful especially when you are working on high resolution wide display. Since with wide display, you are likely to open multiple window and moving around window is a little bit tiresome.
This plugin simplifies window excursion.
- Display window label on statusline or middle of each window (overlay).
- Read input from user.
- land to window.
" invoke with '-'
nmap - <Plug>(choosewin)Optional configuration:
" if you want to use overlay feature
let g:choosewin_overlay_enable = 1More configuration is explained in help file. See :help choosewin.
| Key | Action | Description |
|---|---|---|
| 0 | tab_first | Choose FIRST tab |
| [ | tab_prev | Choose PREVIOUS tab |
| ] | tab_next | Choose NEXT tab |
| $ | tab_last | Choose LAST tab |
| x | tab_close | Close current tab |
| ; | win_land | Land to current window |
<CR> |
win_land | Land to current window |
| - | previous | Land to previous window |
| s | swap | Swap window #1 |
| S | swap_stay | Swap window but stay #1 |
<NOP> |
Disable predefined keymap | |
| *1 if you chose 'swap' again, swapping with previous window's buffer | ||
| ex) with default keymap, double 's'(ss) swap with previous buffer. |
Assume you mapped - to invoke choosewin feature with following commands,
nmap - <Plug>(choosewin)First of all, open mustiple windows and tabs.
Invoke choosewin with typing - in normal mode.
Then you can move around tabs by ] and [ or directly choose target tab by number labeled on tabline.
After you chose target tab, you can choose target window by typing alphabet which is labeled on statusline or on middle of window(if you enabled overlay feature).
Type - again to invoke choosewin, then input - again to choose previous window, previous window is the window last time you were on before you choose current window.
Type - to invoke choosein, then type s to swap window.
Then choose target window label you want to swap content(=buffer) of window with buffer of current window.
After you chose, the current window's buffer is swapped with the buffer shown in the window you chose.
By combinating swap and previous window, you can easily swap window with previous window like -s-, invoking choosewin itself(-) then enter swapping mode(s), then instruct choosewin that target window is previous(-) window. conguratulation!
