Skip to content

Instantly share code, notes, and snippets.

@rocknrollMarc
Created May 22, 2015 12:59
Show Gist options
  • Save rocknrollMarc/2901fda544020b1c4ba3 to your computer and use it in GitHub Desktop.
Save rocknrollMarc/2901fda544020b1c4ba3 to your computer and use it in GitHub Desktop.
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <[email protected]>
#
# Source Prezto.
# node version manager
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
# Docker machine
eval "$(docker-machine env docker)"
###-begin-npm-completion-###
#
# npm command completion script
#
# Installation: npm completion >> ~/.bashrc (or ~/.zshrc)
# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm
############################################################
# Executes commands at the start of an interactive session.#
############################################################
# Author: Rocknrollmarc <[email protected]>#
##################################################
################################################
###############################################################################################
###############################################################################################
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
###############################################################################################
###############################################################################################
# source antigen zshell framework
source ~/.yadr/antigen/antigen.zsh
###############################################################################################
###############################################################################################
# go devtodo2 tasks / todos
source "~/go/bin/devtodo2"
###############################################################################################
###############################################################################################
# source yadr zsh framework
for config_file ($HOME/.yadr/zsh/*.zsh) source $config_file
###############################################################################################
###############################################################################################
# Golang go tags
goctags () { godeps ./… | awk -v GOPATH=$GOPATH ‘{print GOPATHâ€x157/src/â€x157$1}’ | xargs ctags -R .; }
###############################################################################################
###############################################################################################
# RVM
pom() { pompom -e "$*" && pompom -d 5 "Break Time" }
###############################################################################################
###############################################################################################
# Ruby version manager / needs to be last in .zshrc
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
################################################################################################
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
export COMP_WORDBREAKS
if type complete &>/dev/null; then
_npm_completion () {
local si="$IFS"
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
COMP_LINE="$COMP_LINE" \
COMP_POINT="$COMP_POINT" \
npm completion -- "${COMP_WORDS[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
complete -o default -F _npm_completion npm
elif type compdef &>/dev/null; then
_npm_completion() {
local si=$IFS
compadd -- $(COMP_CWORD=$((CURRENT-1)) \
COMP_LINE=$BUFFER \
COMP_POINT=0 \
npm completion -- "${words[@]}" \
2>/dev/null)
IFS=$si
}
compdef _npm_completion npm
elif type compctl &>/dev/null; then
_npm_completion () {
local cword line point words si
read -Ac words
read -cn cword
let cword-=1
read -l line
read -ln point
si="$IFS"
IFS=$'\n' reply=($(COMP_CWORD="$cword" \
COMP_LINE="$line" \
COMP_POINT="$point" \
npm completion -- "${words[@]}" \
2>/dev/null)) || return $?
IFS="$si"
}
compctl -K _npm_completion npm
fi
###-end-npm-completion-###
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment