Added .shell-includes and updated .bashrc to them
This commit is contained in:
parent
2c2df906ef
commit
b538219e08
4 changed files with 88 additions and 15 deletions
31
.bashrc
31
.bashrc
|
@ -5,26 +5,27 @@
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[[ $- != *i* ]] && return
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
#alias ls='ls --color=auto'
|
# Source global definitions
|
||||||
alias ls='lsd'
|
test -r /etc/bashrc && . /etc/bashrc
|
||||||
alias grep='grep --color=auto'
|
|
||||||
|
test -r ~/.shell-env && . ~/.shell-env
|
||||||
|
test -r ~/.shell-aliases && . ~/.shell-aliases
|
||||||
|
test -r ~/.shell-common && . ~/.shell-common
|
||||||
|
|
||||||
PS1='[\u@\h \W]\$ '
|
PS1='[\u@\h \W]\$ '
|
||||||
|
|
||||||
|
test -r ~/.bashrc.local && . ~/.bashrc.local
|
||||||
|
|
||||||
if [[ "$XDG_CURRENT_DESKTOP" = "KDE" ]]; then
|
if command -v fzf-share >/dev/null; then
|
||||||
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR:-/run/user/$UID}/ssh-agent.socket"
|
source "$(fzf-share)/key-bindings.bash"
|
||||||
export SSH_ASKPASS="/usr/bin/ksshaskpass"
|
source "$(fzf-share)/completion.bash"
|
||||||
else
|
|
||||||
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR:-/run/user/$UID}/gcr/ssh"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
## Load External Components
|
||||||
|
|
||||||
|
eval "$(direnv hook bash)"
|
||||||
eval "$(starship init 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
|
source ~/.local/share/blesh/ble.sh
|
||||||
eval "$(atuin init bash)"
|
eval "$(atuin init bash)"
|
||||||
|
#eval "$(keychain --eval --quiet --eval --systemd id_ed25519 id_rsa)"
|
||||||
|
|
||||||
|
|
29
.shell-aliases
Normal file
29
.shell-aliases
Normal 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
12
.shell-common
Normal 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
31
.shell-env
Normal 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
|
Loading…
Reference in a new issue