2021-05-19 10:25:20 +02:00
#!/bin/bash
#
# .void.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#################################
# - bash_aliases
# - bash-completion
2021-09-23 12:46:32 +02:00
# always bash-completion first
2021-05-19 10:25:20 +02:00
[[ -r /usr/share/bash-completion/bash_completion ]] && . /usr/share/bash-completion/bash_completion
2022-07-12 17:01:56 +02:00
# custom bash-completions
2023-09-09 11:52:27 +02:00
[ -d ~/.config/completions ] && { for i in ~/.config/completions/*; do source $i; done }
2022-06-09 13:53:09 +02:00
2023-05-22 10:06:01 +02:00
# source distro and general purpose aliases
[[ -r ~/.bash_aliases ]] && . ~/.bash_aliases
2021-09-23 12:46:32 +02:00
# integrate git prompt functions
# will break PS1 if not used
2021-05-19 10:25:20 +02:00
[[ -f /usr/share/git/git-prompt.sh ]] && . /usr/share/git/git-prompt.sh
2023-05-22 10:06:01 +02:00
# kube-ps1
# located in ~/git/kube-ps1
[[ -r ~/git/kube-ps1/kube-ps1.sh ]] && . ~/git/kube-ps1/kube-ps1.sh
2021-05-26 16:13:50 +02:00
2021-09-23 12:46:32 +02:00
# set PS1 from file
# USE ONLY AFTER GIT PROMPT
2021-05-19 12:55:08 +02:00
[[ -r ~/.ps1 ]] && . ~/.ps1
2021-05-19 10:25:20 +02:00
#################################
# don't put duplicate lines or lines starting with space in the history.
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# 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)"
2021-09-23 12:46:32 +02:00
#################################
# - hooks
command -v direnv &>/dev/null && eval "$(direnv hook bash)"
2023-09-09 10:56:29 +02:00
command -v starship &>/dev/null && eval "$(starship init bash)"
2021-09-23 12:46:32 +02:00
# - env vars
2023-09-09 11:50:39 +02:00
export XBPS_DISTDIR="$HOME/git/void-packages"
export SVDIR="$HOME/sv"
2022-01-28 14:08:27 +01:00
# BEGIN_KITTY_SHELL_INTEGRATION
if test -n "$KITTY_INSTALLATION_DIR" -a -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; then source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"; fi
# END_KITTY_SHELL_INTEGRATION