Tiling window management that sucks less - see http://wmii.suckless.org/. This emulates wmii in Vim as much as possible. A dwm emulation might come next.
For the window management, all shortcuts use the Alt (Meta) key by default:
Alt+[sdf] ⇒ tiling mode selection: [s]tacked, [d]ivided, [f]ullscreen Alt+[hjkl] ⇒ select adjacent window Alt+[HJKL] ⇒ move current window Ctrl+Alt+[hjkl] ⇒ resize current window Alt+o ⇒ create new window Alt+c ⇒ collapse window Alt+w ⇒ close window
Vim tabs are used as “views”:
Alt+ ⇒ select tab [1..10] <Leader> ⇒ select tab [1..10] <Leader>t ⇒ move current window to tab [1..10] <Leader>T ⇒ copy current window to tab [1..10]
Copy the script into your
$HOME/.vim/plugin directory so that it will be sourced on startup.
This plugin relies quite heavily on the Alt key. Unfortunately, defining Alt shortcuts in Vim can be tricky… Here’s a quick help if your Alt shortcuts don’t work as expected.
On Windows and GNU/Linux the Alt key can either:
- modify the 8th bit of the current character, i.e. Altj outputs a
ê— that’s what gVim does, and that’s xterm’s default behaviour;
- send an Esc along with the key, i.e. Altj outputs Escj — this is sometimes referred to as an “8-bit clean” behavior, and that’s the default behavior of all modern terminal emulators.
Suckless.vim assumes that the Alt key modifies the 8th bit in GUI mode
and sends sends escape in CLI mode, but you can override this setting by setting
g:MetaSendsEscape variable accordingly.
On MacOSX, the Alt key might not be enabled in your terminal by
default. On MacVim, you’ll have to set the
macmeta pref to enable Option
keys as "Meta" (MacVim ≥ 7.3 required); and if you want to keep one Option key,
this patch can help.
If you’re not pleased with Alt-* shortcuts, you’ll have to define your own shortcuts directly in the
suckless.vim file. :-/
Bug reports, suggestions and pull requests are welcome.