set -g status-keys vi
setw -g mode-keys vi
But I had been using spectrwm for my window manager. And a good friend, Andrew Fresh (afresh1), suggested that I try out cwm(1). So I did.
At first cwm is off-putting. There are no menus and if you lose your one xterm (with which you can run `man cwm`), you're screwed.
For the purposes of this post, C=control, M=alt, 4=windows-key, S=shift.
Some quick notes that are helpful:
- CM-Enter spawns a new xterm
- CM-= maximizes the window vertically
- CMS-= maximizes the window horizontally
- MS-/ spawns exec menu (MS-/, then "firefox" launches Firefox)
- CM-[n] selects window group [n]
- CM-0 selects all groups
- CM-g adds currently selected window to currently selected group
- CMS-r restarts cwm (re-reading .cwmrc)
- CMS-q quits
You can also resize windows using the keyboard. You can move and resize windows with the mouse too. These are described well in the man page.
However, the thing that I found hardest to grasp was how to use window groups as virtual desktops. And the piece that I was missing was that I hadn't read cwmrc(1). There are two directives that aren't included in the default keyboard shortcuts list: grouponly[n] and movetogroup[n] (where [n] is the number corresponding to window groups 1-9).
You can select a group and add a window to it. And you can toggle that group's visibility with CM-[n].
But, window groups get more powerful when you can select a window group while hiding windows in any other group.
To do this, I added the following to my ~/.cwmrc (and typed CMS-r):
bind M-1 grouponly1
bind M-2 grouponly2
bind M-3 grouponly3
bind M-4 grouponly4
bind M-5 grouponly5
bind M-6 grouponly6
bind M-7 grouponly7
bind M-8 grouponly8
bind M-9 grouponly9
bind MS-1 movetogroup1
bind MS-2 movetogroup2
bind MS-3 movetogroup3
bind MS-4 movetogroup4
bind MS-5 movetogroup5
bind MS-6 movetogroup6
bind MS-7 movetogroup7
bind MS-8 movetogroup8
bind MS-9 movetogroup9
Now, if I type M-2, it only shows windows in window group 2. And, I can more easily move windows to other groups with MS-[n].
If you've used cwm and missed virtual desktops, I hope this helps you.