From 662ef16a7b28e939ace1b8d62ca9041921f06ea2 Mon Sep 17 00:00:00 2001 From: frosty Date: Fri, 4 Jul 2025 07:02:58 -0400 Subject: add bash --- .bash_profile | 19 +++++++++++++++++++ .bashrc | 25 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .bash_profile create mode 100644 .bashrc diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..f592eb3 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,19 @@ +export LANG="en_US.UTF-8" +export EDITOR="nvim" +export PAGER="less" + +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" +export XDG_STATE_HOME="$HOME/.local/state" + +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/password-store" +export GOPATH="$XDG_DATA_HOME/go" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc" +export SVDIR="$XDG_CONFIG_HOME/service" + +export PATH="$HOME/.local/bin:$PATH" + +[[ -f "$HOME/.bashrc" ]] && . "$HOME/.bashrc" diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..335fce6 --- /dev/null +++ b/.bashrc @@ -0,0 +1,25 @@ +# shellcheck shell=bash + +[[ $- != *i* ]] && return + +__has() { hash "$1" 2>/dev/null; } + +HISTSIZE= +HISTCONTROL="erasedups:ignorespace" +HISTFILE="$XDG_STATE_HOME/bash/history" + +PS1='\u@\h:\w\$ ' + +alias g='git' +alias t='tmux' + +__has nvim && alias vim='nvim' +__has vim && alias vi='vim' +alias doas='doas ' +alias sudo='sudo ' + +alias ls='ls --color=auto -AF' +alias grep='grep --color=auto' + +[[ ! -d "$(dirname "$HISTFILE")" ]] && mkdir -p "$(dirname "$HISTFILE")" +unset __has -- cgit v1.2.3