-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
48 lines (40 loc) · 1.81 KB
/
Copy path.bashrc
File metadata and controls
48 lines (40 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# bplug: bash plugin manager
BPLUG_REPO_DIR=~/.bplug/repos
BPLUG_BIN_DIR=~/.bplug/bin
function bplug_init() {
[ ! -d $BPLUG_REPO_DIR ] && mkdir -p $BPLUG_REPO_DIR
[ ! -d $BPLUG_BIN_DIR ] && mkdir -p $BPLUG_BIN_DIR
[[ ":$PATH:" == *":$BPLUG_BIN_DIR:"* ]] || export PATH=$BPLUG_BIN_DIR:$PATH
}
function bplug() {
[ ! -d $BPLUG_REPO_DIR/${1} ] && git clone http://github.com/${1} $BPLUG_REPO_DIR/${1}
[ ! -z "${2}" ] && source $BPLUG_REPO_DIR/${1}/${2}
}
function bplug_bin() {
[ ! -e $BPLUG_BIN_DIR/${3} ] && wget -qO- $(curl -s "https://api.github.com/repos/${1}/releases/latest" | awk "/browser_download_url.*${2}/{print \$2}"|tr -d \") | tar -xz -C $BPLUG_BIN_DIR
}
# /bplug
[ -e ~/.shell_alias ] && source ~/.shell_alias
[ -e ~/.shell_env ] && source ~/.shell_env
[ -e ~/.shell_functions ] && source ~/.shell_functions
# Plugins
bplug_init
bplug 'mrzool/bash-sensible' 'sensible.bash'
bplug 'nojhan/liquidprompt' 'liquidprompt'
bplug_bin 'junegunn/fzf-bin' 'linux_amd64' 'fzf'
bplug 'junegunn/fzf' 'shell/key-bindings.bash'
bplug 'chriskempson/base16-shell' ''
# Select color palette
eval "$(~/.bplug/repos/chriskempson/base16-shell/profile_helper.sh)"
# if command isn't found, suggests a likely package to install
export COMMAND_NOT_FOUND_INSTALL_PROMPT=1
# # k8s completion
command -v kubectl >/dev/null 2>&1 && source <(kubectl completion bash)
command -v helm >/dev/null 2>&1 && source <(helm completion bash)
## Make bash auto-complete liek zsh (similar, not the same)
## https://askubuntu.com/questions/870470/zsh-fish-filename-autocompletion-in-bash
#bind 'set show-all-if-ambiguous on'
#bind 'TAB:menu-complete'
[ -f ~/.fzf.bash ] && source ~/.fzf.bash