dotfiles

My opinionated dotfiles
git clone git://git.erethon.com/dotfiles
Log | Files | Refs

commit dbd4edb9a6d8d0ddcc223478ee5311818c0a0531
Author: Erethon <info@erethon.com>
Date:   Tue, 10 Sep 2013 20:17:29 +0300

Initial commit

Diffstat:
.Xdefaults | 36++++++++++++++++++++++++++++++++++++
.bash_aliases | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.bashrc | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.config/ls_col | 1+
.conkyrc | 46++++++++++++++++++++++++++++++++++++++++++++++
.vim/colors/pychimp.vim | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.vimrc | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
README.md | 4++++
8 files changed, 440 insertions(+), 0 deletions(-)

diff --git a/.Xdefaults b/.Xdefaults @@ -0,0 +1,36 @@ +*background: #1C1C1C +*foreground: #c0c0c0 +*cursorColor: #93a1a1 +URxvt.scrollBar: false + +!! black dark/light +!*color0: #121212 +!*color8: #2e3436 +! +!!! red dark/light +!*color1: #a35b66 +!*color9: #ab6b74 +! +!!! green dark/light +!*color2: #99ab6f +!*color10: #acb972 +! +!!! yellow dark/light +!*color3: #ca9733 +!*color11: #ccaa69 +! +!!! blue dark/light +!*color4: #495d6e +!*color12: #687987 +! +!!! magenta dark/light +!*color5: #825969 +!*color13: #977381 +! +!!! cyan dark/light +!*color6: #839191 +!*color14: #98a4a4 +! +!!! white dark/light +!*color7: #e0e0e0 +!color15: #e5e5e5 diff --git a/.bash_aliases b/.bash_aliases @@ -0,0 +1,85 @@ +# go back x directories +b() { + str="" + count=0 + while [ "$count" -lt "$1" ]; + do + str=$str"../" + let count=count+1 + done + cd $str +} + + +alias upgrade="sudo apt-get update && sudo apt-get upgrade && sudo apt-get clean" + + +#Extract almost any archive +extract () { + if [ -f $1 ] ; then + case $1 in + *.tar.bz2) tar xjf $1 ;; + *.tar.gz) tar xzf $1 ;; + *.bz2) bunzip2 $1 ;; + *.rar) unrar e $1 ;; + *.gz) gunzip $1 ;; + *.tar) tar xf $1 ;; + *.tbz2) tar xjf $1 ;; + *.tgz) tar xzf $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1 ;; + *.7z) p7zip -d $1 ;; + *) echo "'$1' cannot be extracted via extract()" ;; + esac + else + echo "'$1' is not a valid file" + fi +} + + +#Instant server +servedir(){ + sudo python -m SimpleHTTPServer 80 +} + +shutd(){ + echo $((date| cut -d' ' -f 1-5 && uptime | cut -d' ' -f 3-5 | cut -d',' -f 1 ) | tr "\n" " ") >> /home/dion/.uptime.txt + sudo shutdown -h now +} + + +#Clear terminal +alias c="clear" + +alias clip="xclip -selection clipboard" +alias burn="shred -n 3 -u " +alias monitor="xrandr --output DVI-I-1 --mode 1920x1080 --left-of VGA-1" + +#Common typo +alias les="less" + +#Paste to pastebin quickly +alias pybin="python ~/Code/Scripts/pybin.py" +#Open stdout in vim +alias vr="| vim -R -" + +#Start networking for VMs +alias vms="sudo virsh net-start default" + +#Pretty print json +alias json="python -mjson.tool" + +#Quick apt-get install/search +alias i="sudo apt-get install" +alias s="apt-cache search" + +#Quick dpkg -l | grep X +alias dp="dpkg -l | grep" + +#Stopwatch +alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' + +#Common programs alias +alias g="git" +alias v="vim" +alias h="history | grep" diff --git a/.bashrc b/.bashrc @@ -0,0 +1,122 @@ +# ~/.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 +if [[ -n "$PS1" ]]; then + +# don't put duplicate lines in the history. See bash(1) for more options +# ... or force ignoredups and ignorespace +HISTCONTROL=ignoredups:ignorespace + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;32m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# 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 ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# 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 [ -f /etc/bash_completion ] && ! shopt -oq posix; then +# . /etc/bash_completion +#fi + export HISTCONTROL=ignoreboth +fi + +export PATH=$PATH:/etc/alternatives/gem-bin + + +. ~/.config/ls_col + + +parse_git_branch() { + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/' +} + +export PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;32m\]\w\[\033[00m\]\[\033[36m\]$(parse_git_branch)\[\033[00m\]\$ ' + + + +####Adding stuff to path#### +PATH=$PATH:/sbin/ +PATH=$PATH:/usr/sbin/ +PATH=$PATH:/usr/bin/ +PATH=$PATH:/usr/local/sbin/ +export PATH diff --git a/.config/ls_col b/.config/ls_col @@ -0,0 +1 @@ +export LS_COLORS="rs=0:di=01;32:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;35:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:" diff --git a/.conkyrc b/.conkyrc @@ -0,0 +1,46 @@ +ualignment bottom_middle +background no +border_width 1 +cpu_avg_samples 2 +default_color 222222 +default_outline_color 222222 +draw_borders no +draw_graph_borders yes +draw_outline no +draw_shades no +use_xft yes +xftfont Sans Mono:size=10 +gap_x 5 +gap_y 0 +minimum_size 1260 6 +maximum_width 1260 +net_avg_samples 2 +no_buffers yes +out_to_console no +out_to_stderr no +extra_newline no +own_window no +own_window_class Conky +own_window_type desktop +own_window_transparent yes +stippled_borders 0 +update_interval 2.5 +uppercase no +use_spacer left +show_graph_scale no +show_graph_range no +format_human_readable yes +double_buffer yes + +color1 008B8B +color2 888888 +color3 444444 +color4 37FDFC +color5 112421 + +TEXT +${color1}Activity on /dev/sda:${color} ${diskiograph 10,50 000000 ff0000 -t} \ +${color1}eth0 ${color4}[${addr eth0}]${color1} Up:${color4}${upspeed eth0}${color1} - Down:${color4}${downspeed eth0} \ +${color1}CPU:${color4} ${cpu}% ${cpubar cpu0 5,50} \ +${color1}RAM:${color4}${memperc}% ${membar 5,50} \ +${color1}Now Playing: ${color4}${execi 5 ~/Code/Scripts/cmus-conky.sh} diff --git a/.vim/colors/pychimp.vim b/.vim/colors/pychimp.vim @@ -0,0 +1,64 @@ +" Vim colorscheme -- PyChimp +" +" Crated specifically for Python coding ! (For other languages, I do suggest that +" you find other colorschemes, there are loads !) +" +" Author: Pratheek <pratheek.i@gmail.com> +" +" Note: This theme uses ideas from Python IDLE, (and has some similarities) from Molokai theme +" created by Thomas Restrepo +" <http://www.vim.org/scripts/script.php?script_id=2340> +" +" This colorscheme is specifically created, to work in a translucent +" background provided by terminal and supports 256 color terminals +" +" Tip -- add <t_Co=256> in your ~/.vimrc to utilize the theme well. +" +" Thats it ! Hope you like it ! :) + +let g:colors_name = "pychimp" + +" The Basic (Normal) Text Style + +hi Normal ctermfg=253 ctermbg=NONE cterm=NONE + +" All the Python related stuff + +hi Number ctermfg=141 ctermbg=NONE cterm=NONE +hi Float ctermfg=141 ctermbg=NONE cterm=NONE +hi Statement ctermfg=208 ctermbg=NONE cterm=bold +hi Function ctermfg=35 ctermbg=NONE cterm=NONE +hi Conditional ctermfg=136 ctermbg=NONE cterm=NONE +hi Operator ctermfg=208 ctermbg=NONE cterm=NONE +hi Todo ctermfg=253 ctermbg=NONE cterm=bold +hi Comment ctermfg=240 ctermbg=NONE cterm=NONE +hi Special ctermfg=81 ctermbg=NONE cterm=NONE +hi String ctermfg=169 ctermbg=NONE cterm=NONE +hi Include ctermfg=118 ctermbg=NONE cterm=bold +hi Error ctermfg=88 ctermbg=172 cterm=bold +hi PreProc ctermfg=81 ctermbg=NONE cterm=NONE +hi Boolean ctermfg=38 ctermbg=NONE cterm=bold +hi Character ctermfg=142 ctermbg=NONE cterm=NONE + +"Vim Stuff + +hi Visual ctermfg=253 ctermbg=235 cterm=NONE +hi VertSplit ctermfg=232 ctermbg=244 cterm=NONE +hi ErrorMsg ctermfg=88 ctermbg=172 cterm=bold +hi MatchParen ctermfg=16 ctermbg=215 cterm=bold +hi Folded ctermfg=67 ctermbg=16 cterm=bold +hi FoldColumn ctermfg=67 ctermbg=16 cterm=NONE +hi LineNr ctermfg=58 ctermbg=NONE cterm=NONE +hi NonText ctermfg=58 ctermbg=NONE cterm=NONE +hi Pmenu ctermfg=81 ctermbg=16 cterm=NONE +hi PmenuSel ctermfg=202 ctermbg=16 cterm=NONE +hi PmenuSbar ctermfg=81 ctermbg=16 cterm=NONE +hi PmenuThumb ctermfg=81 ctermbg=16 cterm=NONE +hi Search ctermfg=253 ctermbg=66 cterm=NONE +hi IncSearch ctermfg=253 ctermbg=66 cterm=NONE +hi TabLine ctermfg=3 ctermbg=NONE cterm=NONE +hi TabLineSel ctermfg=14 ctermbg=NONE cterm=bold +hi TabLineFill ctermfg=46 ctermbg=NONE cterm=NONE + +" End of Colour scheme ! (Pretty small !:) ) +" Will add support for more languages eventually. ! diff --git a/.vimrc b/.vimrc @@ -0,0 +1,82 @@ +"For updates please check https://ererthon.com and https://github.com/erethon +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"Visual stuff +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"Turn syntax highlighting on +syntax on + +"Insert 8 spaces when tab is pressed (if not softtabstop is set) +set tabstop=8 +"Insert space characters when tab is pressed +set expandtab +"Insert 4 spaces when tab is pressed (overrides tabstop if expandtab is set) +set softtabstop=4 +"Controls how many spaces are indented when > and < is used +set shiftwidth=4 + +"Remove trailing whitespace for .py and .rst files +autocmd BufWritePre *.py :%s/\s\+$//e +autocmd BufWritePre *.rst %s/\s\+$//e + +"Show line numbers +set number +"Show ruler on bottom of vim +set ruler + +"Ignore case when searching +set ignorecase +"Set smartcace on (aka step will find stepbrother and Steps, but Step wont +"find stepbrother) +set smartcase +"Highlight search results +set hlsearch + +set showmatch +set mat=2 + +"Set colorscheme +colorscheme pychimp + +"Show a blue vertical line on the 80th character (pep8 compliant) +set colorcolumn=80 +highlight ColorColumn ctermbg=23 + + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Mapping stuff +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"Mapping 0 to go to first non-blank character of line +map 0 ^ + +"Use Ctrl + t for opening a new tab +nnoremap <c-t> :tabnew +"Use Ctrl + h/l for previous/next tab +nnoremap <c-h> gT +nnoremap <c-l> gt + +"Use ';' instead of ':' +nnoremap ; : + +"Faster Normal Mode +imap ii <Esc> + +"Pep8 checking +map <F5> :!pep8 % <Enter> + +"Easy set paste and set nopaste +set pastetoggle=<F2> + +"Common typos +"imap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +"Random Stuff +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +"Enable pathogen add ons +execute pathogen#infect() + + +filetype indent plugin on +filetype indent on diff --git a/README.md b/README.md @@ -0,0 +1,4 @@ +## Dotfiles + +Suggestions on how I could do something more efficiently or better, are always +welcome.