dotfiles/bashrc/.bashrc

74 lines
2.2 KiB
Bash

#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# that ain't vimlike
set -o vi
bind -m vi-command 'Control-l: clear-screen'
bind -m vi-insert 'Control-l: clear-screen'
# prompt
PS1='\[\e[32m\]\u@\h\[\e[0m\]:\[\e[34m\]\w\[\e[0m\] \$ '
# Source this file from git that expands PS1 stuff
GIT_PS1_SHOWUPSTREAM='verbose name'
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
#GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_DESCRIBE_STYLE=branch
source /etc/bash_completion.d/git-prompt.sh
PS1='\[\e[01;32m\]\u@\h\[\e[0m\]:\[\e[01;34m\]\w\[\e[0m\]$(__git_ps1 "(%s)")\[\e[0m\]\$ '
[[ $PS1 && -f /usr/share/bash-completion/bash_completion ]] && \
. /usr/share/bash-completion/bash_completion
# History settings: no duplicates, decent size
HISTSIZE=10000
HISTFILESIZE=2000
HISTCONTROL=ignoredups
# aliases
alias python="python3"
alias cp="cp -i" # confirm before overwriting something
alias np='nano -w PKGBUILD'
alias more="less"
alias rofi='rofi -m 1'
alias weather="curl wttr.in"
alias ls="eza -lhg --group-directories-first"
alias ll="eza -lhga --group-directories-first"
alias vim="nvim"
alias docs="python ~/scripts/stock_price.py -s docs"
alias stock="python ~/scripts/stock_price.py -s "
alias r="ranger"
alias grep='grep --colour=auto'
alias cdd='. ~/scripts/project_picker.sh'
alias configedit='. ~/scripts/config_edit.sh'
alias clip='cliphist list | fzf --no-sort | cliphist decode | wl-copy'
# expand path
PATH=/usr/local/bin:/usr/bin/:/usr/sbin
PATH=$PATH:~/.local/share
# exports
export EDITOR=/usr/bin/nvim
export BROWSER=firefox
# fzf
export FZF_DEFAULT_OPTS='--layout=reverse --height=50% --preview-window=right:50%:border-sharp --border-label=" command preview " --border=double'
# Set up fzf key bindings and fuzzy completion
# Ctrl+R override for bash history
# Alt-C overried to cd into selected directory
eval "$(fzf --bash)"
# Quick file finder with preview and open with vim (Ctrl+T override)
bind '"\C-t": "fzf --preview \"cat {}\" < <(find . -type f) | xargs $EDITOR\n"'
# kinda annoying tbh
# pfetch || neofetch || fastfetch
# Created by `pipx` on 2025-05-04 00:05:20
export PATH="$PATH:/home/clint/.local/bin"