From c30bb495db716a68f8ae98e531857c545c0505d9 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Sat, 26 Mar 2022 14:43:21 -0500 Subject: fix: improve shell configs --- bash/.bash_profile | 2 ++ bash/.bashrc | 40 +++++++++++++++++++++++++++++++++------- bash/.config/bash/aliases.sh | 1 - bash/.config/bash/env.sh | 1 - bash/.profile | 30 ++++++++++++++++++++++++++++++ 5 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 bash/.bash_profile delete mode 120000 bash/.config/bash/aliases.sh delete mode 120000 bash/.config/bash/env.sh create mode 100644 bash/.profile (limited to 'bash') diff --git a/bash/.bash_profile b/bash/.bash_profile new file mode 100644 index 0000000..1594575 --- /dev/null +++ b/bash/.bash_profile @@ -0,0 +1,2 @@ +. ~/.profile +if [[ $- == *i* ]]; then . ~/.bashrc; fi diff --git a/bash/.bashrc b/bash/.bashrc index 05a7973..24c8780 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -1,10 +1,36 @@ -#!/usr/bin/env bash - -export BASHDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/bash -export BASHCOMPDIR=${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions - -if [ -d "$BASHDOTDIR" ]; then for f in $BASHDOTDIR/*; do source $f; done; fi -if [ -d "$BASHCOMPDIR" ]; then for f in $BASHCOMPDIR/*; do source $f; done; fi +# Aliases +alias ls='ls --color=tty' +alias l='ls -lah' +alias la='ls -lAh' +alias ll='ls -lh' +alias lla='ls -lA' +alias lsa='ls -lah' +alias grep='grep --color' +alias ipa="ip -s -c -h a" +alias untar="tar -zxvf" +alias td=". td.sh" +alias vim=nvim +alias pip=pip3 +alias python=python3 +alias dexec="docker exec -it" +alias dps="docker ps" +alias dc="docker compose" +alias dce="docker compose exec" +alias dcps="docker compose ps" +alias dcls="docker compose ls" +alias dcdn="docker compose down" +alias dcup="docker compose up" +alias dcupd="docker compose up -d" +alias dcl="docker compose logs" +alias dclf="docker compose logs -f" +alias dct="docker context" +alias dcu="docker context use" + +if [ $PS1 && -d "$BASHCOMPDIR" ]; then + for f in $BASHCOMPDIR/*; do + source $f + done +fi command -v starship >/dev/null 2>&1 && eval "$(starship init bash)" diff --git a/bash/.config/bash/aliases.sh b/bash/.config/bash/aliases.sh deleted file mode 120000 index 4fe3952..0000000 --- a/bash/.config/bash/aliases.sh +++ /dev/null @@ -1 +0,0 @@ -/home/tobyv/dotfiles/zsh/.config/zsh/aliases.sh \ No newline at end of file diff --git a/bash/.config/bash/env.sh b/bash/.config/bash/env.sh deleted file mode 120000 index 306408a..0000000 --- a/bash/.config/bash/env.sh +++ /dev/null @@ -1 +0,0 @@ -/home/tobyv/dotfiles/zsh/.config/zsh/env.sh \ No newline at end of file diff --git a/bash/.profile b/bash/.profile new file mode 100644 index 0000000..4188ba5 --- /dev/null +++ b/bash/.profile @@ -0,0 +1,30 @@ +# XDG +export XDG_CONFIG_HOME=$HOME/.config +export XDG_CACHE_HOME=$HOME/.cache +export XDG_DATA_HOME=$HOME/.local/share +export XDG_RUNTIME_DIR=$HOME/.xdg + +# Shell +export ZDOTDIR=$XDG_CONFIG_HOME/zsh +export BASH_COMPLETION_USER_DIR=$XDG_DATA_HOME/bash-completion/completions + +# Misc +export EDITOR="$(command -v vim 2>/dev/null || command -v vi)" +export VISUAL="code --wait" +export MANPAGER="sh -c 'col -bx | bat -l man -p'" +export MANROFFOPT="-c" +export GOPATH=$HOME/.go +export GPG_TTY=$(tty) +export STARSHIP_LOG="error" +export FZF_PREVIEW_COMMAND="bat --style=numbers,changes --wrap never --color always {} || cat {} || tree -C {}" +export FZF_DEFAULT_COMMAND="fd --type f || git ls-tree -r --name-only HEAD || rg --files || find ." +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +export FZF_CTRL_T_OPTS="--min-height 30 --preview-window down:60% --preview-window noborder --preview '($FZF_PREVIEW_COMMAND) 2> /dev/null'" + +# Path +export PATH=$PATH:$HOME/.local/bin +export PATH=$PATH:$HOME/.scripts +export PATH=$PATH:$HOME/.go/bin +export PATH=$PATH:$HOME/.dotnet/tools +export PATH=$PATH:$HOME/.cargo/bin +export PATH=$PATH:/usr/local/texlive/2021/bin/x86_64-linux -- cgit v1.2.3-70-g09d2