Skip to content

Instantly share code, notes, and snippets.

@glombard
Created November 3, 2014 18:48
Show Gist options
  • Save glombard/a91a822098aed7bb50a7 to your computer and use it in GitHub Desktop.
Save glombard/a91a822098aed7bb50a7 to your computer and use it in GitHub Desktop.
Setting up Apparix for directory bookmarks on Mac OS X
brew install -v apparix
# Installed to: /opt/foo/Cellar/apparix/11-0/bin/apparix
# Add bm/to Bash functions from man page to .bashrc or .local.bash:
man -P cat apparix | awk '/BASH-style functions/{p=1} /---/{if(p==1)p=2; else p=0; next} p>1{print}' >> ~/.local.bash
# Reload my bash config:
source ~/.local.bash
# Now create a bookmark:
cd ~/src/myproject
bm prj
# Go to my project:
to prj
# View my shortcuts
apparix
# or: cat ~/.apparixrc
@glombard
Copy link
Author

glombard commented Dec 2, 2014

It's handy to use $(apparix bookmark-name) in the shell, like I've got a st function in my bash script to easily open any bookmarked git repo in SourceTree:

function st () {
  if [ -z "$1" ]
  then
    apparix
    echo "Please specify which bookmark to open in SourceTree."
  else
    open $(apparix $1) -a sourcetree
  fi
}

Now I can open any bookmarked git repo in SourceTree with st projectname...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment