This code is a little step beyond Nuke's input and output connection hotkey. It does the same, but with several nodes at the same time.
It can connect the inputs of the nodes you have selected to the last node of your selection. I always mentally think "connect these, here" when I do the selection to not forget the correct order. If a node has several inputs this code will connect the next available one (for example, if B is connected in a Merge, it will connect A to the last node you selected). The hotkey I have set for this tool is the same as the native Nuke one: y.
It can also connect the output of a node to another one. Same as with the input, the order of selection matters (remember: "connect this, here"!). The hotkey I use for this one is u.
You can also connect the mask input of one or several nodes at the same time using the same selection order as I mentioned above. I use the hotkey shift+y for this one.
Expand Fast Connections