Key binding in iTerm2
The escape sequences mentioned in that question correspond to zle (zshell line editor) widgets documented here.

They provide emacs(or vi) like editing functions. You can see which are currently bound to keys by typing bindkey command in zsh.

You can also write shell functions and then declare those as widgets which can then be key bound. Here is a guide to zle.

The slight complication is that Iterm2 will not, by default, pass alt or Cmd modified strokes through to the shell. 

This can be configured in iTerm2 → Preferences → Profiles → keys.

An alt+ key  is equivalent to esc followed by key, hence to pass this to the sh you add a key bind to:

Action: Send escape sequence 

Esc+: key