-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_bashrc
107 lines (85 loc) · 3.15 KB
/
dot_bashrc
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Any copyright is dedicated to the Public Domain.
# https://creativecommons.org/publicdomain/zero/1.0/
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w$(__git_ps1 " (%s)")\[\033[00m\]\$ '
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
shopt -s histverify
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# goto for directory bookmarking
[[ -s "/home/steveno/.goto.sh" ]] && source /home/steveno/.goto.sh
# Setup tmux
if [[ $DISPLAY ]] && [[ -t 1 ]]; then
# If not running interactively, do not do anything
[[ $- != *i* ]] && return
[[ -z "$TMUX" ]] && exec tmux
fi
# Setup kitty bash completion
if test -n "$KITTY_INSTALLATION_DIR"; then
export KITTY_SHELL_INTEGRATION="enabled"
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"
fi
# Various bash config options
export HISTIGNORE='ls:ll:l:cd:pwd:bg:fg:history'
export HISTSIZE=100000
export HISTFILESIZE=10000000
export EDITOR="nvim"
export GOPATH="/home/steveno/.local/share/go"
export OPAMROOT="/home/steveno/.local/share/opam"
export GEM_HOME="/home/steveno/.local/gems"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
export LD_LIBRARY_PATH="/usr/local/lib"
# Setup mise
eval "$(/home/steveno/.local/bin/mise activate bash)"
# kubectl bash completion
source <(microk8s.kubectl completion bash)
# Setup gpg
export GPG_TTY=$(tty)
gpg-connect-agent updatestartupttyp /bye >/dev/null
# neovim
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Add bash completion for my local SSH host file
__complete_ssh_host() {
local KNOWN_FILE
KNOWN_FILE="$HOME/.ssh/known_hosts"
if [ -r "$KNOWN_FILE" ] ; then
local KNOWN_LIST
KNOWN_LIST=$(cut -f 1 -d ' ' "$KNOWN_FILE" | cut -f 1 -d ',' | grep -v '^[0-9[]')
fi
local CONFIG_FILE
CONFIG_FILE="$HOME/.ssh/config"
if [ -r "$CONFIG_FILE" ] ; then
local CONFIG_LIST
CONFIG_LIST=$(awk '/^Host [A-Za-z]+/ {print $2}' "$CONFIG_FILE")
fi
local PARTIAL_WORD
PARTIAL_WORD="${COMP_WORDS[COMP_CWORD]}";
COMPREPLY=( $(compgen -W "$KNOWN_LIST$IFS$CONFIG_LIST" -- "$PARTIAL_WORD") )
return 0
}
complete -F __complete_ssh_host ssh
complete -f -F __complete_ssh_host scp
source ~/.bash_aliases