How can I configure Bash, Zsh or Tmux to complete the last matching identifier on the screen? Consider this common scenario:
$ git fetch remote: Counting objects: 16, done. remote: Compressing objects: 100% (9/9), done. remote: Total 9 (delta 4), reused 0 (delta 0) Unpacking objects: 100% (9/9), done. From /opt/git/thunder * [new branch] issue540 -> origin/issue547314 e9204cf..4d42c3f v2.1 -> origin/v2.1
How can I get Bash / Zsh/ Tmux to complete
issue547 on the CLI easily? When I press Tab after
$ git checkout is Git helpfully completes to
issue, but I must complete the digits by myself because all the previous digits do in fact match existent Git branches.
In VIM, pressing Ctrl+P for omnicomplete will complete as the previous match, so in this case
issue547314 will in fact be completed. How can I get this behaviour in Bash, in Zsh or in Tmux?
I'm currently using Bash 4.2 and Tmux 1.10 on Ubuntu Server (usually 12.04 LTS). I can update to the latest Ubuntu Server LTS (14.04) if needed.
EDIT: I would not mind any solution that uses Bash, Zsh, or Tmux as long as it is not difficult to use. So Tab or Ctrl+P or some other such shortcut would be fine, but not Alt+Meta+Super+Shift+א.