提交 ee619e26 编写于 作者: T Toan Nguyen

Merge branch 'master' of github.com:ohmybash/oh-my-bash

[[ -x "$(which aws_completer)" ]] && complete -C "$(which aws_completer)" aws
[[ -x "$(which aws_completer)" ]] &>/dev/null && complete -C "$(which aws_completer)" aws
#!/usr/bin/env bash
which register-python-argcomplete > /dev/null \
which register-python-argcomplete &> /dev/null \
&& eval "$(register-python-argcomplete conda)" \
|| echo "Please install argcomplete to use conda completion" > /dev/null
[[ -x "$(which jungle)" ]] && eval "$(_JUNGLE_COMPLETE=source jungle)"
[[ -x "$(which jungle)" ]] &>/dev/null && eval "$(_JUNGLE_COMPLETE=source jungle)"
which kontena > /dev/null && . "$( kontena whoami --bash-completion-path )"
which kontena &> /dev/null && . "$( kontena whoami --bash-completion-path )"
......@@ -3,7 +3,20 @@
# P.C. Shyamshankar <sykora@lucentbeing.com>
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
typeset -Ag FX FG BG
# typeset in bash does not have associative arrays, declare does in bash 4.0+
# https://stackoverflow.com/a/6047948
_RED='\033[0;31m' # Red Color (For error)
_NC='\033[0m' # No Color (To reset the terminal color)
if [ "${BASH_VERSINFO[0]}" -lt 4 ]; then
echo -e "${_RED}ERROR${_NC}: Sorry, you need at least bash-4.0 to run this script." >&2;
exit 1;
fi
declare -Ag FX FG BG
FX=(
[reset]="%{^[[00m%}"
......
# aws.plugin.sh
# Author: Michael Anckaert <michael.anckaert@sinax.be>
# Based on oh-my-zsh AWS plugin
#
# command 'agp' returns the selected AWS profile (aws get profile)
# command 'asp' sets the AWS profile to use (aws set profile)
#
export AWS_HOME=~/.aws
function agp {
echo $AWS_DEFAULT_PROFILE
}
function asp {
local rprompt=${RPROMPT/<aws:$(agp)>/}
export AWS_DEFAULT_PROFILE=$1
export AWS_PROFILE=$1
}
# Bashmarks plugin
The Bashmarks plugin allows you to create and use bookmarks for directories on your filesystems.
## Quickstart
Create a new bookmark using the *bm -a* command:
`$ bm -a mydir`
The command above creates a bookmark for the current directory with the name *mydir*.
You can navigate to the location of a bookmark using the *bm -g* command:
`$ bm -g mydir`
Tab completion is available when you need to enter a bookmark name in a command, such as when using *bm -g*
Easily list all bookmarks you have setup using the *bm -l* command.
## Commands
**bm -h** Print short help text
**bm -a bookmarkname** Save the current directory as bookmarkname
**bm -g bookmarkname** Go to the specified bookmark
**bm -p bookmarkname** Print the bookmark
**bm -d bookmarkname** Delete a bookmark
**bm -l** List all bookmarks
## Valid bookmark names
A bookmark name can contain lower and upper case characters (A-Z), numbers and underscore characters. No periods, semicolons, spaces or other characters are allowed in a bookmark name.
# bu.plugin.sh
# Author: Taleeb Midi <taleebmidi@gmail.com>
# Based on oh-my-zsh AWS plugin
#
# command 'bu [N]' Change directory up N times
#
# Faster Change Directory up
function bu () {
function usage () {
cat <<-EOF
Usage: bu [N]
N N is the number of level to move back up to, this argument must be a positive integer.
h help displays this basic help menu.
EOF
}
# reset variables
STRARGMNT=""
FUNCTIONARG=$1
# Make sure the provided argument is a positive integer:
if [[ ! -z "${FUNCTIONARG##*[!0-9]*}" ]]; then
for i in $(seq 1 $FUNCTIONARG); do
STRARGMNT+="../"
done
CMD="cd ${STRARGMNT}"
eval $CMD
else
usage
fi
}
\ No newline at end of file
......@@ -24,7 +24,7 @@
# mcd: Makes new Dir and jumps inside
# --------------------------------------------------------------------
mcd () { builtin mkdir -p -- "$*" ; builtin cd -- "$*" ; }
mcd () { mkdir -p -- "$*" ; builtin cd -- "$*" ; }
# mans: Search manpage given in agument '1' for term given in argument '2' (case insensitive)
# displays paginated result with colored search terms and two lines surrounding each hit.
......
# Git Plugin
The git plugin defines a number of useful aliases for you. [Consult the complete list](git.plugin.sh#L34)
......@@ -49,7 +49,10 @@ OSH_THEME="font"
# Add wisely, as too many plugins slow down shell startup.
plugins=(core git bashmarks progress)
source $OSH/oh-my-bash.sh
if tty -s
then
source $OSH/oh-my-bash.sh
fi
# User configuration
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册