Skip to content

Instantly share code, notes, and snippets.

@juandazapata
Last active December 13, 2015 17:39
Show Gist options
  • Save juandazapata/4949870 to your computer and use it in GitHub Desktop.
Save juandazapata/4949870 to your computer and use it in GitHub Desktop.
Vim dotfiles
alias fucking='sudo'
alias be='bundle exec'
alias r='bundle exec rake'
alias fs='bundle exec foreman start'
alias rs='bundle exec rails server'
alias rg='bundle exec rails generate'
alias rc='bundle exec rails console'
alias log='tail -f log/*.log'
alias c='clear'
alias v='vim'
alias h='heroku'
alias now='date +"%T'
alias nowtime=now
alias nowdate='date +"%d-%m-%Y"'
alias ping='ping -c 5'
alias fastping='ping -c 100 -s.2'
alias header='curl -I'
alias headerc='curl -I --compress'
alias cp='cp -i'
alias ln='ln -i'
alias chown='chown --preserve-root'
alias chmod='chmod --preserve-root'
alias chgrp='chgrp --preserve-root'
alias wget='wget -c'
alias random='openssl rand -base64'
# Git tab completion
source ~/git-completion.bash
source ~/git-prompt.sh
# Aliases
source ~/.aliases
# Show branch in status line
export PATH=/usr/local/bin:$PATH
PS1='┌─[\e[00;33m\]\w\[\e[0m\]$(__git_ps1 "][\e[00;31m\]%s")\e[0m\]] \[\e]1;\]\W\[\a\]\n\[\e[00;32m\]└─╼\[\e[0m\] '
export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
set nobackup
set nowritebackup
set noswapfile
color solarized
set guifont=Monaco:h16
set relativenumber
set colorcolumn=80
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
if exists(":Tabularize")
nmap <Leader>a= :Tabularize /=<CR>
vmap <Leader>a= :Tabularize /=<CR>
nmap <Leader>a: :Tabularize /:\zs<CR>
vmap <Leader>a: :Tabularize /:\zs<CR>
endif
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
endif
endfunction
com! FormatJSON %!python -m json.tool
let mapleader = ","
# See http://robots.thoughtbot.com/brewfile-a-gemfile-but-for-homebrew
# To install use `brew bundle`
brew install memcached
brew install redis

Vim dotfiles

Just install janus

Create a custom vim file for overriding some janus defaults and replace the contents of those files with the respective files included in this gist.

$ touch ~/.vimrc.after
$ touch ~/.vimrc.before

Install some additional plugins

$ mkdir ~/.janus
$ cd ~/.janus
$ git clone https://github.com/tpope/vim-surround.git
$ git clone https://github.com/mattn/zencoding-vim.git
$ git clone https://github.com/Townk/vim-autoclose.git
$ git clone https://github.com/bling/vim-airline.git
$ git clone https://github.com/myusuf3/numbers.vim.git
$ git clone https://github.com/vim-scripts/Align.git
$ git clone https://github.com/slim-template/vim-slim.git
$ git clone https://github.com/airblade/vim-gitgutter.git
$ git clone https://github.com/jtratner/vim-flavored-markdown.git
$ git clone https://github.com/othree/html5.vim.git
$ git clone https://github.com/kana/vim-textobj-user.git
$ git clone https://github.com/nelstrom/vim-textobj-rubyblock.git
$ git clone https://github.com/groenewege/vim-less.git
$ git clone https://github.com/mxw/vim-jsx.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment