Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function update_bundle_path() {
- if [[ -f .bundle/config ]]; then
- if [[ ! -f .bundle/path || .bundle/path -ot .bundle/config ]]; then
- ruby -rbundler -e 'puts Bundler.bundle_path' > .bundle/path
- fi
- fi
- }
- push chpwd_functions update_bundle_path
- function accept-line-with-bundler() {
- if [[ -r .bundle/path ]]; then
- set -- ${=BUFFER}
- if [[ -x $(< .bundle/path)/bin/$1 ]]; then
- BUFFER="bundle exec $BUFFER"
- fi
- fi
- zle accept-line
- }
- bindkey '^M' accept-line-with-bundler
Add Comment
Please, Sign In to add comment