diff options
| author | Mohammad Reza Karimi <m.r.karimi.j@gmail.com> | 2025-12-16 13:27:11 -0500 |
|---|---|---|
| committer | Mohammad Reza Karimi <m.r.karimi.j@gmail.com> | 2025-12-16 13:27:11 -0500 |
| commit | 5a41da5881a11ba3fdc3890c342aa3b7eb53e0cf (patch) | |
| tree | 92b7f7af29ed4a9dcc0eab33490c6225cce9b14a /bash/dot-bashrc | |
| parent | 856e361d56c201cbb1b1521c8b93b747163b1376 (diff) | |
add initial version (incomplete)
Diffstat (limited to 'bash/dot-bashrc')
| -rw-r--r-- | bash/dot-bashrc | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/bash/dot-bashrc b/bash/dot-bashrc new file mode 100644 index 0000000..678235f --- /dev/null +++ b/bash/dot-bashrc @@ -0,0 +1,69 @@ +# ~/.bashrc +# vim: ft=bash + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +export HISTCONTROL='ignoredups' +export HISTIGNORE='ls *':'history':'cd':'sudo -i':'yay':'lf':'cd ..':'nvim':'v':'cvim' +export HISTFILESIZE=100000 +export HISTSIZE=10000 + +shopt -s autocd +shopt -s checkwinsize + +source "${XDG_CONFIG_HOME:-$HOME/.config}"/bash/gentoo-color.bash + +ls() +{ + if ((gentoo_color > 0)); then + command ls --color=auto "$@" + else + command ls "$@" + fi +} + +# coreutils +alias cp='cp -riv' +alias la='ls -la' +alias ll='ls -lah' +alias l='ls -l' +alias ls='ls -p -hN --group-directories-first' +alias mkdir='mkdir -pv' +alias mv='mv -iv' +alias rm='rm -iv' +alias ..='echo "cd .."; cd ..' +alias ...='echo "cd ../.."; cd ../..' + +# program aliases +alias m='neomutt' +alias p='sudo pacman' +alias SS='sudo systemctl' +alias Su='systemctl --user' +alias v='nvim' +alias z='setsid runapp -- zathura' + +# source: https://wiki.archlinux.org/title/GnuPG#Configure_pinentry_to_use_the_correct_TTY +GPG_TTY="$(tty)" +export GPG_TTY +gpg-connect-agent updatestartuptty /bye >/dev/null + +# cp and mv but with rsync +# source: https://wiki.archlinux.org/title/Rsync#As_cp/mv_alternative +cpr() { + rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 "$@" +} + +mvr() { + rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files "$@" +} + +source "${XDG_CONFIG_HOME:-$HOME/.config}"/bash/functions.bash + +bind '"\C-o":"\C-ulf\C-m"' + +export FZF_DEFAULT_COMMAND='fd --type f --strip-cwd-prefix --hidden --follow --exclude .git' +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +eval "$(fzf --bash)" + +stty -ixon |
