Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -3,3 +3,4 @@ about-alias 'Atom.io editor abbreviations'
|
|||||||
|
|
||||||
alias a='atom'
|
alias a='atom'
|
||||||
alias ah='atom .'
|
alias ah='atom .'
|
||||||
|
alias apmup='apm update --no-confirm'
|
||||||
|
|||||||
8
completion/available/npm.completion.bash
Normal file
8
completion/available/npm.completion.bash
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# npm (Node Package Manager) completion
|
||||||
|
|
||||||
|
if command -v npm &>/dev/null
|
||||||
|
then
|
||||||
|
eval "$(npm completion)"
|
||||||
|
fi
|
||||||
@@ -365,10 +365,10 @@ all_groups ()
|
|||||||
if ! type pathmunge > /dev/null 2>&1
|
if ! type pathmunge > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
function pathmunge () {
|
function pathmunge () {
|
||||||
_about 'prevent duplicate directories in you PATH variable'
|
about 'prevent duplicate directories in you PATH variable'
|
||||||
_group 'lib helpers'
|
group 'lib helpers'
|
||||||
_example 'pathmunge /path/to/dir is equivalent to PATH=/path/to/dir:$PATH'
|
example 'pathmunge /path/to/dir is equivalent to PATH=/path/to/dir:$PATH'
|
||||||
_example 'pathmunge /path/to/dir after is equivalent to PATH=$PATH:/path/to/dir'
|
example 'pathmunge /path/to/dir after is equivalent to PATH=$PATH:/path/to/dir'
|
||||||
|
|
||||||
if ! [[ $PATH =~ (^|:)$1($|:) ]] ; then
|
if ! [[ $PATH =~ (^|:)$1($|:) ]] ; then
|
||||||
if [ "$2" = "after" ] ; then
|
if [ "$2" = "after" ] ; then
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ about-plugin 'AWS helper functions'
|
|||||||
function awskeys {
|
function awskeys {
|
||||||
about 'helper function for AWS credentials file'
|
about 'helper function for AWS credentials file'
|
||||||
group 'aws'
|
group 'aws'
|
||||||
|
|
||||||
|
if [[ ! -f ~/.aws/credentials ]]; then
|
||||||
|
echo "AWS credentials file not found"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $# -eq 1 ]] && [[ "$1" = "list" ]]; then
|
if [[ $# -eq 1 ]] && [[ "$1" = "list" ]]; then
|
||||||
__awskeys_list "$2"
|
__awskeys_list "$2"
|
||||||
elif [[ $# -eq 1 ]] && [[ "$1" = "unset" ]]; then
|
elif [[ $# -eq 1 ]] && [[ "$1" = "unset" ]]; then
|
||||||
@@ -39,8 +45,8 @@ function __awskeys_list {
|
|||||||
local credentials_list="$(egrep '^\[ *[a-zA-Z0-9_-]+ *\]$' ~/.aws/credentials)"
|
local credentials_list="$(egrep '^\[ *[a-zA-Z0-9_-]+ *\]$' ~/.aws/credentials)"
|
||||||
if [[ -n $"{credentials_list}" ]]; then
|
if [[ -n $"{credentials_list}" ]]; then
|
||||||
echo -e "Available credentials profiles:\n"
|
echo -e "Available credentials profiles:\n"
|
||||||
for cred in ${credentials_list}; do
|
for profile in ${credentials_list}; do
|
||||||
echo " $(echo ${cred} | tr -d "[]")"
|
echo " $(echo ${profile} | tr -d "[]")"
|
||||||
done
|
done
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
@@ -73,3 +79,29 @@ function __awskeys_export {
|
|||||||
function __awskeys_unset {
|
function __awskeys_unset {
|
||||||
unset AWS_DEFAULT_PROFILE AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
|
unset AWS_DEFAULT_PROFILE AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __awskeys_comp {
|
||||||
|
local cur prev opts prevprev
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
opts="help list show export unset"
|
||||||
|
|
||||||
|
case "${prev}" in
|
||||||
|
help|list|unset)
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
show|export)
|
||||||
|
local profile_list="$(__awskeys_list | grep " ")"
|
||||||
|
COMPREPLY=( $(compgen -W "${profile_list}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
complete -F __awskeys_comp awskeys
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ about-plugin 'use mactex'
|
|||||||
# add mactex to the path if its present
|
# add mactex to the path if its present
|
||||||
MACTEX_PATH=/usr/local/texlive/2009/bin/universal-darwin
|
MACTEX_PATH=/usr/local/texlive/2009/bin/universal-darwin
|
||||||
if [[ -d $MACTEX_PATH ]]; then
|
if [[ -d $MACTEX_PATH ]]; then
|
||||||
export PATH=$PATH:$MACTEX_PATH
|
pathmunge $MACTEX_PATH after
|
||||||
fi
|
fi
|
||||||
unset MACTEX_PATH
|
unset MACTEX_PATH
|
||||||
|
|||||||
32
plugins/available/less-pretty-cat.plugin.bash
Normal file
32
plugins/available/less-pretty-cat.plugin.bash
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
cite about-plugin
|
||||||
|
about-plugin 'pygmentize instead of cat to terminal if possible'
|
||||||
|
|
||||||
|
if [ -z $(which pygmentize) ]
|
||||||
|
then
|
||||||
|
echo "Pygments is required to use this plugin"
|
||||||
|
echo "Install it by doing 'pip install Pygments' as the superuser"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# get the full paths to binaries
|
||||||
|
CAT_BIN=$(which cat)
|
||||||
|
LESS_BIN=$(which less)
|
||||||
|
|
||||||
|
# pigmentize cat and less outputs
|
||||||
|
cat()
|
||||||
|
{
|
||||||
|
about 'runs either pygmentize or cat on each file passed in'
|
||||||
|
param '*: files to concatenate (as normally passed to cat)'
|
||||||
|
example 'cat mysite/manage.py dir/text-file.txt'
|
||||||
|
for var;
|
||||||
|
do
|
||||||
|
pygmentize "$var" 2>/dev/null || "$CAT_BIN" "$var";
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
less()
|
||||||
|
{
|
||||||
|
about 'it pigments the file passed in and passes it to less for pagination'
|
||||||
|
param '$1: the file to paginate with less'
|
||||||
|
example 'less mysite/manage.py'
|
||||||
|
pygmentize "$*" | "$LESS_BIN" -R
|
||||||
|
}
|
||||||
@@ -3,5 +3,5 @@ about-plugin 'load pipsi, if you are using it'
|
|||||||
|
|
||||||
if [[ -f "$HOME/.local/bin/pipsi" ]]
|
if [[ -f "$HOME/.local/bin/pipsi" ]]
|
||||||
then
|
then
|
||||||
export PATH=~/.local/bin:$PATH
|
pathmunge ~/.local/bin
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ cite about-plugin
|
|||||||
about-plugin 'load pyenv, if you are using it'
|
about-plugin 'load pyenv, if you are using it'
|
||||||
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
pathmunge $PYENV_ROOT
|
||||||
|
|
||||||
[[ `which pyenv` ]] && eval "$(pyenv init -)"
|
[[ `which pyenv` ]] && eval "$(pyenv init -)"
|
||||||
|
|
||||||
#Load pyenv virtualenv if the virtualenv plugin is installed.
|
#Load pyenv virtualenv if the virtualenv plugin is installed.
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
cite about-plugin
|
cite about-plugin
|
||||||
about-plugin 'load rbenv, if you are using it'
|
about-plugin 'load rbenv, if you are using it'
|
||||||
|
|
||||||
export PATH="$HOME/.rbenv/bin:$PATH"
|
pathmunge "${HOME}/.rbenv/bin"
|
||||||
|
|
||||||
[[ `which rbenv` ]] && eval "$(rbenv init -)"
|
[[ `which rbenv` ]] && eval "$(rbenv init -)"
|
||||||
|
|
||||||
# Load the auto-completion script if rbenv was loaded.
|
# Load the auto-completion script if rbenv was loaded.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ about-plugin 'ruby and rubygems specific functions and settings'
|
|||||||
# Make commands installed with 'gem install --user-install' available
|
# Make commands installed with 'gem install --user-install' available
|
||||||
# ~/.gem/ruby/${RUBY_VERSION}/bin/
|
# ~/.gem/ruby/${RUBY_VERSION}/bin/
|
||||||
if which ruby >/dev/null && which gem >/dev/null; then
|
if which ruby >/dev/null && which gem >/dev/null; then
|
||||||
PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin";
|
pathmunge "$(ruby -e 'print Gem.user_dir')/bin" after
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function remove_gem {
|
function remove_gem {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ fi
|
|||||||
# respect ENV var set in .bash_profile, default is 't'
|
# respect ENV var set in .bash_profile, default is 't'
|
||||||
alias $TODO='$TODO_SRC_DIR/todo.sh -d $TODO_SRC_DIR/todo.cfg'
|
alias $TODO='$TODO_SRC_DIR/todo.sh -d $TODO_SRC_DIR/todo.cfg'
|
||||||
|
|
||||||
export PATH=$PATH:$TODO_SRC_DIR
|
pathmunge $TODO_SRC_DIR after
|
||||||
|
|
||||||
source $TODO_SRC_DIR/todo_completion # bash completion for todo.sh
|
source $TODO_SRC_DIR/todo_completion # bash completion for todo.sh
|
||||||
complete -F _todo $TODO # enable completion for 't' alias
|
complete -F _todo $TODO # enable completion for 't' alias
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bats
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
load ../test_helper
|
load ../test_helper
|
||||||
|
load ../../lib/helpers
|
||||||
load ../../lib/composure
|
load ../../lib/composure
|
||||||
load ../../plugins/available/ruby.plugin
|
load ../../plugins/available/ruby.plugin
|
||||||
|
|
||||||
|
|||||||
@@ -250,6 +250,22 @@ function virtualenv_prompt {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function condaenv_prompt {
|
||||||
|
if [[ $CONDA_DEFAULT_ENV ]]; then
|
||||||
|
echo -e "${CONDAENV_THEME_PROMPT_PREFIX}${CONDA_DEFAULT_ENV}${CONDAENV_THEME_PROMPT_SUFFIX}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function py_interp_prompt {
|
||||||
|
py_version=$(python --version 2>&1 | awk '{print "py-"$2;}') || return
|
||||||
|
echo -e "${PYTHON_THEME_PROMPT_PREFIX}${py_version}${PYTHON_THEME_PROMPT_SUFFIX}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function python_version_prompt {
|
||||||
|
echo -e "$(virtualenv_prompt)$(condaenv_prompt)$(py_interp_prompt)"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# backwards-compatibility
|
# backwards-compatibility
|
||||||
function git_prompt_info {
|
function git_prompt_info {
|
||||||
git_prompt_vars
|
git_prompt_vars
|
||||||
|
|||||||
19
themes/bobby-python/bobby-python.theme.bash
Normal file
19
themes/bobby-python/bobby-python.theme.bash
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||||
|
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||||
|
SCM_THEME_PROMPT_PREFIX=" |"
|
||||||
|
SCM_THEME_PROMPT_SUFFIX="${green}|"
|
||||||
|
|
||||||
|
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
|
||||||
|
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
|
||||||
|
GIT_THEME_PROMPT_PREFIX=" ${green}|"
|
||||||
|
GIT_THEME_PROMPT_SUFFIX="${green}|"
|
||||||
|
|
||||||
|
CONDAENV_THEME_PROMPT_SUFFIX="|"
|
||||||
|
|
||||||
|
function prompt_command() {
|
||||||
|
#PS1="${bold_cyan}$(scm_char)${green}$(scm_prompt_info)${purple}$(ruby_version_prompt) ${yellow}\h ${reset_color}in ${green}\w ${reset_color}\n${green}→${reset_color} "
|
||||||
|
PS1="\n${yellow}$(python_version_prompt) ${purple}\h ${reset_color}in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT_COMMAND=prompt_command;
|
||||||
Reference in New Issue
Block a user