2018-02-27 01:28:58 +01:00
|
|
|
# New Start: A modern Arch workflow built with an emphasis on functionality.
|
|
|
|
# Copyright (C) 2017-2018 Donovan Glover
|
2017-10-31 13:14:26 +01:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Sudo and other system aliases
|
|
|
|
####################################################################
|
|
|
|
|
2018-04-08 22:30:53 +02:00
|
|
|
alias sudo="sudo " # Make aliases work with sudo (NOTE: Does not work with fish)
|
2017-10-31 13:14:26 +01:00
|
|
|
alias pls="sudo" # A nicer way to ask for root permissions
|
|
|
|
|
|
|
|
alias rm="rm -i" # Always confirm before deleting things (use -f to override)
|
|
|
|
alias mkdir="mkdir -p" # Automatically make parent directories that don't exist yet
|
|
|
|
|
|
|
|
alias p="pwd | sed -e 's!$HOME!~!g'" # Same as pwd, but uses ~ instead of $HOME
|
2017-12-28 04:53:07 +01:00
|
|
|
|
|
|
|
# Easily start fresh with a clean terminal
|
|
|
|
# Note that "clear force" (cf) clears the terminal for real and doesn't have
|
|
|
|
# any side effects when resizing windows or scrolling up
|
|
|
|
alias c="clear"
|
|
|
|
alias cf="tput reset"
|
2017-10-31 13:14:26 +01:00
|
|
|
|
|
|
|
# Make ls a lot easier to read (print directories first, just like ranger)
|
2017-12-31 05:56:55 +01:00
|
|
|
alias exa="exa --group-directories-first"
|
|
|
|
alias ls="exa"
|
2017-10-31 13:14:26 +01:00
|
|
|
|
2017-12-31 05:56:55 +01:00
|
|
|
alias l="exa -1" # Show each output from ls on a separate line
|
|
|
|
alias lsa="exa -a" # Show hidden files (also known as dotfiles)
|
2017-10-31 13:14:26 +01:00
|
|
|
|
2017-11-26 10:12:21 +01:00
|
|
|
####################################################################
|
|
|
|
# Volume aliases
|
|
|
|
####################################################################
|
|
|
|
|
|
|
|
# Usage: vol 10%+ (Increase the volume by 10%), vol 10%- (Decrease by 10%)
|
|
|
|
# vol 100% (Set the volume to 100%)
|
|
|
|
alias vol="amixer set 'Master' "
|
|
|
|
alias volume="vol"
|
|
|
|
|
2017-10-31 13:14:26 +01:00
|
|
|
####################################################################
|
|
|
|
# Miscellaneous aliases
|
|
|
|
####################################################################
|
|
|
|
|
2017-12-28 05:26:19 +01:00
|
|
|
alias vz="nvim +Files" # Open any file inside a directory easily with fzf
|
2018-01-04 05:11:49 +01:00
|
|
|
alias vh="nvim -i NONE -c 'set noswapfile' -c 'set noundofile' -c 'set nobackup'"
|
2017-12-23 05:33:29 +01:00
|
|
|
|
|
|
|
# Quick and easy way to download the majority of online videos
|
|
|
|
alias dl="youtube-dl -f bestvideo+bestaudio"
|
2017-10-31 13:14:26 +01:00
|
|
|
|
|
|
|
alias back="feh --no-fehbg --bg-fill" # Easily set a new background (temporary)
|
|
|
|
alias synctime="ntpdate -u 0.us.pool.ntp.org" # Sync the system time with one on the internet
|
|
|
|
|
|
|
|
# Show the lines that are in <file2> but NOT in <file1>
|
|
|
|
alias compare="grep -nFxvf" # Usage: compare <file1> <file2>
|
|
|
|
|
2017-11-21 23:41:09 +01:00
|
|
|
# "dog" is a colorful version of cat
|
|
|
|
alias dog="pygmentize -g"
|
|
|
|
|
2017-12-12 05:03:17 +01:00
|
|
|
# Easily show all of the todos in a given project
|
2018-01-01 04:40:14 +01:00
|
|
|
alias todo="rg TODO"
|
2017-12-12 05:03:17 +01:00
|
|
|
|
2017-12-31 05:56:55 +01:00
|
|
|
# Use exa as a drop-in replacement for "tree" (faster, more colors, etc.)
|
|
|
|
alias tree="exa --long --tree"
|
2018-01-05 05:47:44 +01:00
|
|
|
alias t="tree -L 1"
|
2018-04-08 22:30:53 +02:00
|
|
|
alias t2="tree -L 2"
|
|
|
|
alias t3="tree -L 3"
|
|
|
|
|
|
|
|
# Easily copy the contents of any file
|
|
|
|
alias copy="xclip -sel clip < "
|
2017-12-31 05:56:55 +01:00
|
|
|
|
2017-10-31 13:14:26 +01:00
|
|
|
####################################################################
|
|
|
|
# Git aliases
|
|
|
|
####################################################################
|
|
|
|
|
2017-12-18 05:50:34 +01:00
|
|
|
alias g="git" # In case we ever need to type a full command
|
2017-10-31 13:14:26 +01:00
|
|
|
alias ga="git add" # Swiftly add new files to the repository
|
2017-12-23 05:33:57 +01:00
|
|
|
alias gaa="git add --all" # Quickly add all the files changed in a repository
|
2017-12-12 05:03:17 +01:00
|
|
|
alias gap="git add --patch" # Commit a file one part at a time
|
2018-03-03 05:58:19 +01:00
|
|
|
alias gb="git branch --verbose" # Show a list of all the branches in the repository
|
2017-10-31 13:14:26 +01:00
|
|
|
alias gc="git commit -m" # Easily create new commits
|
2018-03-03 05:58:19 +01:00
|
|
|
alias gca="git commit --amend" # Easily amend previous commits
|
2017-12-12 05:03:17 +01:00
|
|
|
alias gd="git diff" # Show all file changes that you haven't added yet
|
|
|
|
alias gds="git diff --staged" # Show the changes you added but haven't committed yet
|
|
|
|
alias gg="git grep" # Easily grep for a string inside the git repository
|
2017-10-31 13:14:26 +01:00
|
|
|
alias gp="git push" # Push your commits to remote (usually origin)
|
|
|
|
alias gs="git status" # Compare any local changes you've made to the remote
|
2017-11-04 03:42:38 +01:00
|
|
|
alias gr="git reset HEAD~" # Undo the last commit but keep your changed files
|
2018-03-03 05:58:19 +01:00
|
|
|
alias gre="git remote --verbose" # Show all the remotes for the repository
|
2017-11-04 03:42:38 +01:00
|
|
|
alias grr="git reset --hard HEAD~" # Remove the last commit and all changes with it
|
2017-12-23 05:33:57 +01:00
|
|
|
alias gl="git lg" # Quickly show a list of the most recent commits
|
2017-10-31 13:14:26 +01:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Launch aliases (allow us to easily open external programs)
|
|
|
|
####################################################################
|
|
|
|
|
2018-04-08 22:30:53 +02:00
|
|
|
alias f="launch feh --auto-zoom" # Easy image viewing with f
|
|
|
|
alias z="launch zathura" # Easy document browsing with z
|
|
|
|
alias m="launch mpv" # Easy media playing with m
|
|
|
|
alias lnox="launch inox" # Launch inox separate from the terminal
|
|
|
|
alias lfox="launch waterfox" # Launch waterfox separate from the terminal
|
2017-10-31 13:14:26 +01:00
|
|
|
|
|
|
|
####################################################################
|
|
|
|
# Fun aliases that don't serve any specific purpose
|
|
|
|
####################################################################
|
|
|
|
|
2017-12-28 05:26:19 +01:00
|
|
|
alias emacs="nvim" # No need to start another operating system
|
|
|
|
alias nano="nvim" # Why nano when you have vim?
|
|
|
|
alias vi="nvim" # Vim is vi improved, literally
|