diff --git a/Xresources b/Xresources new file mode 100644 index 0000000..a9f5311 --- /dev/null +++ b/Xresources @@ -0,0 +1,87 @@ + +! General options. +! ---------------- + +! Slightly largr terminal for line numbers in vim. +*geometry: 84x25 + +! Every shell is a login shell by default (for inclusion of all necessary +! environment variables) +*loginshell: true + +! right hand side scrollbar... +!xterm*rightScrollBar: true +*scrollBar: false + +! stop output to terminal from jumping down to bottom of scroll again +*scrollTtyOutput: false + +! fancy cryptic colours +*color0: rgb:00/00/00 +*color1: rgb:a8/00/00 +*color2: rgb:00/a8/00 +*color3: rgb:a8/54/00 +*color4: rgb:00/00/a8 +*color5: rgb:a8/00/a8 +*color6: rgb:00/a8/a8 +*color7: rgb:a8/a8/a8 +*color8: rgb:54/54/54 +*color9: rgb:fc/54/54 +*color10: rgb:54/fc/54 +*color11: rgb:fc/fc/54 +*color12: rgb:54/54/fc +*color13: rgb:fc/54/fc +*color14: rgb:54/fc/fc +*color15: rgb:fc/fc/fc + + + +! URxvt +! ----- + +! Because tmux doesnt like rxvt-unicode-256color +urxvt.termName: rxvt-unicode + +! Perls +URxvt.perl-ext-common: default,matcher,tabbedex,font-size + +! matcher: clickable urls +URxvt.url-launcher: /usr/bin/firefox +URxvt.matcher.button: 1 + +! tabbedex: tabs +URxvt.tabbed.autohide: true + +! font-size: zooming live +URxvt.keysym.C-S-Up: perl:font-size:increase +URxvt.keysym.C-S-Down: perl:font-size:decrease +URxvt.iso14755: false +URxvt.iso14755_52: false + +! Use a nice truetype font and size by default... +URxvt.font: xft:Source Code Pro for Powerline:size=10 +! URxvt.letterSpace: -1 + +! Foreground and transparent background ([xx] == xx% opacity) +URxvt.depth: 32 +urxvt*foreground: rgb:f8/f8/f8 +urxvt*background: [75]rgb:00/00/00 + + + +! xterm +! ----- + +! Use a nice truetype font and size by default... +xterm*faceName: Source Code Pro for Powerline +xterm*faceSize: 10 + +! double-click to select whole URLs :D +xterm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48 + +xterm*foreground: rgb:f8/f8/f8 +xterm*background: rgb:00/00/00 + +! Using alt as a meta key. +XTerm*metaSendsEscape: true + diff --git a/fetch_them_files.sh b/fetch_them_files.sh new file mode 100644 index 0000000..8f4a6e7 --- /dev/null +++ b/fetch_them_files.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +files="$(ls ~/.vimrc ~/.Xresources ~/.zshrc)" + +echo "$files" | while read file; do + cp "$file" "${file##*/.}" +done + + diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..402e79f --- /dev/null +++ b/vimrc @@ -0,0 +1,271 @@ + +" Vundle plugins {{{ +" ============================================================================ " + +set nocompatible " be iMproved, required +filetype off " required + +" set the runtime path to include Vundle and initialize +set rtp+=~/.vim/bundle/Vundle.vim +call vundle#begin() + +" let Vundle manage Vundle, required +Plugin 'gmarik/Vundle.vim' + +Plugin 'tpope/vim-fugitive' +Plugin 'kien/ctrlp.vim' +Plugin 'bling/vim-airline' +Plugin 'Valloric/YouCompleteMe' +Plugin 'scrooloose/nerdtree' +Plugin 'Shougo/vimproc.vim' +Plugin 'Shougo/vimshell.vim' +Plugin 'tpope/vim-markdown' +Plugin 'altercation/vim-colors-solarized' + +" All of your Plugins must be added before the following line +call vundle#end() " required +filetype plugin indent on " required +" Put your non-Plugin stuff after this line + +" Configuring NerdTree +noremap :NERDTreeToggle +let NERDTreeIgnore=[ + \ ".*\\.class$", + \ ".*\\.o$", + \ ".*\\.hi$", + \ ".*\\.pyc$" + \ ] + +" Configuring ctrlp +noremap :CtrlP +noremap :CtrlPBuffer + +" Configuring Airline +let g:airline_powerline_fonts=1 + +" Configuring YouCompleteMe +let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py' + +" Configuring VimShell +noremap :VimShell -split + +" Loading Solarized +set t_Co=256 +let g:solarized_termcolors=256 +let g:solarized_contrast="normal" +let g:solarized_underline=0 +let g:solarized_termtrans=1 +syntax enable +set background=dark +colorscheme solarized + +" }}} + +" General Options {{{ +" ============================================================================ " + +set number " line numbers on the right side +set showcmd " show the commands while typing +set splitright " open new splits on the right +set splitbelow " open new splits below +set autoread " autoreload file on change +set scrolloff=8 " keep the cursor 8 lines away from the top/bottom +set ruler " show the lines/% bottomright +set encoding=utf-8 " set default encoding +set laststatus=2 " always show the status line + +" wrap lines at 80 characters +set formatprg=par\ -w80 +set formatoptions=t +set textwidth=80 + +" indentation +set tabstop=4 " tab is 4 width +set softtabstop=4 " tab is 4 width +set shiftwidth=4 " for use with > and < +set expandtab " tab key puts spaces +set autoindent " in case filetype indent is wrong +filetype plugin indent on +set list " if tabs, show them with 2 spaces +set listchars=tab:\·\ ,trail:· + " display tabs with a leading \cdot + " trailing whitespace looks like \cdot + +" Don't save tmp/swap files in the current directory. +set directory=~/.vim/tmp/swap/ +set backupdir=~/.vim/tmp/backup/ + +" Learning to use decent vim. +noremap +noremap +noremap +noremap + +" some shortcuts +" go to start of line +noremap H ^ +" go to end of line +noremap L g_ +" fuck you K +noremap K +" center screen with +noremap zz +" rewrite file with sudo +cmap w!! w !sudo tee % >/dev/null +" paste the clipboard +noremap :r!xclip -sel c -o + +" }}} + +" Filetype specific configuration. {{{ +" ============================================================================ " + +" Haskell {{{ +" ---------------------------------------------------------------------------- " + +autocmd FileType haskell call HaskellHook() +autocmd BufRead,BufNewFile *.lhs call HaskellHook() +autocmd BufRead,BufNewFile *.hsc set filetype=haskell + +function HaskellHook() + " Ghci shortcut + noremap :!ghci -Wall '%' + + " Haskell Styling + noremap :%!stylish-haskell + noremap :!hlint % + + " Vim-hoogle + noremap :Hoogle + noremap :HoogleClose +endfunction + +" }}} + +" Java {{{ +" ---------------------------------------------------------------------------- " + +autocmd FileType java call JavaHook() + +function JavaHook() + " Javac shortcut + noremap :!javac % + + " Java shortcut + noremap :!java %:r +endfunction + +" }}} + +" C {{{ +" ---------------------------------------------------------------------------- " + +autocmd FileType c call CHook() + +function CHook() + " gcc shortcut + noremap :!gcc % -o %:r + + " execute + noremap :!./%:r +endfunction + +" }}} + +" Ruby {{{ +" ---------------------------------------------------------------------------- " + +autocmd FileType ruby call RubyHook() +autocmd FileType eruby call RubyHook() + +function RubyHook() + setlocal tabstop=2 + setlocal shiftwidth=2 + set softtabstop=2 + noremap :!irb -Ilib -r ./% + + " Use rake as makeprogram + set makeprg=rake + + " Folding + set foldmethod=syntax +endfunction + +" }}} + +" R {{{ +" ---------------------------------------------------------------------------- " + +autocmd FileType r call RHook() + +function RHook() + " Interactive shortcut + noremap :'<,'>w !R --no-save --interactive +endfunction + +" }}} + +" Latex {{{ +" ---------------------------------------------------------------------------- " + +autocmd FileType tex call TexHook() + +function TexHook() + setlocal tabstop=2 + setlocal shiftwidth=2 + set softtabstop=2 + " Make a pdf + noremap :!pdflatex '%' + noremap :!evince '%:r.pdf' +endfunction + +" }}} + +" Python {{{ +" ---------------------------------------------------------------------------- " + +autocmd FileType python call PythonHook() + +function Pylint() + silent !pylint --reports=n --output-format=parseable '%' > errors.err 2> /dev/null + cfile + silent !rm errors.err + redraw! + copen +endfunction + +function PythonFold(lnum) + if getline(a:lnum-1) =~ '^\s*def\s' || getline(a:lnum-1) =~ '^\s*class\s' + return indent(a:lnum-1) / 4 + 1 + endif + if getline(a:lnum) =~ '^\s*def\s' || getline(a:lnum) =~ '^\s*class\s' + return indent(a:lnum) / 4 + endif + if getline(a:lnum+1) =~ '^\s*def\s' || getline(a:lnum+1) =~ '^\s*class\s' + return indent(a:lnum + 1) / 4 + endif + if getline(a:lnum+1) =~ '^\S.*$' + return '0' + endif + return '=' +endfunction + +function PythonFoldText() + return repeat(' ', indent(v:foldstart - 1) + 4) . '+' +endfunction + +function PythonHook() + set formatoptions+=rq + noremap :!python -i '%' + noremap :call Pylint() + " Uncomment to fold. Slows down SuperTab extremely + set foldmethod=expr + set foldexpr=PythonFold(v:lnum) + set foldtext=PythonFoldText() +endfunction + +" }}} + +" }}} + +" vim: foldmethod=marker diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..d692782 --- /dev/null +++ b/zshrc @@ -0,0 +1,46 @@ + +# Lines configured by zsh-newuser-install +HISTFILE=~/.histfile +HISTSIZE=1000 +SAVEHIST=1000 +setopt appendhistory +unsetopt beep +bindkey -v +# End of lines configured by zsh-newuser-install + +# The following lines were added by compinstall +zstyle :compinstall filename '/home/felix/.zshrc' + +autoload -Uz compinit +compinit +# End of lines added by compinstall + +# Get ourselves a nice prompt. +git_status() { + if git status 2>/dev/null 1>&2; then + git branch | grep \* + git status --porcelain | cat <(echo OK) - | sed 's/\(..\).*/(\1)/' | tail -1 + fi +} +autoload -U colors && colors +export PS1="[%*] %{$fg[red]%}%n@%m%{$reset_color%} %{$fg_bold[green]%}%~%{$reset_color%} "'$(git_status | xargs echo)'" + %(?.$.%%) "; setopt promptsubst + +# Color ls +alias ls="ls --color=auto" + +# Local scripts +export PATH="$HOME/.local/bin":"$PATH" + +# Cabal +#export PATH="$HOME/.cabal/bin":"$PATH" + +# Gems +export PATH="$(ruby -rubygems -e "puts Gem.user_dir")/bin":"$PATH" +export GEM_HOME="$(ruby -e 'puts Gem.user_dir')" + +# For vim +export EDITOR="vim" +export PYTHONPATH=/usr/lib/python3.4/site-packages +stty -ixon # turn of for vimshell +