I think D- mappings only work in Macvim, but you can map it in iTerm2 by sending hex key codes (which is a slightly tedious process).
- In iTerm, go to Preferences -> Profiles -> Keys, and hit
+ to add a new mapping
- Record your Keyboard Shortcut
Send Hex Codes option and define your vim mappings in hex key codes.
To find out the hex key codes you can use the
xxd tool which you should be having by default. Note that you have to hit
C-v C-w to input
C-w (just like you would do in vim), same method for any special character.
Just for reference in my system, these were the hex key codes for each of the vim mappings you would need -
3517 3e (5<C-w>> increase window width 5 times)
3517 3c (5<C-w>< decrease window width 5 times)
3517 2b (5<C-w>+ increase window height 5 times)
3517 2d (5<C-w>- decrease window height 5 times)
Also note that you can export your iTerm2 profile in case you want to source control them.