mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
Merge branch 'master' of github.com:ohmybash/oh-my-bash
This commit is contained in:
@@ -1 +1 @@
|
|||||||
[[ -x "$(which aws_completer)" ]] && complete -C "$(which aws_completer)" aws
|
[[ -x "$(which aws_completer)" ]] &>/dev/null && complete -C "$(which aws_completer)" aws
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
which register-python-argcomplete > /dev/null \
|
which register-python-argcomplete &> /dev/null \
|
||||||
&& eval "$(register-python-argcomplete conda)" \
|
&& eval "$(register-python-argcomplete conda)" \
|
||||||
|| echo "Please install argcomplete to use conda completion" > /dev/null
|
|| echo "Please install argcomplete to use conda completion" > /dev/null
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
[[ -x "$(which jungle)" ]] && eval "$(_JUNGLE_COMPLETE=source jungle)"
|
[[ -x "$(which jungle)" ]] &>/dev/null && eval "$(_JUNGLE_COMPLETE=source jungle)"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
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>
|
# P.C. Shyamshankar <sykora@lucentbeing.com>
|
||||||
# Copied from http://github.com/sykora/etc/blob/master/zsh/functions/spectrum/
|
# 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=(
|
FX=(
|
||||||
[reset]="%{^[[00m%}"
|
[reset]="%{^[[00m%}"
|
||||||
|
|||||||
20
plugins/aws/aws.plugin.sh
Normal file
20
plugins/aws/aws.plugin.sh
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# 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
|
||||||
|
}
|
||||||
37
plugins/bashmarks/README.md
Normal file
37
plugins/bashmarks/README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# 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.
|
||||||
30
plugins/bu/bu.plugin.sh
Normal file
30
plugins/bu/bu.plugin.sh
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# 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
|
||||||
|
}
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
# mcd: Makes new Dir and jumps inside
|
# 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)
|
# 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.
|
# displays paginated result with colored search terms and two lines surrounding each hit.
|
||||||
|
|||||||
3
plugins/git/README.md
Normal file
3
plugins/git/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# 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.
|
# Add wisely, as too many plugins slow down shell startup.
|
||||||
plugins=(core git bashmarks progress)
|
plugins=(core git bashmarks progress)
|
||||||
|
|
||||||
source $OSH/oh-my-bash.sh
|
if tty -s
|
||||||
|
then
|
||||||
|
source $OSH/oh-my-bash.sh
|
||||||
|
fi
|
||||||
|
|
||||||
# User configuration
|
# User configuration
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user