dotfiles/.bashrc

62 lines
2.1 KiB
Bash
Raw Normal View History

2024-02-28 12:48:12 +01:00
export GREP_COLOR="1;32"
export EDITOR="vim"
export SUDO_EDITOR="vim"
export VISUAL="vim"
2024-02-19 16:07:53 +01:00
2024-02-28 12:48:12 +01:00
[[ -f /etc/bashrc ]] && . /etc/bashrc # Source global definitions
[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH"
2024-02-19 16:07:53 +01:00
[[ $- != *i* ]] && return # If not running interactively, don't do anything
2024-02-28 12:48:12 +01:00
export HISTCONTROL=ignoreboth:erasedups
shopt -s histappend cmdhist
shopt -s histverify
export HISTSIZE=1000
export HISTFILESIZE=2000
set -o vi
2024-02-19 16:07:53 +01:00
bind -m vi-command 'Control-l: clear-screen'
bind -m vi-insert 'Control-l: clear-screen'
2024-02-28 12:48:12 +01:00
export MANPAGER="/bin/sh -c \"col -b | vim --not-a-term -c 'set ft=man ts=8 nomod nolist noma' -\""
2024-02-19 16:07:53 +01:00
export LS_COLORS=$LS_COLORS:'tw=01;04;34:ow=01;04;34:'
2024-02-28 12:48:12 +01:00
alias myip='curl -s -m 5 https://ipleak.net/json/'
alias q='exit'
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias diff='diff --color=auto'
2024-02-19 16:07:53 +01:00
fi
2024-02-28 12:48:12 +01:00
alias myls='ls -pQFhA --group-directories-first'
alias myrm='rm -vi'
alias mycp='cp -vi'
alias mymv='mv -vi'
alias mydf='df -Th'
alias myless='less -R -S'
mylsl(){ mls -l $* --color=always | mless; }
myup(){ cd $(eval printf '../'%.0s {1..$1}); }
mkcd(){ mkdir -p "${1:?}" && cd "${1}"; }
update(){ ~/update.sh && mv ~/update_new.sh ~/update.sh; }
myping(){ # Pings ip address of noip.com and www.google.com.
ping -c 1 -q 8.23.224.107 | grep --color=never -A 1 -i '\---'
ping -c 1 -q www.google.com | grep --color=never -A 1 -i '\---'
}
pushd(){ builtin pushd "$@" >/dev/null && dirs -v; }
popd() { builtin popd "$@" >/dev/null && dirs -v; }
usevim() { ln -s $PREFIX/bin/vim ~/bin/termux-file-editor; }
LAST_PWD_PATH="$(dirname "${BASH_SOURCE[0]}")/.bash_last_pwd"
[ -f "$LAST_PWD_PATH" ] && OLDPWD=`cat $LAST_PWD_PATH`
cd(){ builtin cd "$@" && echo `pwd` > "$LAST_PWD_PATH"; }
2024-02-28 12:52:58 +01:00
alias gitdotfiles='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME"'
2024-02-28 12:48:12 +01:00
# termux-setup-storage