aboutsummaryrefslogtreecommitdiff
path: root/bash/dot-bashrc
blob: cc9c324ec53f6bc4c07622ebbcb3ffdbca35f55e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# ~/.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

function ls()
{
  command ls --color=auto --indicator-style=classify --human-readable --literal --group-directories-first -v "$@" # -v is for natural sort of numbers within text
}

# coreutils
alias cp='cp -riv'
alias ll='ls --all -l --human-readable' # -l = long listing format
alias l='ls -l'
alias mkdir='mkdir -pv'
alias mv='mv -iv'
alias rm='rm -iv'
alias ..='echo "cd .."; cd ..'
alias ...='echo "cd ../.."; cd ../..'

# program aliases
alias m='aerc'
alias p='sudo pacman'
alias SS='sudo systemctl'
alias Su='systemctl --user'
alias v='nvim'
alias vn='NVIM_APPNAME=nvim-final nvim'
alias vv='uv run nvim'
alias z='setsid runapp -- zathura'
alias todo='nvim ~/system-notes.md'
alias neofetch='fastfetch -c examples/13'

# 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"'

source "${XDG_CONFIG_HOME:-$HOME/.config}"/shellshort/shortcutrc

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