Semantic history command for iTerm2 and Neovim.
In iTerm's Preferences > Profiles > Default > Advanced > Semantic History, choose Run command... and enter /your/path/to/iterm_open_with \5 \1 \2.
Semantic history command for iTerm2 and Neovim.
In iTerm's Preferences > Profiles > Default > Advanced > Semantic History, choose Run command... and enter /your/path/to/iterm_open_with \5 \1 \2.
| [alias] | |
| co = !"find_and_checkout_branch(){\ | |
| for last; do true; done ; \ | |
| pattern='^/.*/$' ;\ | |
| if [[ $# -eq 1 && $last =~ $pattern ]] ;\ | |
| then \ | |
| branch_pattern=`echo $last | sed -e 's/^\\///' -e 's/\\/$//'` ;\ | |
| branch=`git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | grep -E $branch_pattern | head -n1` ;\ | |
| if [[ $branch ]] ; then \ | |
| git checkout $branch ;\ |
| # To Setup: | |
| # 1) Save the .git-completion.bash file found here: | |
| # https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
| # 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect: | |
| # Git branch bash completion | |
| if [ -f ~/.git-completion.bash ]; then | |
| . ~/.git-completion.bash | |
| # Add git completion to aliases |