I use Mac OS X and Arch Linux and occasionally log into FreeBSD and Debian servers by ssh. My favoured tools are zsh, ssh, tmux, git, vim and irssi. I use iTerm2 on Mac OS X and unicode-rxvt on Arch Linux, where I also use Xmonad as window manager.
Currently Ctrl+a+n shifts to the next window in tmux, Alt+right shifts to the next in irssi, Cmd+right shifts to the next tab in iTerm2, Ctrl+w+w shifts to the next buffer in vim and so on. Basically it's just a mess and even though some of these sit in the muscle memory most don't. I'm looking for what could be a consistent keybinding scheme.
In my mind I figure Cmd/Super/Win ought to be used by the OS desktop environment and/or window manager, Alt would be tmux and Ctrl would be vim and irssi. That is going from right to left on the keyboard; Cmd, Alt, Ctrl, and in a somewhat hierarchical way, OS/DE/WM, multiplexer, editor/irc client.
Hence, something like this:
Cmd+Left/+Right - Switch workspace (Xmonad)
Alt+Left+/Right - Switch tmux window
Ctrl+Left/+Right - Switch irssi window/vim buffer
Cmd+1 - Switch to workspace 1 (Xmonad)
Alt+1 - Switch to tmux window 1
Ctrl+1 - Switch to irssi window 1/vim buffer 1
Would this be viable? If not, what uniform keybindings could be used?
I drew a picture (the colours are horrible, I know) to illustrate what I had in mind. I use Dvorak and replaced vim hjkl movement with dhtn - I'll write left/down/up/right to have it make sense for those who don't use vim. Let's keep it to iTerm2 rather than the entire OS X desktop environment (as well as Gnome and KDE). Basically it comes down to this:
cmd+left/right/number for workspaces in Xmonad (or whatever window manager you like)
alt+left/right/number for windows in tmux
ctrl+alt+left/down/up/right/number for buffers in vim
ctrl+alt+left/right/number for windows in irssi
ctrl+left/down/up/right for home/pg down/pg up/end in vim, irssi and zsh
In OS X ctrl+left/down/up/right already works like the above, and alt+left/right moves the cursor by word as opposed to just left/right which moves it by character.
Wouldn't this be fairly logical and intuitive? Am I missing something (conflicting keybindings) or is this doable?