Skip to content

Instantly share code, notes, and snippets.

@aneeshmg
Created January 2, 2017 10:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aneeshmg/74a7cebcf02c4ee158e17d6b301e9049 to your computer and use it in GitHub Desktop.
Save aneeshmg/74a7cebcf02c4ee158e17d6b301e9049 to your computer and use it in GitHub Desktop.
Boilerplate dotfiles
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Source global definitions
if [ -f /etc/bash_aliases ]; then
. /etc/bash_aliases
fi
alias cl='clear'
alias cls='clear'
alias ll='ls -l' # Usefull ls tweaks
alias LL='ls -l'
alias la='ls -a'
alias sl='ls'
alias LS='ls'
alias SL='ls'
alias lsdirs="ls -l | grep '^d'"
alias pgrep='ps aux | grep' # Search for a process based on RegEx
alias lgrep='ls -l | grep' # Search for a file after ls
alias hgrep='history | grep' # Search in bash history
alias pa='ps aux' # List all processes
alias ..='cd ..' # Usefull cd tweaks
alias ...='cd ../..'
alias cd..='cd ..'
alias cd...='cd ../..'
alias .3='cd ../../../'
alias .4='cd ../../../../'
alias .5='cd ../../../../../'
alias .6='cd ../../../../../../'
alias x='exit'
alias rr='rm -rf'
alias skim="(head -5; tail -5) <"
alias l='less' # Shortcut to Less
alias tlf='tail -f'
alias pingg='ping -c 5 google.com' # Network status tweaks
alias ping8='ping -c 5 8.8.8.8'
alias shutdown='sudo shutdown -h now'
alias install='sudo apt-get install'
alias update='sudo apt-get update'
alias upgrade='sudo apt-get upgrade'
## Extract files automatically
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
# Add your PATH exports below
" Change title of term
set title
set icon
" Show line number
set number
set ruler
" Tab-space related stuff
set ts=2
set tabstop=2
set shiftwidth=2
set showtabline=1
set smarttab
set expandtab
:%retab
" Indenting
set smartindent
set textwidth=100
set autoindent
set copyindent
set preserveindent
" Make vi fast
set ttyfast
" Show matching paranthesis
set showmatch
" Use smart casing and ignore case for search
set smartcase
set ignorecase
" Horizontal and vertical scroll offsets
set scrolloff=7
set sidescrolloff=4
" Force vim to load only what is required
set lazyredraw
" File specific syntaxing and indentation
filetype on
filetype plugin on
syntax enable
filetype plugin indent on
syntax on
" Color schemes (Uncomment to select)
"colorscheme desert
"colorscheme shine
"colorscheme elflord
"colorscheme blue
"colorscheme darkblue
"colorscheme delek
colorscheme koehler
"colorscheme slate
"colorscheme morning
"colorscheme evening
"colorscheme pablo
"colorscheme murphy
"colorscheme torte
"colorscheme zellner
"set background=dark
" Make Vim remember cursor location
source $VIMRUNTIME/vimrc_example.vim
" Highlight whitespaces in red
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
@aneeshmg
Copy link
Author

aneeshmg commented Jan 2, 2017

These are boilerplate dotfiles.
Add these to your .bashrc and .vimrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment