Skip to content

Instantly share code, notes, and snippets.

@Eruant
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Eruant/dc1dac5ee25bf87912e4 to your computer and use it in GitHub Desktop.
Save Eruant/dc1dac5ee25bf87912e4 to your computer and use it in GitHub Desktop.
Dot Files
export PATH="/usr/local/bin:$PATH"
export PATH=/usr/local/sbin:$PATH
alias vim='mvim -g'
alias la='ls -lGAp'
alias ll='ls -lGp'
alias e='mvim'
alias c='clear'
alias server='python -m SimpleHTTPServer'
function _update_ps1() {
export PS1="$(~/powerline-shell/powerline-shell.py --cwd-only $? 2> /dev/null)"
}
export PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
function encode() {
ffmpeg -i "$1" -b:v 650k -s 480x270 -vcodec libx264 -preset medium -acodec libfaac -ab 64k -ac 1 "$2"_hi.mp4
ffmpeg -i "$1" -b:v 300k -s 480x270 -vcodec libx264 -preset medium -acodec libfaac -ab 64k -ac 1 "$2".mp4
mv "$2"_hi.mp4 "$2"_hi.m4v
mv "$2".mp4 "$2".m4v
}
function tl() {
i = "$1"; while true; do screencapture -t jpg -x ~/timelapse/img$i.jpg; let i++; sleep 4; done
}
function morning() {
c="\033[33m" # yellow
nc="\033[0m" # no color
# brew
echo ""
echo -e "${c}Updating the brewery${nc}"
brew update
echo ""
echo -e "${c}Cleaning the bottles${nc}"
if [[ -n $(brew cleanup -ns --force) ]]; then
brew cleanup -s --force
else
echo "No washing up found"
fi
echo ""
echo -e "${c}Checking for issues with the brewery${nc}"
brew doctor
echo ""
echo -e "${c}Looking for out of date bottles${nc}"
old=$(brew outdated)
if [[ -n $old ]]; then
brew outdated
else
echo "No out of date bottles found"
fi
# npm packages
echo ""
npmOutdatedGlobal
# finish
echo ""
echo -e "${c}Have a nice day!${nc}"
echo ""
}
function outdated() {
echo ""
npmOutdatedLocal
echo ""
npmOutdatedGlobal
echo ""
}
function npmOutdatedLocal() {
c="\033[33m" # yellow
nc="\033[0m" # no color
echo -e "${c}Looking for out of date local node modules${nc}"
local=$(npm outdated --depth 0)
if [[ -n $local ]]; then
npm outdated --depth 0
else
echo "No outdated packages found"
fi
}
function npmOutdatedGlobal() {
c="\033[33m" # yellow
nc="\033[0m" # no color
echo -e "${c}Looking for out of date global node modules${nc}"
global=$(npm outdated --depth 0 -g)
if [[ -n $global ]]; then
npm outdated --depth 0 -g
else
echo "No outdated packages found"
fi
}
[alias]
tags = tag -l
branches = branch -a
remotes = remote -v
hist = log --graph --pretty=format:'%Cred%h%Creset %s%C(yellow)%d%Creset %Cgreen(%cr)%Creset [%an]' --abbrev-commit --date=relative
find = log --pretty=\"format:%Cgreen%H %Cblue%s\" --name-status --grep
[color]
ui= auto
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[user]
name = <My Name>
email = <My Email>
[credential]
helper = osxkeychain
[push]
default = simple
[core]
editor = mvim
" use vim settings rather than Vi settings
set nocompatible
" Pathogen (to load all plugins in the bundle folder)
execute pathogen#infect()
" General config
set number " line numbers
set backspace=indent,eol,start " backspace through everything in insert mode
set showcmd " show incomplete commands in the bottom
set showmode " show current mode in the bottom
set visualbell " no sounds
set autoread " reload file changes from outside of vim
" to make vim act like other editors, buffers can exist in the background
set hidden
syntax on
syntax enable
" seach settings
set incsearch " find the next match as we type
set hlsearch " highlight the searches by default
set viminfo='100,f1 " save up to 100 marks
" turn off .swp files
set noswapfile
set nobackup
set nowb
" persistant undo
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
" indentation
set autoindent
set smartindent
set smarttab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set expandtab
set smarttab autoindent
" show numbers and hide gui
set guioptions-=r
set guioptions-=R
set guioptions-=l
set guioptions-=L
set guioptions-=T
set guifont=Inconsolata:h17
filetype plugin on
filetype indent on
set listchars=tab:›\ ,eol:¬
" set nowrap
set wrap
set linebreak
" folding
set foldmethod=manual " fold manually
set foldnestmax=3 " deppest fold is level 3
set nofoldenable " dont fold by default
" completion
set wildmode=list:longest
set wildmenu " enable ctrl-n and ctrl-p to scroll thru matches
set wildignore=*.o,*.obj,*~ " stuff to ignore when tab completing
set wildignore=*vim/backups*
set wildignore=*DS_Store*
set wildignore=*.gem
set wildignore=log/**
set wildignore=tmp/**
set wildignore=*png,*jpg,*.gif
set background=dark
colorscheme solarized
set splitright
" allow syntax and magic chars to be selected
set magic
set encoding=utf-8
" shorcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
set list
map <leader>' :NERDTreeToggle<CR>
map <leader>g :GITGutterToggle<CR>
map <leader>/ <leader>ci
set t_Co=256;
set term=xterm-256color
set termencoding=utf-8
function! Tab(value)
let &shiftwidth=a:value
let &softtabstop=a:value
let &tabstop=a:value
endfunction
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_alaways_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_html_tidy_exex = 'tidy5'
let g:syntastic_html_checkers=['']
let g:jsx_ext_required = 0
if has("gui_running")
set lines=80
set columns=150
set fuopt+=maxhorz
" save folds
au BufWinLeave * mkview
au BufWinEnter * silent loadview
" add syntax
au BufNewFile,BufRead *.less set filetype=less
au BufNewFile,BufRead *.scss set filetype=scss
au BufNewFile,BufRead *.plist set filetype=xml
au BufNewFile,BufRead *.md set filetype=markdown
au BufNewFile,BufRead *.hx set filetype=haxe
au BufNewFile,BufRead *.json set filetype=javascript
au BufNewFile,BufRead *.coffee set filetype=coffee
au BufNewFile,BufRead *.ts set filetype=typescript
au BufNewFile,BufRead *.jade set filetype=jade
" odd ones
au BufNewFile,BufRead *.soy set filetype=soy
au BufNewFile,BufRead *.ftl set filetype=html
"au BufWritePost *.js :JSHint
"let g:jshint2_confirm = 0
end
ack
android-sdk
ansible
ant
autoconf
automake
bison27
boot2docker
brew-cask
cairo
casperjs
cmake
composer
cowsay
cscope
curl
czmq
docker
drush
faac
fdk-aac
ffmpeg
flac
flex
fontconfig
fontforge
fortune
freetype
frei0r
fribidi
galen
gdbm
gettext
git
git-ftp
gitsh
glib
gmp
gobject-introspection
harfbuzz
icu4c
io
jpeg
lame
libao
libass
libevent
libffi
libogg
libpng
libsndfile
libsodium
libssh2
libtiff
libtool
libvo-aacenc
libvorbis
libvpx
libyaml
little-cms2
macvim
mad
makedepend
maven
n
node
opencore-amr
openjpeg
openssl
opus
orc
ossp-uuid
pango
pcre
phantomjs
php54
pixman
pkg-config
postgresql
postgresql93
python
rbenv
re2c
readline
redis
rtmpdump
ruby-build
rust
sbt
schroedinger
sdl
ski
sox
speex
sqlite
texi2html
theora
tidy
tomcat6
tomcat7
tree
unixodbc
varnish3
vitetris
watch
wget
x264
x265
xvid
xz
yajl
yasm
zeromq
zlib
# Plugins
- nerdcommenter
- nerdtree
- syntastic
- tlib_vim
- typescript-vim
- vim-addoon-mw-utils
- vim-airline
- vim-colors-solarized
- vim-gitgutter
- vim-jade
- vim-jsx
- vim-multiple-cursors
- vim-snipmate
- vim-snippets
- vim-twig
# Syntax
- coffee.vim
- haxe.vim
- htmljinja.vim
- jinja.vim
- less.vim
- markdown.vim
- scss.vim
- typescript.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment