Skip to content

Instantly share code, notes, and snippets.

@martonsereg
Last active August 29, 2015 14:06
Show Gist options
  • Save martonsereg/79b4d4dbe68a1e2f68e6 to your computer and use it in GitHub Desktop.
Save martonsereg/79b4d4dbe68a1e2f68e6 to your computer and use it in GitHub Desktop.
my dotfiles
#!/bin/bash
export PATH=/usr/local/bin:$PATH
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Tell ls to be colourful
export CLICOLOR=1
export LSCOLORS=Exfxcxdxbxegedabagacad
# Tell grep to highlight matches
export GREP_OPTIONS='--color=auto'
export JAVA_HOME=`/usr/libexec/java_home -v 1.7.0_67`
eval "$(rbenv init -)";
# virtualenv settings
export PIP_REQUIRE_VIRTUALENV=true
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
export VIRTUAL_ENV="~/.virtualenv"
export PATH="$VIRTUAL_ENV/bin:$PATH"
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. ~/.virtualenv/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh;
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
docker-fn(){
curl -Lo /tmp/docker-functions http://j.mp/docker-functions && source /tmp/docker-functions
}
b2d-fn(){
curl -Lo /tmp/b2d-functions http://j.mp/b2d-functions && source /tmp/b2d-functions
}
ec2-fn(){
curl -Lo /tmp/ec2-functions http://j.mp/ec2-functions && source /tmp/ec2-functions
}
alias g1='git log --oneline'
alias gg='git log --pretty=format:"%h - [%an] : %s" --graph'
alias gs='git status'
alias gls='git log --oneline --decorate --graph --color'
alias gl='git log --date=short --pretty=format:"%h %Cblue%ad%Creset %an %Cred%d %Cgreen%s%Creset" --graph'
alias ll='ls -la'
export EDITOR='atom'
#THIS MUST BE AT THE END OF THE FILE FOR GVM TO WORK!!!
[[ -s "/Users/marci/.gvm/bin/gvm-init.sh" ]] && source "/Users/marci/.gvm/bin/gvm-init.sh"
source '/Users/marci/.virtualenv/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf'
set -g default-terminal "screen-256color"
set -g history-limit 10000
set-window-option -g mode-keys vi
" Use the Tomorrow Night theme
set background=dark
colorscheme Tomorrow-Night
" Make Vim more useful
set nocompatible
" Use the OS clipboard by default (on versions compiled with `+clipboard`)
set clipboard=unnamed
" Enhance command-line completion
set wildmenu
" Allow cursor keys in insert mode
set esckeys
" Allow backspace in insert mode
set backspace=indent,eol,start
" Optimize for fast terminal connections
set ttyfast
" Add the g flag to search/replace by default
set gdefault
" Use UTF-8 without BOM
set encoding=utf-8 nobomb
" Change mapleader
let mapleader=","
" Don’t add empty newlines at the end of files
set binary
set noeol
" Centralize backups, swapfiles and undo history
set backupdir=~/.vim/backups
set directory=~/.vim/swaps
if exists("&undodir")
set undodir=~/.vim/undo
endif
" Don’t create backups when editing files in certain directories
set backupskip=/tmp/*,/private/tmp/*
" Respect modeline in files
set modeline
set modelines=4
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
" Enable line numbers
set number
" Enable syntax highlighting
syntax on
" Highlight current line
set cursorline
" Make tabs as wide as two spaces
set tabstop=2
" Show “invisible” characters
set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
set list
" Highlight searches
set hlsearch
" Ignore case of searches
set ignorecase
" Highlight dynamically as pattern is typed
set incsearch
" Always show status line
set laststatus=2
" Enable mouse in all modes
set mouse=a
" Disable error bells
set noerrorbells
" Don’t reset cursor to start of line when moving around.
set nostartofline
" Show the cursor position
set ruler
" Don’t show the intro message when starting Vim
set shortmess=atI
" Show the current mode
set showmode
" Show the filename in the window titlebar
set title
" Show the (partial) command as it’s being typed
set showcmd
" Use relative line numbers
if exists("&relativenumber")
set relativenumber
au BufReadPost * set relativenumber
endif
" Start scrolling three lines before the horizontal window border
set scrolloff=3
" Strip trailing whitespace (,ss)
function! StripWhitespace()
let save_cursor = getpos(".")
let old_query = getreg('/')
:%s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfunction
noremap <leader>ss :call StripWhitespace()<CR>
" Save a file as root (,W)
noremap <leader>W :w !sudo tee % > /dev/null<CR>
" Automatic commands
if has("autocmd")
" Enable file type detection
filetype on
" Treat .json files as .js
autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
" Treat .md files as Markdown
autocmd BufNewFile,BufRead *.md setlocal filetype=markdown
endif
vmap <C-x> :!pbcopy<CR>
vmap <C-c> :w !pbcopy<CR><CR>
ewoJImRlZmF1bHRfbW9kdWxlIjogInBvd2VybGluZS5zZWdtZW50cy5jb21tb24iLAoJInNlZ21lbnRfZGF0YSI6IHsKICAgICAgICAgICAgICAgICJob3N0bmFtZSI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgImJlZm9yZSI6ICLugqIgIiwKICAgICAgICAgICAgICAgICAgICAgICAgImFyZ3MiOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIm9ubHlfaWZfc3NoIjogdHJ1ZQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgImJyYW5jaCI6IHsKCQkJImJlZm9yZSI6ICLugqAgIgogICAgICAgICAgICAgICAgfQogICAgICAgIH0sCgkic2VnbWVudHMiOiB7CgkJImxlZnQiOiBbCgkJCXsKCQkJCSJmdW5jdGlvbiI6ICJwb3dlcmxpbmUuc2VnbWVudHMuc2hlbGwubW9kZSIKCQkJfSwKCQkJewoJCQkJImZ1bmN0aW9uIjogImhvc3RuYW1lIiwKCQkJCSJwcmlvcml0eSI6IDEwCgkJCX0sCgkJCXsKCQkJCSJmdW5jdGlvbiI6ICJwb3dlcmxpbmUuc2VnbWVudHMuc2hlbGwuY3dkIiwKCQkJCSJwcmlvcml0eSI6IDEwCgkJCX0sCgkJCXsKCQkJCSJmdW5jdGlvbiI6ICJwb3dlcmxpbmUuc2VnbWVudHMuc2hlbGwuam9ibnVtIiwKCQkJCSJwcmlvcml0eSI6IDIwCgkJCX0sCgkJCXsKCQkJCSJmdW5jdGlvbiI6ICJicmFuY2giLAoJCQkJInByaW9yaXR5IjogNDAKCQkJfQoJCV0sCgkJInJpZ2h0IjogWwoJCV0KCX0KfQo=
ewoJImRlZmF1bHRfbW9kdWxlIjogInBvd2VybGluZS5zZWdtZW50cy5jb21tb24iLAoJInNlZ21lbnRzIjogewoJCSJyaWdodCI6IFsKCQkJewoJCQkJImZ1bmN0aW9uIjogImRhdGUiCgkJCX0sCgkJCXsKCQkJCSJmdW5jdGlvbiI6ICJkYXRlIiwKCQkJCSJuYW1lIjogInRpbWUiLAoJCQkJImFyZ3MiOiB7CgkJCQkJImZvcm1hdCI6ICIlSDolTSIsCgkJCQkJImlzdGltZSI6IHRydWUKCQkJCX0KCQkJfSwKCQkJewoJCQkJImZ1bmN0aW9uIjogImhvc3RuYW1lIgoJCQl9CgkJXQoJfQp9Cg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment