bash config cleanup

This commit is contained in:
Rudis Muiznieks 2022-09-18 14:36:46 -05:00
parent 3b1f93f32a
commit 200c6895f4
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
5 changed files with 45 additions and 25 deletions

View File

@ -1,3 +1,5 @@
#!/usr/bin/env bash
set -o vi set -o vi
shopt -s histappend shopt -s histappend
shopt -s cmdhist shopt -s cmdhist
@ -7,19 +9,21 @@ HISTCONTROL=ignoreboth
HISTIGNORE='ls:history' HISTIGNORE='ls:history'
HISTTIMEFORMAT='%F %T ' HISTTIMEFORMAT='%F %T '
export TERM_ITALICS=true
eval "$(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)" eval "$(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/.local/lib" LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/.local/lib"
export PATH="$HOME/.local/bin:$PATH:$HOME/skynet/bin:$HOME/node/node_modules/.bin:$HOME/go/bin:$HOME/.dotnet:$HOME/.dotnet/tools:$HOME/.cargo/bin:$HOME/.luarocks/bin" PATH="$HOME/.local/bin:$PATH:$HOME/skynet/bin:$HOME/node/node_modules/.bin:$HOME/go/bin:$HOME/.dotnet:$HOME/.dotnet/tools:$HOME/.cargo/bin:$HOME/.luarocks/bin"
export EDITOR=vim TERM_ITALICS=true
export PAGER=bat EDITOR=vim
export MANPAGER=batman PAGER=bat
export DOTNET_ROOT=~/.dotnet MANPAGER=batman
export ANDROID_EMULATOR_USE_SYSTEM_LIBS=1 DOTNET_ROOT=~/.dotnet
export GPG_TTY=$(tty) ANDROID_EMULATOR_USE_SYSTEM_LIBS=1
GPG_TTY=$(tty)
export TERM_ITALICS LD_LIBRARY_PATH PATH EDITOR PAGER MANPAGER DOTNET_ROOT ANDROID_EMULATOR_USE_SYSTEM_LIBS GPG_TTY
alias ls='exa --icons' alias ls='exa --icons'
alias cat='bat' alias cat='bat'

View File

@ -1,16 +1,25 @@
#!/usr/bin/env bash
# set prefix if in termux
if uname -a | grep -q Android; then
pathprefix=/data/data/com.termux/files
else
pathprefix=
fi;
# fzf config # fzf config
[ -f /usr/share/fzf/completion.bash ] && source /usr/share/fzf/completion.bash [ -f "$pathprefix/usr/share/fzf/completion.bash" ] && source "$pathprefix/usr/share/fzf/completion.bash"
[ -f /usr/share/fzf/key-bindings.bash ] && source /usr/share/fzf/key-bindings.bash [ -f "$pathprefix/usr/share/fzf/key-bindings.bash" ] && source "$pathprefix/usr/share/fzf/key-bindings.bash"
# goto # goto
[ -f ~/skynet/scripts/goto.sh ] && source ~/skynet/scripts/goto.sh [ -f ~/skynet/scripts/goto.sh ] && source ~/skynet/scripts/goto.sh
# bash completion # bash completion
test -e /usr/share/bash-completion/bash_completion && source /usr/share/bash-completion/bash_completion test -e "$pathprefix/usr/share/bash-completion/bash_completion" && source "$pathprefix/usr/share/bash-completion/bash_completion"
# colorizer # colorizer
GRC_ALIASES=true GRC_ALIASES=true
test -e /usr/share/grc/grc.sh && source /usr/share/grc/grc.sh test -e "$pathprefix/usr/share/grc/grc.sh" && source "$pathprefix/usr/share/grc/grc.sh"
# git bash completions # git bash completions
test -e ~/skynet/scripts/git-completion.bash && source ~/skynet/scripts/git-completion.bash test -e ~/skynet/scripts/git-completion.bash && source ~/skynet/scripts/git-completion.bash
@ -19,3 +28,15 @@ test -e ~/skynet/scripts/git-completion.bash && source ~/skynet/scripts/git-comp
test -e ~/.nvm/nvm.sh && source ~/.nvm/nvm.sh test -e ~/.nvm/nvm.sh && source ~/.nvm/nvm.sh
test -e ~/.cargo/env && source ~/.cargo/env test -e ~/.cargo/env && source ~/.cargo/env
# bat theme
BAT_THEME='Catppuccin-mocha'
# nnn color config
NNN_PLUG='d:dragdrop;i:imgview'
NNN_PREVIEWDIR="$HOME/.cache/nnn/previews"
BLK="03" CHR="03" DIR="04" EXE="02" REG="07" HARDLINK="05" SYMLINK="05" MISSING="08" ORPHAN="01" FIFO="06" SOCK="03" UNKNOWN="01"
NNN_COLORS="#04020301;4231"
NNN_FCOLORS="$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$UNKNOWN"
export GRC_ALIASES BAT_THEME NNN_PLUG NNN_PREVIEWDIR NNN_COLORS NNN_FCOLORS

View File

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# dictionary # dictionary
define(){ define(){
dict -d gcide "$1" | bat dict -d gcide "$1" | bat
@ -10,14 +12,14 @@ synonym(){
# mount with user permissions # mount with user permissions
mmount(){ mmount(){
sudo mount -o uid=`whoami`,gid=`whoami` "/dev/$1" "/mnt/$2" sudo mount -o uid="$(whoami)",gid="$(whoami)" "/dev/$1" "/mnt/$2"
} }
# easy ssh-agent persistence # easy ssh-agent persistence
function ssha() { function ssha() {
test=`ps -ef | grep '\sssh-agent$' | grep -v grep | awk '{print $2}' | xargs` test=$(ps -ef | grep '\sssh-agent$' | grep -v grep | awk '{print $2}' | xargs)
if [ "$test" = "" ]; then if [ "$test" = "" ]; then
if [ -e "~/.ssh-agent.sh" ]; then if [ -e ~/.ssh-agent.sh ]; then
rm -f ~/.ssh-agent.sh rm -f ~/.ssh-agent.sh
fi fi
ssh-agent | grep -v echo >&~/.ssh-agent.sh ssh-agent | grep -v echo >&~/.ssh-agent.sh

View File

@ -1,3 +1,5 @@
#!/usr/bin/env bash
RED=$(tput setaf 1) RED=$(tput setaf 1)
GREEN=$(tput setaf 2) GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3) YELLOW=$(tput setaf 3)

View File

@ -1,9 +0,0 @@
# bat theme
export BAT_THEME='Catppuccin-mocha'
# nnn color config
export NNN_PLUG='d:dragdrop;i:imgview'
export NNN_PREVIEWDIR='~/.cache/nnn/previews'
BLK="03" CHR="03" DIR="04" EXE="02" REG="07" HARDLINK="05" SYMLINK="05" MISSING="08" ORPHAN="01" FIFO="06" SOCK="03" UNKNOWN="01"
export NNN_COLORS="#04020301;4231"
export NNN_FCOLORS="$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$UNKNOWN"