Added .shell-includes and updated .bashrc to them

This commit is contained in:
Eric Renfro 2024-03-14 21:25:23 -04:00
parent 2c2df906ef
commit b538219e08
Signed by: psi-jack
SSH Key Fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM
4 changed files with 88 additions and 15 deletions

31
.bashrc
View File

@ -5,26 +5,27 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#alias ls='ls --color=auto'
alias ls='lsd'
alias grep='grep --color=auto'
# Source global definitions
test -r /etc/bashrc && . /etc/bashrc
test -r ~/.shell-env && . ~/.shell-env
test -r ~/.shell-aliases && . ~/.shell-aliases
test -r ~/.shell-common && . ~/.shell-common
PS1='[\u@\h \W]\$ '
test -r ~/.bashrc.local && . ~/.bashrc.local
if [[ "$XDG_CURRENT_DESKTOP" = "KDE" ]]; then
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR:-/run/user/$UID}/ssh-agent.socket"
export SSH_ASKPASS="/usr/bin/ksshaskpass"
else
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR:-/run/user/$UID}/gcr/ssh"
if command -v fzf-share >/dev/null; then
source "$(fzf-share)/key-bindings.bash"
source "$(fzf-share)/completion.bash"
fi
## Load External Components
eval "$(direnv hook bash)"
eval "$(starship init bash)"
if [[ ! -r "$HOME/.local/share/blesh/ble.sh" ]]; then
git clone --recursive --depth 1 --shallow-submodules https://github.com/akinomyoga/ble.sh.github
make -C ble.sh install PREFIX="$HOME/.local"
rm -rf ble.sh
fi
source ~/.local/share/blesh/ble.sh
eval "$(atuin init bash)"
#eval "$(keychain --eval --quiet --eval --systemd id_ed25519 id_rsa)"

29
.shell-aliases Normal file
View File

@ -0,0 +1,29 @@
# vim: set ft=sh sw=2 et :
alias dos2unix='sed "s/%//"'
alias tmux='tmux -2'
if command -v vim >/dev/null 2>&1; then
alias vi=vim
fi
if command -v nvim >/dev/null 2>&1; then
alias vim=nvim
alias vi=nvim
fi
alias ls='ls --color=auto'
alias ll='\ls -l'
alias lla='\ls -la'
alias lt='\ls --color=auto -lhFart'
if command -v lsd >/dev/null 2>&1; then
alias ls='lsd'
alias ll='lsd -l'
alias lla='lsd -la'
fi
alias grep='grep --color=auto'
if [[ -n "$TMUX" ]]; then
alias fzf='fzf-tmux'
fi

12
.shell-common Normal file
View File

@ -0,0 +1,12 @@
# vim: set ft=sh sw=2 et :
# make less more friendly for non-text input files, see lesspipe(1)
command -v lesspipe.sh >/dev/null 2>&1 && eval "$(SHELL=/bin/sh lesspipe.sh)"
# enable color support of ls and also add handy aliases
if command -v dircolors >/dev/null 2>&1; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
fi
test -r ~/.shell-common.local && source ~/.shell-common.local

31
.shell-env Normal file
View File

@ -0,0 +1,31 @@
# vim: set ft=sh sw=2 et :
##
## Editors
##
if [ -x "$(command -v nvim")" ]; then
export EDITOR=nvim
export MANPAGER='nvim +Man!'
elif [ -x "$(command -v micro)" ]; then
export EDITOR=micro
export MANPAGER=less
else
export EDITOR=vim
export MANPAGER=less
fi
export GIT_EDITOR="$EDITOR"
export USE_EDITOR="$EDITOR"
export VISUAL=$EDITOR
##
## Pager
##
export PAGER=less
export LESS='-iFMRSX -x4'
if [ -f "$HOME/.shell-env.local" ]; then
. "$HOME/.shell-env.local"
fi
umask 022