dots/.bashrc

105 lines
2.8 KiB
Bash
Raw Permalink Normal View History

2020-04-07 22:24:30 +02:00
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
2023-06-14 21:28:41 +02:00
2023-02-26 23:38:43 +01:00
source /etc/os-release
2024-09-29 11:41:29 +02:00
# Editor & prompt configuration
2024-09-29 11:36:20 +02:00
[ -f "$HOME/.bashrc.d/editor" ] && source "$HOME/.bashrc.d/editor"
2024-09-29 11:41:29 +02:00
[ -f "$HOME/.bashrc.d/prompt" ] && source "$HOME/.bashrc.d/prompt"
2024-09-29 11:36:20 +02:00
2020-10-30 16:49:22 +01:00
# Load aliases dynamically
2023-05-21 19:35:20 +02:00
[ -f "$HOME/.bash_aliases/all" ] && source "$HOME/.bash_aliases/all"
2024-09-29 11:38:47 +02:00
[ -f "$HOME/.bash_aliases/hosts/$HOSTNAME" ] && source "$HOME/.bash_aliases/hosts/$HOSTNAME"
2023-08-02 16:42:46 +02:00
[ -f "$HOME/.bash_aliases/private" ] && source "$HOME/.bash_aliases/private"
2023-08-02 17:06:28 +02:00
2024-09-29 11:41:29 +02:00
# Host-specific and private configurations
2024-09-29 11:38:47 +02:00
[ -f "$HOME/.bashrc.d/hosts/$HOSTNAME" ] && source "$HOME/.bashrc.d/hosts/$HOSTNAME"
2023-08-02 17:09:16 +02:00
[ -f "$HOME/.bashrc.d/private" ] && source "$HOME/.bashrc.d/private"
2022-10-25 20:54:01 +02:00
# Path {{{
# Add ~/.bin to PATH
export PATH=~/.bin:$PATH
# }}}
# History {{{
2021-12-31 12:44:28 +01:00
export HISTCONTROL=ignoreboth:erasedups
2020-08-18 18:20:58 +02:00
export HISTSIZE=500000
2022-05-11 01:15:26 +02:00
# Omit `clear, ls...`; commands prepended with space
2021-12-31 12:44:28 +01:00
export HISTIGNORE="clear:l: *"
2022-10-25 20:54:01 +02:00
# }}}
2020-04-07 22:24:30 +02:00
2022-10-25 20:54:01 +02:00
# Man pages {{{
2023-03-12 13:15:43 +01:00
# See `:h :Man` in NeoVim
2023-12-10 01:07:20 +01:00
export MANWIDTH=80
export PAGER=nvimpager
2022-10-25 20:54:01 +02:00
# }}}
2020-10-30 16:49:22 +01:00
# Nvm
2021-08-31 14:28:09 +02:00
export PATH=~/.nvm/versions/node/v14.16.0/bin:$PATH
export NVM_DIR="$HOME/.nvm"
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" --no-use
2022-10-25 20:54:01 +02:00
# X11 {{{
2021-08-31 14:28:30 +02:00
export XDG_SESSION_TYPE=X11
export XDG_CONFIG_HOME=$HOME/.config
2023-05-15 13:45:55 +02:00
export XDG_DATA_HOME=$HOME/.local/share
2022-10-25 20:54:01 +02:00
# }}}
2021-08-31 14:28:30 +02:00
2022-10-25 20:54:01 +02:00
# Nix package manager {{{
2022-10-25 20:56:54 +02:00
# Add ~/.nix-profile/bin to PATH
export PATH=~/.nix-profile/bin:$PATH
2022-10-25 20:54:01 +02:00
# }}}
2022-10-25 20:54:01 +02:00
# FZF {{{
2022-10-25 20:56:01 +02:00
# Check if fzf is installed
if [ -f "/usr/bin/fzf" ]; then
# Fuzzy finder setup
export FZF_COMPLETION_TRIGGER='**'
export FZF_DEFAULT_COMMAND='ag --hidden --skip-vcs-ignores -t -g ""'
export FZF_DEFAULT_OPTS="
--pointer='❭'
--height 10%
--color=fg:-1,bg:-1"
export FZF_CTRL_T_COMMAND="${FZF_DEFAULT_COMMAND}"
export FZF_CTRL_T_OPTS="--preview='bat {} | head -500'"
2023-02-26 23:59:09 +01:00
if [[ $ID == "raspbian" ]]; then
source /usr/share/doc/fzf/examples/completion.bash
source /usr/share/doc/fzf/examples/key-bindings.bash
elif [[ $ID == "arch" ]]; then
source /usr/share/fzf/completion.bash
source /usr/share/fzf/key-bindings.bash
fi
2023-03-12 13:17:54 +01:00
_fzf_setup_completion path vim zathura xournalpp nvim mpv
2022-10-25 20:56:01 +02:00
else
echo "fzf not installed"
fi
2022-10-25 20:54:01 +02:00
# }}}
# Node {{{
2022-10-25 20:57:14 +02:00
# Move nvm folder away from home directory
export NVM_DIR="${XDG_CONFIG_HOME}/nvm"
# Pretty much what is in `/usr/share/nvm/init-nvm.sh` but we add the `--no-use`
# flag to `nvm.sh` to make it lazy
source /usr/share/nvm/nvm.sh --no-use
source /usr/share/nvm/bash_completion
source /usr/share/nvm/install-nvm-exec
2022-10-25 20:54:01 +02:00
# }}}
2023-12-08 00:26:26 +01:00
# Go {{{
export GOPATH="${XDG_DATA_HOME}/go"
# }}}
2022-10-25 20:54:01 +02:00
# Jupyter {{{
export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
2022-10-25 20:54:01 +02:00
# }}}
2023-03-12 13:15:43 +01:00
# Conda {{{
[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh
# }}}
2023-05-01 15:34:27 +02:00
# Zettelkasten {{{
export ZK_PATH="$HOME/.zk"