Created
October 2, 2017 11:30
-
-
Save GreenCandlePrinter/76188c4d52f8f70a57fbc3de6fa28e17 to your computer and use it in GitHub Desktop.
Basic .bashrc for Epitech Students
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
export EDITOR="emacs" | |
export PAGER="less" | |
export GREP_OPTION="--color=auto" | |
export PATH=${PATH}:${HOME}/bin | |
PS1="┌─\[\e[33m\][\[\e[32m\]\$(if [[ \$? == 0 ]]; then echo \"\[\e[0;32m\]:D\"; else echo \"\[\e[0;31m\]:'(\"; fi)\e[33m]\[\e[00m\]-\[\e[33m\]\[[\e[0;35m\]\A\[\e[33m\]]\[\e[00m\]-\[\e[33m\][\[\e[00m\]\[\e[36m\]\w\[\e[33m\]]\[\e[00m\]- | |
└─> " | |
#export TERM=xterm | |
# Compile flags | |
export CXXFLAGS="-W -Wall -Wextra -O2 -pedantic -g -std=c++11" | |
export CFLAGS="-W -Wall -Wextra -O2 -ansi -pedantic -std=c99 -D_FORTIFY_SOURCE=2 -g" | |
# History | |
# append to the history file, don't overwrite it | |
shopt -s histappend | |
HISTCONTROL=ignoreboth | |
HISTIGNORE="&:ls:bg:fg:ll:la:pwd:clean:l:cd" | |
HISTFILESIZE=20000 | |
HISTSIZE=3000 | |
# check the window size after each command and, if necessary, | |
# update the values of LINES and COLUMNS. | |
shopt -s checkwinsize | |
# If set, the pattern "**" used in a pathname expansion context will | |
# match all files and zero or more directories and subdirectories. | |
#shopt -s globstar | |
# make less more friendly for non-text input files, see lesspipe(1) | |
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" | |
# enable color support of ls and also add handy aliases | |
if [ -x /usr/bin/dircolors ]; then | |
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" | |
alias ls='ls --color=auto' | |
#alias dir='dir --color=auto' | |
#alias vdir='vdir --color=auto' | |
alias grep='grep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
alias egrep='egrep --color=auto' | |
fi | |
# some more ls aliases | |
alias l='clear ; ls' | |
alias ll='ls -alF' | |
alias la='ls -A' | |
# My aliases | |
alias c='gcc '$CFLAGS | |
alias c+='g++ '$CXXFLAGS | |
alias j='jobs' | |
alias emacs='emacs -nw' | |
alias ne='emacs -nw' | |
alias clean='rm *# ; make clean' | |
alias ls='ls --color' | |
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\''' | |
alias freq='cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 50' | |
alias cl='find . -name "*.c" | xargs wc -l' | |
alias ..='cd ..' | |
alias ...='cd ..;cd ..' | |
alias ....='cd ..;cd ..; cd ..' | |
alias sodo='sudo' | |
alias folders='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn' | |
alias makec='clear && make && make clean' | |
# Alias definitions. | |
# You may want to put all your additions into a separate file like | |
# ~/.bash_aliases, instead of adding them here directly. | |
# See /usr/share/doc/bash-doc/examples in the bash-doc package. | |
if [ -f ~/.bash_aliases ]; then | |
. ~/.bash_aliases | |
fi | |
# enable programmable completion features (you don't need to enable | |
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile | |
# sources /etc/bash.bashrc). | |
if ! shopt -oq posix; then | |
if [ -f /usr/share/bash-completion/bash_completion ]; then | |
. /usr/share/bash-completion/bash_completion | |
elif [ -f /etc/bash_completion ]; then | |
. /etc/bash_completion | |
fi | |
fi | |
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. | |
export PATH="$PATH:$HOME/.rvm/bin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment