dotfiles/.void.bashrc

79 lines
2.0 KiB
Plaintext
Raw Normal View History

#!/bin/bash
#
# .void.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#################################
# Mandatory source files
# - bash-completion
# - bash-aliases
# - ps1 # replaced by starship, legacy
2021-09-23 12:46:32 +02:00
# always bash-completion first
[[ -r /usr/share/bash-completion/bash_completion ]] &&\
source /usr/share/bash-completion/bash_completion
2022-07-12 17:01:56 +02:00
# custom bash-completions
[[ -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 ]] &&\
source ~/.bash_aliases
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
2024-02-21 13:55:22 +01:00
[[ -r ~/.ps1 ]] &&\
source ~/.ps1
#################################
# Optional source files
# BEGIN_KITTY_SHELL_INTEGRATION
[[ -n "$KITTY_INSTALLATION_DIR" ]] &&\
[[ -e "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash" ]] &&\
source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash"
# END_KITTY_SHELL_INTEGRATION
# Google CLI
[[ -r ~/.googlerc ]] && source ~/.googlerc
2021-05-19 12:55:08 +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)
2024-03-26 10:19:33 +01:00
HISTSIZE=50000
HISTFILESIZE=50000
# 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
#################################
2024-02-21 13:55:53 +01:00
# Hooks
# - direnv
# - starship
# - zoxide
2021-09-23 12:46:32 +02:00
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)"
2024-02-21 13:55:53 +01:00
command -v zoxide &>/dev/null && eval "$(zoxide init --cmd cd bash)"
2021-09-23 12:46:32 +02:00
2024-02-21 13:55:53 +01:00
#################################
# Environment variables
2021-09-23 12:46:32 +02:00
export XBPS_DISTDIR="$HOME/git/void-packages"
export SVDIR="$HOME/sv"
2022-01-28 14:08:27 +01:00