Skip to content

Instantly share code, notes, and snippets.

@saurabheights
Last active January 24, 2020 12:31
Show Gist options
  • Save saurabheights/19d35d14f4903dda882135035f258302 to your computer and use it in GitHub Desktop.
Save saurabheights/19d35d14f4903dda882135035f258302 to your computer and use it in GitHub Desktop.
Useful bashrc content
# Bindings for deleting word backward and forward using CTRL-Backspace and Ctrl-Del.
# Note that backspace will respect delimiters as _, which are not respected by Ctrl+w. To be put in bashrc.
bind '"\C-h":backward-kill-word'
bind '"\e[3;5~":kill-word'
# Bashrc aliases. sbp - p is for bash profile.
alias sbp="source ~/.bashrc"
alias obp="subl ~/.bashrc"
alias obh="subl ~/.bash_history"
alias vbp="vi ~/.bash_profile"
#Clear Screen and display all files
alias cls='clear && ll'
#Git alias
alias gs='git status'
alias GS=gs
alias gd='git diff -U20 --color '
alias gf='git fetch && git status'
alias gl='git log --oneline --decorate --graph --branches --remotes --pretty=format:"%C(yellow)%h %Cblue%>(12)%ad %Cgreen%<(7)%aN%Cred%d %Creset%s"
'
alias gdc='git diff -U20 --cached --color'
alias gcp='git config --global credential.helper "cache --timeout=36000"'
alias ga='git add -u && git status'
alias gc='git commit'
alias gcm='git checkout master && git status'
alias gc-='git checkout - && git status'
alias grpo='git remote prune origin'
alias gitListBranchesAuthor="git for-each-ref --format=' %(authorname) %09 %(refname)'"
# Clipboard aliases. sudo apt install xclip
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias copypath='pwd | pbcopy'
# Networking. Get your public ip and private ip
alias publicip='curl ipinfo.io/ip'
alias privateip="echo `ip route get 8.8.8.8 | awk '{print $NF; exit}'`"
# See how to download these files - https://gist.github.com/saurabheights/7685094ed2daf00406068b76f03982be
source ~/.git-completion.bash
source ~/.git-prompt.sh
# Force alt + tab to switch only on current workspace in GNOME shell
gsettings set org.gnome.shell.app-switcher current-workspace-only true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment