# ~/.bashrc # If not running interactively, don't do anything [[ $- != *i* ]] && return export PAGER=less export EDITOR=vim export HISTIGNORE=ls:ps:history:poweroff export HISTCONTROL=ignoreboth:erasedups # no start space and duplicate entries export HISTSIZE=100000 # big big history export HISTFILESIZE=100000 # big big history shopt -s histappend # append to history, don't overwrite it shopt -s globstar # Save and reload the history after each command finishes #export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" # Change font for urxvt. Examples: # cf 9x15 # cf xft:Monospace:size=12 # cf "xft:Bitstream Vera Sans Mono:size=8:antialias=true cf() { printf '\e]710;%s\007' "${1:-fixed}"; } p() { [ -f "$1" -a ! -x "$1" ] && less -XF $1 || "$@" 2>&1 | less -XF ; } export -f p fixab() { printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 "$1"; } # Less: use colors in place of bold/underline # red: 1, green: 2, yellow: 3, blue: 4, magenta: 5, cyan: 6, grey: 7, black: 8 #export LESS_TERMCAP_md=$(tput setaf 4) # bold (blue) #export LESS_TERMCAP_me=$'\E[0m' # end bold #export LESS_TERMCAP_us=$(tput setaf 5) # underline (magenta) #export LESS_TERMCAP_ue=$'\E[0m' # end underline # gnuplot display in terminal export GNUTERM='sixelgd enhanced truecolor font "arial,9"' # Stopwatch alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' export TERMINAL=xt alias sudo=doas alias cl='cf xft:Mono:size=12' #alias cp='cp --reflink' alias ls='ls --color=auto -v' alias ll='ls -AlFhv' alias vi='vim' alias view='vim -R' alias more=less alias op='xdg-open' alias gob='go build' alias goh='p go help' alias god='p go doc' alias gtr='go test -v -run' alias gtb='go test -v -cpuprofile cpu.out -memprofile mem.out -benchmem -bench' alias kd='sudo cat /sys/kernel/debug/tracing/trace_pipe' #alias vi='vim' alias rvi='sudo vim' alias rxt='sudo xt' alias rxvi='sudo xvi' alias ww='vi ~/Wiki/home_page.md' alias dotfiles='git --git-dir=$HOME/dotfiles --work-tree=$HOME' alias uc='systemctl --user' alias wpa='sudo wpa_gui -i wlan0' alias ifre='echo "ip link set wlo1 down; ip link set wlo1 up"|sudo sh' # Some admin command alias apk='sudo apk' alias dmesg='sudo dmesg' alias mount='sudo mount' alias umount='sudo umount' alias cryptsetup='sudo cryptsetup' alias poweroff='sudo poweroff' alias by='go build ./cmd/yaegi' alias cy='cd ~/go/src/github.com/traefik/yaegi' #alias ty='go test -v -short ./interp' alias ya='rlwrap -pblue yaegi' alias dya='YAEGI_AST_DOT=1 YAEGI_CFG_DOT=1 ./yaegi' alias wai='~/go/src/github.co/traefik/whoami/whoami' # yaegi debug export YAEGI_DOT_CMD='dotty -' mosht() { mosh "$@" -- tmux new -A; } export -f mosht ssht() { ssh -t "$@" -- tmux new -A; } export -f ssht mpvx() { mpv --vo=sixel --profile=sw-fast --really-quiet "$@"; } export -f mpvx tfk() { ~/go/src/github.com/traefik/traefik/traefik "$@"; } export -f tfk ty() { go test -v -short ./interp; } export -f ty ws() (cd ~/Wiki && git status --short) export -f ws wsd() (cd ~/Wiki && git add . && git diff --cached) export -f wsd meteo() { local request="wttr.in/${1-Toulouse}?F&T" [ "$(tput cols)" -lt 125 ] && request+='&n' curl -H "Accept-Language: ${LANG%_*}" --compressed "$request" } #PS1='[\u@\h \W]\$ ' # fzf # Accomodate different base prefix on termux [ -d "$HOME/../usr" ] && base=.. [ -f "$base/usr/share/fzf/completion.bash" ] && . "$base/usr/share/fzf/completion.bash" [ -f "$base/usr/share/fzf/key-bindings.bash" ] && . "$base/usr/share/fzf/key-bindings.bash" unset base # Arch: display package to install for missing commands [ -f '/usr/share/doc/pkgfile/command-not-found.bash' ] && . /usr/share/doc/pkgfile/command-not-found.bash # Display git status in prompt . ~/.bash-powerline.sh # export PS1='; ' # load Nix config files (aka auto-completion etc.) export XDG_DATA_DIRS="$HOME/.nix-profile/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" [ -f ~/.fzf.bash ] && source ~/.fzf.bash