Skip to content

Commit

Permalink
bashrc: Extract aliases.sh and prompt.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
carlsmedstad committed Feb 11, 2024
1 parent f45905e commit e0e5a8f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
23 changes: 0 additions & 23 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,13 @@
# Return here for non-interactive shells
test ! -t 0 && return

alias mv="mv -iv"
alias cp="cp -riv"
alias mkdir="mkdir -pv"
alias ls="ls --color=auto --group-directories-first"
alias nvim="nvim --startuptime /tmp/nvim-startuptime"
alias open="xdg-open"

alias gitprune="git --no-pager branch --format='%(refname:short)' | xargs -n1 -I{} git branch -d {} 2> /dev/null"
# shellcheck disable=2154
alias gitfix="git diff --name-only | uniq | xargs \$EDITOR"
alias screenshot='grim -g "$(slurp)"'
alias podrun='podman run --rm --interactive --tty --volume "$(pwd)":/pwd --workdir /pwd'
alias rga="rg --glob='*' --glob='!.git' --glob='!build'"

tabs -4

unset HISTFILESIZE
export HISTSIZE=100000
export PROMPT_COMMAND="history -a"
shopt -s histappend

CLR1="\[$(tput setaf 16)\]"
CLR2="\[$(tput setaf 17)\]"
RESET="\[$(tput sgr0)\]"
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
PS1="$CLR1\u@\h $CLR2\A \$? $CLR1\W $CLR2\$$RESET "
else
PS1="$CLR1\u $CLR2\A \$? $CLR1\W $CLR2\$$RESET "
fi

[ -f /usr/share/fzf/key-bindings.bash ] && . /usr/share/fzf/key-bindings.bash
[ -f /usr/share/fzf/completion.bash ] && . /usr/share/fzf/completion.bash
[ -f /usr/share/clang/bash-autocomplete.sh ] && . /usr/share/clang/bash-autocomplete.sh
Expand Down
13 changes: 13 additions & 0 deletions .config/bash/aliases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
alias mv="mv -iv"
alias cp="cp -riv"
alias mkdir="mkdir -pv"
alias ls="ls --color=auto --group-directories-first"
alias nvim="nvim --startuptime /tmp/nvim-startuptime"
alias open="xdg-open"

alias gitprune="git --no-pager branch --format='%(refname:short)' | xargs -n1 -I{} git branch -d {} 2> /dev/null"
# shellcheck disable=2154
alias gitfix="git diff --name-only | uniq | xargs \$EDITOR"
alias screenshot='grim -g "$(slurp)"'
alias podrun='podman run --rm --interactive --tty --volume "$(pwd)":/pwd --workdir /pwd'
alias rga="rg --glob='*' --glob='!.git' --glob='!build'"
8 changes: 8 additions & 0 deletions .config/bash/prompt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CLR1="\[$(tput setaf 16)\]"
CLR2="\[$(tput setaf 17)\]"
RESET="\[$(tput sgr0)\]"
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
PS1="$CLR1\u@\h $CLR2\A \$? $CLR1\W $CLR2\$$RESET "
else
PS1="$CLR1\u $CLR2\A \$? $CLR1\W $CLR2\$$RESET "
fi
2 changes: 2 additions & 0 deletions dotbot/common.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
~/.config/aerc/stylesets/catppuccin-mocha: .config/aerc/stylesets/catppuccin-mocha
~/.config/alacritty/alacritty.toml: .config/alacritty/alacritty.toml
~/.config/alacritty/themes/catppuccin/catppuccin-mocha.toml: .config/alacritty/themes/catppuccin/catppuccin-mocha.toml
~/.config/bash/aliases.sh: .config/bash/aliases.sh
~/.config/bash/darwin.sh: .config/bash/darwin.sh
~/.config/bash/prompt.sh: .config/bash/prompt.sh
~/.config/bat/config: .config/bat/config
~/.config/bat/themes/Catppuccin-mocha.tmTheme: .config/bat/themes/Catppuccin-mocha.tmTheme
~/.config/black: .config/black
Expand Down

0 comments on commit e0e5a8f

Please sign in to comment.