diff options
| -rw-r--r-- | bash_profile | 5 | ||||
| -rw-r--r-- | bashrc | 90 | ||||
| -rwxr-xr-x | init.sh | 14 | ||||
| -rw-r--r-- | vimrc | 74 |
4 files changed, 183 insertions, 0 deletions
diff --git a/bash_profile b/bash_profile new file mode 100644 index 0000000..5545f00 --- /dev/null +++ b/bash_profile @@ -0,0 +1,5 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc @@ -0,0 +1,90 @@ +# +# ~/.bashrc +# + +# editor +export EDITOR="vim" + +# if not running interactively, don't do anything +[[ $- != *i* ]] && return + +# set history variables +HISTCONTROL=ignoreboth:erasedups +HISTSIZE=10000 +HISTFILESIZE=10000 + +# bash completion +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi + +# PS1 +if [[ $EUID -eq 0 ]] +then + PS1='\[\e[1;31m\]\u\[\e[0m\]@\[\e[0;37m\]\h\[\e[0m\] \[\e[0;34m\]\w\[\e[0m\] \[\e[0;37m\]>\[\e[0m\] ' +else + PS1='\[\e[0;32m\]\u\[\e[0m\]@\[\e[33m\]\h\[\e[0m\] \[\e[0;34m\]\w\[\e[0m\] \[\e[0;37m\]>\[\e[0m\] ' +fi + +# aliases +alias df='dfc' +alias ls='ls -lisa --group-directories-first --color=auto' +alias free='free -h' +alias grep='grep --color=auto' + +# manpage colors +export LESS_TERMCAP_mb=$'\E[01;31m' +export LESS_TERMCAP_md=$'\E[01;31m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[01;44;33m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[01;32m' + +# console colors +if [ "$TERM" = "linux" ]; then + echo -en "\e]P0000000" #black + echo -en "\e]P8505354" #darkgrey + echo -en "\e]P1F92672" #darkred + echo -en "\e]P9FF5995" #red + echo -en "\e]P282B414" #darkgreen + echo -en "\e]PAB6E354" #green + echo -en "\e]P3FD971F" #darkyellow + echo -en "\e]PBFEED6C" #yellow + echo -en "\e]P44E82AA" #darkblue + echo -en "\e]PC0C73C2" #blue + echo -en "\e]P58C54FE" #darkmagenta + echo -en "\e]PD9E6FFE" #magenta + echo -en "\e]P6465457" #darkcyan + echo -en "\e]PE899CA1" #cyan + echo -en "\e]P7CCCCC6" #lightgrey + echo -en "\e]PFF8F8F2" #white + clear # bring us back to default input colours +fi + +# unpack/extract files +unp () { + if [ -f $1 ] ; then + case $1 in + *.tar.bz2) tar xvjf $1 ;; + *.tar.gz) tar xvzf $1 ;; + *.tar.xz) tar xvJf $1 ;; + *.bz2) bunzip2 $1 ;; + *.rar) unrar 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 ;; + *.xz) unxz $1 ;; + *.exe) cabextract $1 ;; + *.ace) unace $1 ;; + *.arj) unarj $1 ;; + *) echo "\`$1': unknown archive" ;; + esac + else + echo "\`$1' unknown file" + fi +} @@ -0,0 +1,14 @@ +#!/bin/bash + +NC='\e[0m' +RED='\e[1;31m' +GREEN='\e[1;32m' + +files="bash_profile bashrc vimrc" + +for file in $files; do + cp $file $HOME/.$file +done + +echo -e "${GREEN}==>${NC} ...done" +echo -e "${RED}==>${NC} Don't forget to ${GREEN}$ source .bashrc!${RED}" @@ -0,0 +1,74 @@ +" settings +set nocp +set encoding=utf-8 +set fileencoding=utf-8 +set hidden +set number +set nowrap +set autoindent +set showmatch +set showmode +set lazyredraw +set mouse=a +set backspace=2 +set laststatus=2 +set t_Co=256 + +" filetype +filetype on +filetype plugin on +filetype plugin indent on + +" syntax +syntax on + +" colorscheme +set background=dark +colorscheme desert + +" cursorline +set cursorline +hi CursorLine term=bold cterm=bold guibg=Grey20 + +" statusline +set statusline=\ +set statusline+=[%n]\ +set statusline+=%<%F\ +set statusline+=%w%h%m%r\ +set statusline+=%=%{&fileencoding?&fileencoding:&encoding}\ \ +set statusline+=%{&ff}\ \ +set statusline+=%y\ \ +set statusline+=%p%%\ \ +set statusline+=%(%l:%c%)\ + +" tabs +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set shiftround +set expandtab + +" show trailing, tabs etc. +set list +set listchars=trail:·,tab:!· + +" case insensitive search +set hlsearch +set incsearch +set ignorecase +set smartcase + +" disable backup and swap files +set nobackup +set nowritebackup +set noswapfile + +" GUI +if has('gui_running') + set go-=r + set go-=R + set go-=T + set go-=L + set t_Co=256 + set guiheadroom=0 +endif |
