dots/.bashrc

85 lines
1.7 KiB
Bash
Raw Normal View History

2020-04-07 22:24:30 +02:00
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
2022-10-25 20:54:01 +02:00
# Aliases {{{
2020-10-30 16:49:22 +01:00
# Load aliases dynamically
2022-01-18 13:17:26 +01:00
[ -f "$HOME/.bash_aliases" ] && source "$HOME/.bash_aliases"
2022-10-25 20:54:01 +02:00
# }}}
2020-04-07 22:24:30 +02:00
2022-10-25 20:54:01 +02:00
# Prompt {{{
2020-05-07 02:10:20 +02:00
get_branch_name() {
git symbolic-ref --quiet --short HEAD 2>/dev/null \
|| git rev-parse --short HEAD 2>/dev/null \
|| echo 'some branch'
}
get_git_info() {
git rev-parse --is-inside-work-tree &>/dev/null || return
2021-03-28 10:39:14 +02:00
echo -e "$(get_branch_name)"
2020-05-07 02:10:20 +02:00
}
2021-03-28 10:39:14 +02:00
export PS1="\u \w ❭\[$(tput sgr0)\] "
2020-04-07 22:24:30 +02:00
2022-10-25 20:54:01 +02:00
# Ellipsis when deep in directory
export PROMPT_DIRTRIM=2
# }}}
# 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 {{{
2020-12-10 19:40:55 +01:00
export MANWIDTH=120
2022-10-25 20:54:01 +02:00
# }}}
# Editor {{{
# Set vim as default editor
export EDITOR=nvim
# }}}
2020-12-10 19:40:55 +01:00
2020-10-30 16:49:22 +01:00
2020-12-10 19:38:24 +01:00
# Fuzzy finder setup
2022-01-27 11:06:32 +01:00
export FZF_COMPLETION_TRIGGER='**'
2020-05-08 19:54:20 +02:00
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -t -g ""'
2022-05-11 01:16:28 +02:00
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'"
source /usr/share/fzf/completion.bash
source /usr/share/fzf/key-bindings.bash
_fzf_setup_completion path vim
_fzf_setup_completion path zathura
_fzf_setup_completion path xournalpp
2020-05-13 19:05:27 +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
2022-10-25 20:54:01 +02:00
# }}}
# Nix package manager {{{
# }}}
2021-08-31 14:28:30 +02:00
2022-10-25 20:54:01 +02:00
# FZF {{{
# }}}
# Node {{{
# }}}
# Jupyter {{{
export JUPYTERLAB_DIR=$HOME/.local/share/jupyter/lab
2022-10-25 20:54:01 +02:00
# }}}