Compare commits
2 Commits
0f6197f4e2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| f89791d7ff | |||
| 4ee8c17fad |
47
.bashrc
47
.bashrc
@ -1,40 +1,42 @@
|
|||||||
# ==============================================================================
|
|
||||||
# Personal $HOME/.bashrc file by James Blair <mail@jamesblair.net>
|
|
||||||
# ==============================================================================
|
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[ -z "$PS1" ] && return
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
# don't put duplicate lines or lines starting with space in the history.
|
# Don't put duplicate lines or lines starting with space in the history.
|
||||||
HISTCONTROL=ignoreboth
|
HISTCONTROL=ignoreboth
|
||||||
|
|
||||||
# append to the history file, don't overwrite it
|
# Append to the history file, don't overwrite it
|
||||||
# also ensure we write to history immediately instead of only on terminal close
|
# Also ensure we write to history immediately instead of only on terminal close
|
||||||
shopt -s histappend
|
shopt -s histappend
|
||||||
export PROMPT_COMMAND="history -a; history -n"
|
export PROMPT_COMMAND="history -a; history -n"
|
||||||
|
|
||||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
# Retain infinite bash history
|
||||||
HISTSIZE=10000
|
HISTSIZE=-1
|
||||||
HISTFILESIZE=20000
|
HISTFILESIZE=-1
|
||||||
|
|
||||||
# check the window size after each command and, if necessary,
|
# Check the window size after each command and, if necessary
|
||||||
# update the values of LINES and COLUMNS.
|
# update the values of LINES and COLUMNS.
|
||||||
shopt -s checkwinsize
|
shopt -s checkwinsize
|
||||||
|
|
||||||
# enable color support of ls and also add handy aliases
|
# Alias ls to eza
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
if [ "$(command -v eza)" ]; then
|
||||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
alias ll='eza -l --icons=auto --group-directories-first'
|
||||||
alias ls='ls -l --color=auto -h --group-directories-first'
|
alias ls='eza -l --icons=auto --group-directories-first'
|
||||||
alias ll='ls -l --color=auto -h --group-directories-first'
|
fi
|
||||||
|
|
||||||
|
# Alias cat to bat
|
||||||
|
if [ "$(command -v bat)" ]; then
|
||||||
|
alias cat='bat --style=plain --pager=never' 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Alias docker to podman
|
# Alias docker to podman
|
||||||
alias docker=podman
|
alias docker=podman
|
||||||
|
|
||||||
# Custom git alias for pushing to all remotes at once
|
# Alias df to dysk
|
||||||
alias gpa='git remote | xargs -L1 git push --all'
|
if [ "$(command -v bat)" ]; then
|
||||||
|
alias df=dysk
|
||||||
|
fi
|
||||||
|
|
||||||
# simplify bitwarden cli usage
|
# Simplify bitwarden cli usage
|
||||||
cpcmd="xclip -selection c"; if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then cpcmd="wl-copy"; fi
|
cpcmd="xclip -selection c"; if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then cpcmd="wl-copy"; fi
|
||||||
alias bwu='export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)'
|
alias bwu='export BW_SESSION=$(bw unlock --raw > ~/.bw_session && cat ~/.bw_session)'
|
||||||
|
|
||||||
@ -88,9 +90,7 @@ function bwai () {
|
|||||||
bw encode | bw create item && bw sync
|
bw encode | bw create item && bw sync
|
||||||
}
|
}
|
||||||
|
|
||||||
# enable programmable completion features (you don't need to enable
|
# Enable programmable completion features
|
||||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
|
||||||
# sources /etc/bash.bashrc).
|
|
||||||
if ! shopt -oq posix; then
|
if ! shopt -oq posix; then
|
||||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||||
. /usr/share/bash-completion/bash_completion
|
. /usr/share/bash-completion/bash_completion
|
||||||
@ -135,7 +135,7 @@ else
|
|||||||
# Set pid + auth sock to ensure existing ssh-agent will be re-used
|
# Set pid + auth sock to ensure existing ssh-agent will be re-used
|
||||||
export SSH_AGENT_PID=$(pgrep ssh-agent)
|
export SSH_AGENT_PID=$(pgrep ssh-agent)
|
||||||
if [ -d "/tmp/ssh" ]; then
|
if [ -d "/tmp/ssh" ]; then
|
||||||
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
|
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -name agent.*)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -167,6 +167,7 @@ alias bthsd="bluetoothctl disconnect CC:98:8B:B6:F0:8E"
|
|||||||
# Add kubectl krew plugins to path
|
# Add kubectl krew plugins to path
|
||||||
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
|
||||||
|
|
||||||
|
# Enable simple bash prompt
|
||||||
SBP_PATH=/home/james/Downloads/sbp
|
SBP_PATH=/home/james/Downloads/sbp
|
||||||
source /home/james/Downloads/sbp/sbp.bash
|
source /home/james/Downloads/sbp/sbp.bash
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user