dotfiles/.bashrc

123 lines
3.5 KiB
Bash
Raw Normal View History

2020-07-31 20:06:08 +00:00
eval "$(starship init bash)"
2020-08-23 03:12:07 +00:00
source /usr/share/autojump/autojump.bash
source /usr/share/defaults/etc/profile
2018-11-15 01:01:37 +00:00
# Sensible Bash: https://github.com/mrzool/bash-sensible
2019-04-08 02:45:38 +00:00
## GENERAL OPTIONS ##
# Prevent file overwrite on stdout redirection
# Use `>|` to force redirection to an existing file
set -o noclobber
# Update window size after every command
shopt -s checkwinsize
# Automatically trim long paths in the prompt (requires Bash 4.x)
PROMPT_DIRTRIM=2
# Enable history expansion with space
# E.g. typing !!<space> will replace the !! with your last command
bind Space:magic-space
# Turn on recursive globbing (enables ** to recurse all directories)
shopt -s globstar 2> /dev/null
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob;
## SMARTER TAB-COMPLETION (Readline bindings) ##
# Perform file completion in a case insensitive fashion
bind "set completion-ignore-case on"
# Treat hyphens and underscores as equivalent
bind "set completion-map-case on"
# Display matches for ambiguous patterns at first tab press
bind "set show-all-if-ambiguous on"
# Immediately add a trailing slash when autocompleting symlinks to directories
bind "set mark-symlinked-directories on"
## SANE HISTORY DEFAULTS ##
# Append to the history file, don't overwrite it
shopt -s histappend
# Save multi-line commands as one command
shopt -s cmdhist
# Huge history. Doesn't appear to slow things down, so why not?
HISTSIZE=500000
HISTFILESIZE=100000
# Avoid duplicate entries
HISTCONTROL="erasedups:ignoreboth"
# Don't record some commands
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
# Use standard ISO 8601 timestamp
# %F equivalent to %Y-%m-%d
# %T equivalent to %H:%M:%S (24-hours format)
HISTTIMEFORMAT='%F %T '
# Version: 0.2.2
2019-04-08 02:45:38 +00:00
# Enable incremental history search with up/down arrows (also Readline goodness)
# Learn more about this here: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
bind '"\e[C": forward-char'
bind '"\e[D": backward-char'
## BETTER DIRECTORY NAVIGATION ##
# Prepend cd to directory names automatically
shopt -s autocd 2> /dev/null
# Correct spelling errors during tab-completion
shopt -s dirspell 2> /dev/null
# Correct spelling errors in arguments supplied to cd
shopt -s cdspell 2> /dev/null
# This allows you to bookmark your favorite places across the file system
# Define a variable containing a path and you will be able to cd into it regardless of the directory you're in
shopt -s cdable_vars
2020-08-26 03:42:19 +00:00
#aliases
2020-08-22 18:51:24 +00:00
alias cd='cd -P'
alias cpugov='sudo cpupower frequency-set -g performance'
2020-08-26 03:42:19 +00:00
alias dirdl='wget -r -k -p --no-parent --no-clobber -e robots=off'
alias dot='cd ~/.dotfiles'
alias D='cd $D'
alias ff='fd -HILi -Edosdevices -E.git'
2020-08-26 03:42:19 +00:00
alias g=git
alias giveme='s chown $USER'
alias hardinfo='inxi -SPARM -GCDN -v1 -xGCRS -Fxz'
alias l=ls
alias launcher='rofi -combi-modi "drun,run" -show combi -modi "combi,window"'
2020-08-26 03:42:19 +00:00
alias la='l -a'
alias off=shutdown
alias open=xdg-open
2020-08-26 03:42:19 +00:00
alias pagedl='wget -H -k -p --no-clobber -e robots=off'
alias re='systemctl reboot -i'
2020-08-23 03:12:07 +00:00
alias s=sudo
2020-08-26 03:42:19 +00:00
alias sumurder='s killall -s SIGKILL'
alias supath='s env "PATH=$PATH"'
alias se='s eopkg'
alias seh='se history'
alias ta='tmux attach -t'
alias up='se up --y'
2020-08-23 03:12:07 +00:00
alias vi=nvim
alias v=vi
alias ydl="youtube-dlc -ciw --write-sub --write-auto-sub --embed-subs --sub-lang=en -o '%(title)s.%(ext)s'"
2020-08-26 03:42:19 +00:00
#functions
dl(){
[[ "$#" -ge 1 ]] && aria2c -c -x16 -s16 $argv || cd ~/Downloads/
2020-08-26 03:42:19 +00:00
}
qb(){
qutebrowser $@ --target auto & disown
rm -r VideoDecodeStats
}