├── vim ├── ftplugin │ ├── smarty │ ├── xml │ ├── htmldjango │ ├── html │ │ ├── sparkup.py │ │ └── sparkup.vim │ └── ruby.vim └── .netrwhist ├── rspec ├── .gitignore ├── gitignore ├── tmuxinator.zsh ├── ctags ├── zsh_custom ├── plugins │ └── tmuxinator │ │ └── tmuxinator.plugin.zsh └── themes │ └── poetic.zsh-theme ├── install ├── .gitmodules ├── database.yml ├── gitconfig ├── zshrc ├── README.md ├── vimrc.bundles ├── tmux.conf ├── aliases └── vimrc /vim/ftplugin/smarty: -------------------------------------------------------------------------------- 1 | html -------------------------------------------------------------------------------- /vim/ftplugin/xml: -------------------------------------------------------------------------------- 1 | html -------------------------------------------------------------------------------- /vim/ftplugin/htmldjango: -------------------------------------------------------------------------------- 1 | html -------------------------------------------------------------------------------- /rspec: -------------------------------------------------------------------------------- 1 | --colour 2 | --order random 3 | -------------------------------------------------------------------------------- /vim/ftplugin/html/sparkup.py: -------------------------------------------------------------------------------- 1 | ../../../sparkup.py -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore these 2 | vim/tmp 3 | vim/bundle 4 | 5 | .git-bitbucket/ 6 | -------------------------------------------------------------------------------- /vim/.netrwhist: -------------------------------------------------------------------------------- 1 | let g:netrw_dirhistmax =10 2 | let g:netrw_dirhist_cnt =1 3 | let g:netrw_dirhist_1='/Users/matthew/.poetic_dotfiles/vim' 4 | -------------------------------------------------------------------------------- /gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.sw[nop] 3 | .bundle 4 | db/*.sqlite3 5 | log/*.log 6 | rerun.txt 7 | tags 8 | tmp/**/* 9 | !tmp/cache/.keep 10 | zeus.json 11 | *.dump 12 | node_modules 13 | -------------------------------------------------------------------------------- /vim/ftplugin/ruby.vim: -------------------------------------------------------------------------------- 1 | " use old version of regex engine which is actually faster for ruby files 2 | set re=1 " http://stackoverflow.com/questions/16902317/vim-slow-with-ruby-syntax-highlighting 3 | -------------------------------------------------------------------------------- /tmuxinator.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | if [[ ! -o interactive ]]; then 4 | return 5 | fi 6 | 7 | compctl -K _tmuxinator tmuxinator mux 8 | 9 | _tmuxinator() { 10 | local words completions 11 | read -cA words 12 | 13 | if [ "${#words}" -eq 2 ]; then 14 | completions="$(tmuxinator commands)" 15 | else 16 | completions="$(tmuxinator completions ${words[2,-2]})" 17 | fi 18 | 19 | reply=("${(ps:\n:)completions}") 20 | } 21 | -------------------------------------------------------------------------------- /ctags: -------------------------------------------------------------------------------- 1 | --langdef=markdown 2 | --langmap=markdown:.mkd 3 | --regex-markdown=/^#[ \t]+(.*)/\1/h,Heading_L1/ 4 | --regex-markdown=/^##[ \t]+(.*)/\1/i,Heading_L2/ 5 | --regex-markdown=/^###[ \t]+(.*)/\1/k,Heading_L3/ 6 | 7 | --langdef=puppet 8 | --langmap=puppet:.pp 9 | --regex-puppet=/^class[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/c,class/ 10 | --regex-puppet=/^site[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/s,site/ 11 | --regex-puppet=/^node[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/n,node/ 12 | --regex-puppet=/^define[ \t]*([:a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/ 13 | 14 | 15 | -------------------------------------------------------------------------------- /zsh_custom/plugins/tmuxinator/tmuxinator.plugin.zsh: -------------------------------------------------------------------------------- 1 | tmux_cmd() { 2 | # Constants 3 | local tmuxinator_configs_path 4 | tmuxinator_configs_path="$HOME/.tmuxinator" 5 | 6 | local a 7 | read -l a 8 | 9 | num_args=$(echo "$a" | awk '{print NF}') 10 | last_arg=$(echo "$a" | awk '{print $NF}') 11 | 12 | if [[ $num_args -le 1 ]]; then 13 | reply=(start open copy delete implode list doctor help version) 14 | else 15 | # whether to autocomplete project names 16 | if [[ -n "$(echo "start open copy delete" | grep -E "\<$last_arg\>")" ]]; then 17 | reply=(`ls "$tmuxinator_configs_path" | sed 's/\.yml$//' | sed -e :a -e '$!N; s/\n/ /; ta'`) 18 | fi 19 | fi 20 | } 21 | 22 | compctl -K _tmux_cmd tmuxinator 23 | -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ln -s ~/.poetic_dotfiles/vim ~/.vim 4 | ln -s ~/.poetic_dotfiles/vimrc ~/.vimrc 5 | ln -s ~/.poetic_dotfiles/vimrc.bundles ~/.vimrc.bundles 6 | ln -s ~/.poetic_dotfiles/zshrc ~/.zshrc 7 | ln -s ~/.poetic_dotfiles/rspec ~/.rspec 8 | ln -s ~/.poetic_dotfiles/gitignore ~/.gitignore 9 | ln -s ~/.poetic_dotfiles/aliases ~/.aliases 10 | ln -s ~/.poetic_dotfiles/ctags ~/.ctags 11 | ln -s ~/.poetic_dotfiles/tmux.conf ~/.tmux.conf 12 | ln -s ~/.poetic_dotfiles/tmuxinator ~/.tmuxinator 13 | ln -s ~/.poetic_dotfiles/tmuxinator.zsh ~/.tmuxinator.zsh 14 | 15 | cd ~/.poetic_dotfiles 16 | git submodule init 17 | git submodule update 18 | 19 | # removed for now as it won't run proper in vagrant env 20 | #vim +PluginInstall +qall 21 | 22 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vim/bundle/vundle"] 2 | path = vim/bundle/vundle 3 | url = https://github.com/gmarik/vundle.git 4 | [submodule "powerline"] 5 | path = powerline 6 | url = https://github.com/Lokaltog/powerline.git 7 | [submodule "oh-my-zsh"] 8 | path = oh-my-zsh 9 | url = https://github.com/robbyrussell/oh-my-zsh.git 10 | [submodule "zsh_custom/plugins/zsh-syntax-highlighting"] 11 | path = zsh_custom/plugins/zsh-syntax-highlighting 12 | url = https://github.com/zsh-users/zsh-syntax-highlighting.git 13 | [submodule "vim/bundle/Vundle.vim"] 14 | path = vim/bundle/Vundle.vim 15 | url = https://github.com/gmarik/Vundle.vim.git 16 | [submodule "tmux/plugins/tpm"] 17 | path = tmux/plugins/tpm 18 | url = https://github.com/tmux-plugins/tpm 19 | -------------------------------------------------------------------------------- /zsh_custom/themes/poetic.zsh-theme: -------------------------------------------------------------------------------- 1 | CRUNCH_BRACKET_COLOR="%{$fg[white]%}" 2 | CRUNCH_DIR_COLOR="%{$fg[cyan]%}" 3 | CRUNCH_GIT_BRANCH_COLOR="%{$fg[green]%}" 4 | CRUNCH_GIT_CLEAN_COLOR="%{$fg[green]%}" 5 | CRUNCH_GIT_DIRTY_COLOR="%{$fg[red]%}" 6 | 7 | # These Git variables are used by the oh-my-zsh git_prompt_info helper: 8 | ZSH_THEME_GIT_PROMPT_PREFIX="$CRUNCH_BRACKET_COLOR$CRUNCH_GIT_BRANCH_COLOR%{[%}" 9 | ZSH_THEME_GIT_PROMPT_SUFFIX="$CRUNCH_GIT_BRANCH_COLOR]" 10 | # ZSH_THEME_GIT_PROMPT_CLEAN="$CRUNCH_GIT_CLEAN_COLOR*" 11 | 12 | ZSH_THEME_GIT_PROMPT_DIRTY="$CRUNCH_GIT_DIRTY_COLOR*" 13 | 14 | CRUNCH_DIR_="$CRUNCH_DIR_COLOR%c\$(git_prompt_info)" 15 | CRUNCH_PROMPT="$CRUNCH_BRACKET_COLOR $ " 16 | 17 | # Put it all together! 18 | PROMPT="$CRUNCH_DIR_$CRUNCH_PROMPT%{$reset_color%}" 19 | -------------------------------------------------------------------------------- /database.yml: -------------------------------------------------------------------------------- 1 | # this is used to be copied into a rails config directory after cloning 2 | # a project since the database.yml is likely not in the repo. We have it using 3 | # port 15432 since thats the default port for pg that boxen uses. If you are 4 | # using a basic pg installation it will probably be on 5432 instead 5 | # 6 | # you'll also need to swap out `name` in this file for the project you are working 7 | # on 8 | defaults: &defaults 9 | adapter: postgresql 10 | host: localhost 11 | encoding: unicode 12 | pool: 5 13 | port: 15432 14 | 15 | development: 16 | <<: *defaults 17 | database: name_dev 18 | 19 | test: &test 20 | <<: *defaults 21 | database: name_test 22 | 23 | production: 24 | <<: *defaults 25 | database: name 26 | 27 | cucumber: 28 | <<: *test 29 | -------------------------------------------------------------------------------- /gitconfig: -------------------------------------------------------------------------------- 1 | [push] 2 | default = current 3 | [color] 4 | ui = auto 5 | [alias] 6 | aa = add --all 7 | ap = add --patch 8 | ca = commit --amend 9 | ci = commit -v 10 | co = checkout 11 | create-branch = !sh -c 'git push origin HEAD:refs/heads/$1 && git fetch origin && git branch --track $1 origin/$1 && cd . && git checkout $1' - 12 | delete-branch = !sh -c 'git push origin :refs/heads/$1 && git remote prune origin && git branch -D $1' - 13 | merge-branch = !git checkout master && git merge @{-1} 14 | pr = !hub pull-request 15 | st = status 16 | up = !git fetch origin && git rebase origin/master 17 | [core] 18 | excludesfile = /opt/boxen/config/git/gitignore 19 | autocrlf = input 20 | [merge] 21 | ff = only 22 | [include] 23 | path = .gitconfig.local 24 | 25 | [credential] 26 | helper = /opt/boxen/bin/boxen-git-credential 27 | 28 | [hub] 29 | protocol = https 30 | [difftool "sourcetree"] 31 | cmd = opendiff \"$LOCAL\" \"$REMOTE\" 32 | path = 33 | [mergetool "sourcetree"] 34 | cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" 35 | trustExitCode = true 36 | -------------------------------------------------------------------------------- /zshrc: -------------------------------------------------------------------------------- 1 | # Set Vim as the default editor 2 | export EDITOR="vim" 3 | 4 | # Make sure SHELL is set properly 5 | export SHELL="/bin/zsh" 6 | 7 | # Boxen 8 | [ -f /opt/boxen/env.sh ] && source /opt/boxen/env.sh 9 | 10 | # Path to your oh-my-zsh configuration. 11 | ZSH=$HOME/.poetic_dotfiles/oh-my-zsh 12 | ZSH_CUSTOM=$HOME/.poetic_dotfiles/zsh_custom 13 | 14 | # Path to poetid dotfiles 15 | POETIC_DOTFILES=$HOME/.poetic_dotfiles 16 | 17 | ZSH_THEME="poetic" 18 | 19 | DISABLE_AUTO_TITLE="true" 20 | 21 | plugins=(git git-flow osx rails brew bower bundle gem vim gem meteor npm tmux tmuxinator autojump zsh-syntax-highlighting jsontools) 22 | 23 | source $ZSH/oh-my-zsh.sh 24 | 25 | # tmuxinator completions 26 | source $POETIC_DOTFILES/tmuxinator.zsh 27 | 28 | export CLICOLOR=1 29 | export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx 30 | 31 | # Default to standard vi bindings, regardless of editor stringj 32 | # / to do backward search 33 | bindkey -v 34 | bindkey "jj" vi-cmd-mode 35 | bindkey -M vicmd '/' history-incremental-search-backward 36 | 37 | path+=($NODENV_ROOT) 38 | eval "$(nodenv init -)" 39 | 40 | # aliases 41 | [[ -f ~/.poetic_dotfiles/aliases ]] && source ~/.poetic_dotfiles/aliases 42 | 43 | # Local config 44 | [[ -f ~/.zshrc.local ]] && source ~/.zshrc.local 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Setup 2 | ========== 3 | + run `git clone https://github.com/poetic/dotfiles.git ~/.poetic_dotfiles` 4 | + `~/.poetic_dotfiles/install` 5 | 6 | After that you will need to do whats listed in the "Vim Setup" section to have 7 | the vim plugins properly installed 8 | 9 | Our boxen configuration does this for us so I don't have a script to do it for 10 | you right now. 11 | 12 | Vim Setup (optional) 13 | ========== 14 | 15 | To get powerline working with the arrow-like fonts you will need to install 16 | a patched font from the powerline fonts repo on github. Then set up your 17 | terminal profile to use this font 18 | 19 | TMUX 20 | ----------------------------- 21 | Prefix Key: Ctrl-A 22 | 23 | Make your own customizations 24 | ---------------------------- 25 | 26 | Put your customizations in dotfiles appended with `.local`: 27 | 28 | * `~/.aliases.local` 29 | * `~/.gitconfig.local` 30 | * `~/.tmux.conf.local` 31 | * `~/.vimrc.local` 32 | * `~/.vimrc.bundles.local` 33 | * `~/.zshrc.local` 34 | 35 | Credits 36 | ---------------------------- 37 | 38 | @jakecraige, @MatthewHager 39 | 40 | Lots borrowed from Thoughtbot's Dotfiles(https://github.com/thoughtbot/dotfiles) 41 | 42 | This is truely a compilation of lots of resources around the net into compiled 43 | together. If you find something you wrote within here let us know and we'll give 44 | you credit. 45 | 46 | License 47 | --------------------------- 48 | MIT 49 | 50 | -------------------------------------------------------------------------------- /vimrc.bundles: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | filetype off 3 | 4 | set rtp+=~/.poetic_dotfiles/vim/bundle/Vundle.vim/ 5 | call vundle#begin() 6 | 7 | " let Vundle manage Vundle 8 | " required! 9 | Plugin 'gmarik/Vundle.vim' 10 | 11 | " tpope yay!: 12 | Plugin 'tpope/vim-fugitive' 13 | Plugin 'tpope/vim-endwise' 14 | Plugin 'vim-ruby/vim-ruby' 15 | Plugin 'mustache/vim-mustache-handlebars' 16 | Plugin 'tpope/vim-rails' 17 | Plugin 'tpope/vim-sensible' 18 | Plugin 'tpope/vim-surround' 19 | Plugin 'tpope/vim-unimpaired' 20 | Plugin 'tpope/vim-haml' 21 | 22 | Plugin 'digitaltoad/vim-jade' 23 | Plugin 'slim-template/vim-slim' 24 | 25 | " Rails Testing 26 | Plugin 'tpope/vim-cucumber' 27 | Plugin 'thoughtbot/vim-rspec' 28 | 29 | " Tmux Rails Testing 30 | Plugin 'jgdavey/vim-turbux' 31 | Plugin 'benmills/vimux' 32 | 33 | Plugin 'christoomey/vim-tmux-navigator' 34 | 35 | Plugin 'junegunn/seoul256.vim' 36 | Plugin 'jakecraige/vim-colors' 37 | Plugin 'thingsinjars/Cobalt.vim' 38 | Plugin 'altercation/vim-colors-solarized' 39 | Plugin 'sjl/badwolf' 40 | Plugin 'vim-scripts/xoria256.vim' 41 | Plugin 'dhruvasagar/vim-railscasts-theme' 42 | Plugin 'baskerville/bubblegum' 43 | 44 | Plugin 'mileszs/ack.vim' 45 | Plugin 'rking/ag.vim' 46 | Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 47 | Plugin 'kien/ctrlp.vim' 48 | Plugin 'godlygeek/tabular' 49 | " webapi required for gists 50 | Plugin 'mattn/webapi-vim' 51 | Plugin 'mattn/gist-vim' 52 | Plugin 'othree/javascript-libraries-syntax.vim' 53 | Plugin 'scrooloose/nerdcommenter' 54 | Plugin 'scrooloose/nerdtree' 55 | Plugin 'scrooloose/syntastic' 56 | Plugin 'spf13/PIV' 57 | Plugin 'groenewege/vim-less' 58 | 59 | " for snipmate 60 | Plugin 'MarcWeber/vim-addon-mw-utils' 61 | Plugin 'tomtom/tlib_vim' 62 | Plugin 'garbas/vim-snipmate' 63 | Plugin 'ervandew/supertab' 64 | Plugin 'honza/vim-snippets' 65 | 66 | Plugin 'majutsushi/tagbar' 67 | Plugin 'Raimondi/delimitMate' 68 | Plugin 'kchmck/vim-coffee-script' 69 | Plugin 'hail2u/vim-css3-syntax' 70 | Plugin 'pangloss/vim-javascript' 71 | Plugin 'duff/vim-scratch' 72 | Plugin 'rodjek/vim-puppet' 73 | Plugin 'mustache/vim-mode' 74 | 75 | " Dash 76 | Plugin 'rizzatti/funcoo.vim' 77 | Plugin 'rizzatti/dash.vim' 78 | 79 | Plugin 'bling/vim-airline' 80 | 81 | Plugin 'sjl/gundo.vim' 82 | 83 | Plugin 'dockyard/vim-easydir' 84 | 85 | Plugin 'editorconfig/editorconfig-vim' 86 | 87 | 88 | if filereadable(expand("~/.vimrc.bundles.local")) 89 | source ~/.vimrc.bundles.local 90 | endif 91 | 92 | call vundle#end() 93 | 94 | filetype on 95 | -------------------------------------------------------------------------------- /tmux.conf: -------------------------------------------------------------------------------- 1 | set -g prefix C-a 2 | # use ctrl-a ctrl-a to output ctrl-a in terminal 3 | bind-key C-a send-prefix 4 | unbind % 5 | bind \ split-window -h -c "#{pane_current_path}" 6 | bind - split-window -v -c "#{pane_current_path}" 7 | bind c new-window -c "#{pane_current_path}" 8 | 9 | # smart pane switching with awareness of vim splits 10 | bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-h) || tmux select-pane -L" 11 | bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-j) || tmux select-pane -D" 12 | bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-k) || tmux select-pane -U" 13 | bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys C-l) || tmux select-pane -R" 14 | bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)g?(view|n?vim?)(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l" 15 | 16 | # Resize Panes with Prefix-arrow keys 17 | unbind Right 18 | bind Right resize-pane -R 8 19 | unbind Left 20 | bind Left resize-pane -L 8 21 | unbind Down 22 | bind Down resize-pane -D 4 23 | unbind Up 24 | bind Up resize-pane -U 4 25 | 26 | # no need to index windows at 0 27 | set -g base-index 1 28 | set-window-option -g pane-base-index 1 29 | 30 | # renumber windows when closing them 31 | set -g renumber-windows on 32 | 33 | # Set window notifications 34 | setw -g monitor-activity on 35 | set -g visual-activity on 36 | 37 | # Fix powerline color issue (https://github.com/Lokaltog/powerline/issues/901) 38 | set -g status-style fg=colour231,bg=colour234 39 | 40 | # make vim shift bindings work 41 | set-window-option -g xterm-keys on 42 | 43 | # switch to last pane 44 | bind-key C-a last-pane 45 | 46 | setw -g mode-keys vi 47 | bind-key -t vi-copy v begin-selection 48 | 49 | set-environment -gu RBENV_VERSION 50 | 51 | if-shell "[ -f ~/.poetic_dotfiles/powerline/powerline/bindings/tmux/powerline.conf ]" 'source ~/.poetic_dotfiles/powerline/powerline/bindings/tmux/powerline.conf' 52 | if-shell "[ -f ~/.tmux.conf.local ]" 'source ~/.tmux.conf.local' 53 | 54 | # List of plugins 55 | # Supports `github_username/repo` or full git URLs 56 | set -g @tpm_plugins " \ 57 | tmux-plugins/tpm \ 58 | tmux-plugins/tmux-sensible \ 59 | tmux-plugins/tmux-open \ 60 | tmux-plugins/tmux-copycat \ 61 | tmux-plugins/tmux-resurrect \ 62 | tmux-plugins/tmux-yank \ 63 | " 64 | 65 | # initializes TMUX plugin manager 66 | run-shell ~/.poetic_dotfiles/tmux/plugins/tpm/tpm 67 | 68 | -------------------------------------------------------------------------------- /vim/ftplugin/html/sparkup.vim: -------------------------------------------------------------------------------- 1 | " Sparkup 2 | " Installation: 3 | " Copy the contents of vim/ftplugin/ to your ~/.vim/ftplugin directory. 4 | " 5 | " $ cp -R vim/ftplugin ~/.vim/ftplugin/ 6 | " 7 | " Configuration: 8 | " g:sparkup (Default: 'sparkup') - 9 | " Location of the sparkup executable. You shouldn't need to change this 10 | " setting if you used the install option above. 11 | " 12 | " g:sparkupArgs (Default: '--no-last-newline') - 13 | " Additional args passed to sparkup. 14 | " 15 | " g:sparkupExecuteMapping (Default: '') - 16 | " Mapping used to execute sparkup. 17 | " 18 | " g:sparkupNextMapping (Default: '') - 19 | " Mapping used to jump to the next empty tag/attribute. 20 | " 21 | " g:sparkupMaps (Default: 1) - 22 | " Setup mappings? 23 | " 24 | " g:sparkupMapsNormal (Default: 0) - 25 | " Setup mappings for normal mode? 26 | 27 | if !exists('g:sparkupExecuteMapping') 28 | let g:sparkupExecuteMapping = '' 29 | endif 30 | 31 | if !exists('g:sparkupNextMapping') 32 | let g:sparkupNextMapping = '' 33 | endif 34 | 35 | if !exists('g:sparkupMaps') 36 | let g:sparkupMaps = 1 37 | endif 38 | 39 | if !exists('g:sparkupMapsNormal') 40 | let g:sparkupMapsNormal = 0 41 | endif 42 | 43 | inoremap SparkupExecute u:call Sparkup() 44 | inoremap SparkupNext u:call SparkupNext() 45 | 46 | if g:sparkupMaps 47 | if ! hasmapto('SparkupExecute', 'i') 48 | exec 'imap ' . g:sparkupExecuteMapping . ' SparkupExecute' 49 | endif 50 | if ! hasmapto('SparkupNext', 'i') 51 | exec 'imap ' . g:sparkupNextMapping . ' SparkupNext' 52 | endif 53 | if g:sparkupMapsNormal 54 | if ! hasmapto('SparkupExecute', 'n') 55 | exec 'nnoremap ' . g:sparkupExecuteMapping . ' :call Sparkup()' 56 | endif 57 | if ! hasmapto('SparkupNext', 'n') 58 | exec 'nnoremap ' . g:sparkupNextMapping . ' :call SparkupNext()' 59 | endif 60 | endif 61 | endif 62 | 63 | if exists('*s:Sparkup') 64 | finish 65 | endif 66 | 67 | function! s:Sparkup() 68 | if !exists('s:sparkup') 69 | let s:sparkup = exists('g:sparkup') ? g:sparkup : 'sparkup' 70 | 71 | if !executable(s:sparkup) 72 | " If g:sparkup is not configured (and/or not found in $PATH), 73 | " look for sparkup.vim in Vim's runtimepath. 74 | " XXX: quite expensive for a Pathogen-like environment (where &rtp is huge) 75 | let paths = substitute(escape(&runtimepath, ' '), '\(,\|$\)', '/**\1', 'g') 76 | let s:sparkup = fnamemodify(findfile('sparkup.py', paths), ':p') 77 | 78 | if !filereadable(s:sparkup) 79 | echohl WarningMsg 80 | echom 'Warning: could not find sparkup/sparkup.py on your path or in your vim runtime path.' 81 | echohl None 82 | unlet s:sparkup 83 | return 84 | endif 85 | endif 86 | let s:sparkup = '"' . s:sparkup . '"' 87 | " Workaround for windows, where the Python file cannot be executed via shebang 88 | if has('win32') || has('win64') 89 | let s:sparkup = 'python ' . s:sparkup 90 | endif 91 | endif 92 | 93 | " Build arguments list (not cached, g:sparkupArgs might change, also 94 | " &filetype, &expandtab etc) 95 | let sparkupArgs = exists('g:sparkupArgs') ? g:sparkupArgs : '--no-last-newline' 96 | " Pass '--xml' option, if 'xml' is used as filetype (default: none/'html') 97 | " NOTE: &filetype can contain multiple values, e.g. 'smarty.html' 98 | if index(split(&filetype, '\.'), 'xml') >= 0 99 | let sparkupArgs .= ' --xml' 100 | endif 101 | " If the user's settings are to indent with tabs, do so! 102 | " TODO textmate version of this functionality 103 | if !&expandtab 104 | let sparkupArgs .= ' --indent-tabs' 105 | endif 106 | 107 | let sparkupCmd = s:sparkup . printf(' %s --indent-spaces=%s', sparkupArgs, &shiftwidth) 108 | exec '.!' . sparkupCmd 109 | call s:SparkupNext() 110 | endfunction 111 | 112 | function! s:SparkupNext() 113 | " 1: empty tag, 2: empty attribute, 3: empty line 114 | let n = search('><\/\|\(""\)\|^\s*$', 'Wp') 115 | if n == 3 116 | startinsert! 117 | else 118 | execute 'normal l' 119 | startinsert 120 | endif 121 | endfunction 122 | -------------------------------------------------------------------------------- /aliases: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------- 2 | # General 3 | # ------------------------------------------------------------------- 4 | 5 | alias c='clear' 6 | 7 | # ------------------------------------------------------------------- 8 | # Tmux 9 | # ------------------------------------------------------------------- 10 | alias tma="tmux attach -t" 11 | alias tmn="tmux new -s" 12 | alias tml="tmux ls" 13 | alias tmo="tmuxinator open" 14 | alias tms="tmuxinator start" 15 | 16 | # ------------------------------------------------------------------- 17 | # Ruby stuff 18 | # ------------------------------------------------------------------- 19 | alias rake="noglob rake" # necessary to make rake work inside of zsh 20 | alias be='bundle exec' 21 | alias rials='rails' 22 | alias raisl='rails' 23 | alias rs='rails s' 24 | alias rc='rails c' 25 | alias rdb='rake db:migrate db:test:prepare' 26 | 27 | # ------------------------------------------------------------------- 28 | # Heroku 29 | # ------------------------------------------------------------------- 30 | alias hrc='heroku run rails c' 31 | alias hrdb='heroku run rake db:migrate' 32 | alias hlogs='heroku logs --tail' 33 | 34 | # ------------------------------------------------------------------- 35 | # directory movement 36 | # ------------------------------------------------------------------- 37 | alias lh='ls -d .*' # show hidden files/directories only 38 | alias l='ls -al' 39 | alias ls='ls -GFh' # Colorize output, add file type indicator, and put sizes in human readable format 40 | alias ll='ls -GFhl' # Same as above, but in long listing format 41 | alias ~='cd ~' 42 | alias dot='cd ~/Development/dotfiles/' 43 | alias work='cd ~/Work/' 44 | alias dev='cd ~/Development/' 45 | 46 | # ------------------------------------------------------------------- 47 | # Mac only 48 | # ------------------------------------------------------------------- 49 | alias ql='qlmanage -p 2>/dev/null' # OS X Quick Look 50 | alias oo='open .' # open current directory in OS X Finder 51 | alias find_port='lsof -i ' # what is running on port, find_port :3000 52 | 53 | # ------------------------------------------------------------------- 54 | # database 55 | # ------------------------------------------------------------------ 56 | alias 'pgstart=pg_ctl -D /opt/boxen/data/postgresql/ -l logfile start' 57 | alias 'pgstop=pg_ctl -D /opt/boxen/data/postgresql/ stop' 58 | alias 'pgrestart=pg_ctl -D /opt/boxen/data/postgresql/ restart' 59 | # ex: pgrestore db_name file_name 60 | alias 'pgrestore=pg_restore --verbose --clean --no-acl --no-owner -h localhost -d' 61 | 62 | # Start elasticsearch 63 | alias esstart='elasticsearch -f -D es.config=/opt/boxen/homebrew/opt/elasticsearch/config/elasticsearch.yml' 64 | 65 | # ------------------------------------------------------------------- 66 | # Git 67 | # ------------------------------------------------------------------- 68 | # useful after you have deleted some files and didn't gitrm them. this will 69 | # stage them for you 70 | alias gitclean='git ls-files --deleted -z | xargs -0 git rm' 71 | alias ga='git add' 72 | alias gpush='git push' 73 | alias gpull='git pull' 74 | alias gl='git log' 75 | alias gpl="git log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" 76 | alias gs='git status' 77 | alias gd='git diff' 78 | alias gm='git commit -m' 79 | alias gma='git commit -am' 80 | alias gb='git branch' 81 | alias gc='git checkout' 82 | alias gcb='git checkout -b' 83 | alias gra='git remote add' 84 | alias grr='git remote rm' 85 | alias gcl='git clone' 86 | alias gta='git tag -a -m' 87 | alias gf='git reflog' 88 | alias gv='git log --pretty=format:'%s' | cut -d " " -f 1 | sort | uniq -c | sort -nr' 89 | # gituntrackdir directory_name 90 | alias gituntrackdir="git rm -r --cached " 91 | 92 | # ------------------------------------------------------------------- 93 | # Don't correct these commands! 94 | # ------------------------------------------------------------------- 95 | alias spring='nocorrect spring' 96 | alias ag='nocorrect ag' 97 | alias rspec='nocorrect rspec' 98 | 99 | # curiosities 100 | # gsh shows the number of commits for the current repos for all developers 101 | alias gsh="git shortlog | grep -E '^[ ]+\w+' | wc -l" 102 | 103 | # gu shows a list of all developers and the number of commits they've made 104 | alias gu="git shortlog | grep -E '^[^ ]'" 105 | 106 | # list out your computers local ip address 107 | alias myip="ifconfig | ack 'inet (\d+.*) netmask .* broadcast'" 108 | 109 | # Include custom aliases 110 | [[ -f ~/.aliases.local ]] && source ~/.aliases.local 111 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | "Jake Craige & Matthew Hager 2 | 3 | " Setup {{{ 4 | if filereadable(expand("~/.poetic_dotfiles/vimrc.bundles")) 5 | source ~/.poetic_dotfiles/vimrc.bundles 6 | endif 7 | 8 | filetype plugin indent on 9 | " }}} 10 | " Language Specific {{{ 11 | " keep you honest and without tabs 12 | autocmd BufWritePre * :retab 13 | " Javascript {{{ 14 | augroup ft_javascript 15 | au! 16 | au Filetype javascript setlocal foldmethod=syntax 17 | augroup END 18 | " }}} 19 | " Rails {{{ 20 | map rm :Rmodel 21 | map rc :Rcontroller 22 | map rv :Rview 23 | " }}} 24 | " Ruby {{{ 25 | augroup ft_ruby 26 | au! 27 | au Filetype ruby setlocal foldmethod=syntax 28 | augroup END 29 | " }}} 30 | " Vim {{{ 31 | augroup ft_vim 32 | au! 33 | 34 | au FileType vim setlocal foldmethod=marker 35 | au FileType help setlocal textwidth=78 36 | au BufWinEnter *.txt if &ft == 'help' | wincmd L | endif 37 | augroup END 38 | " }}} 39 | " }}} 40 | " General make life easy settings {{{ 41 | let mapleader = "," 42 | set clipboard=unnamed " Makes tmux c/p work 43 | set noesckeys 44 | set mouse=a 45 | set mousehide 46 | set nocompatible 47 | set autoindent 48 | set modelines=0 49 | set scrolljump=5 50 | set scrolloff=3 51 | set showmode 52 | set showcmd 53 | set hidden 54 | set wildmode=list:longest 55 | set visualbell 56 | set cursorline 57 | set cursorcolumn 58 | set ttyfast " fast scrolling... 59 | set list 60 | set relativenumber 61 | set number " show current line number at the left of current line 62 | set foldenable " enable code folding 63 | set virtualedit=onemore " Allow cursor beyondlast character 64 | set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids 65 | set colorcolumn=+1 66 | set linebreak 67 | set title 68 | set shiftround 69 | set splitbelow 70 | set splitright 71 | set undofile 72 | set undoreload=10000 73 | set history=1000 74 | set laststatus=2 75 | set matchtime=3 76 | 77 | command! Q q " Bind :Q to :q 78 | command! Qall qall 79 | 80 | " Disable Ex mode 81 | map Q 82 | 83 | " }}} 84 | " Make Life Easy Bindings {{{ 85 | 86 | " S in normal mode to split line, sister to J 87 | nnoremap S i 88 | 89 | " Post to gist and copy in clipboard 90 | vnoremap G :w !gist -p -t %:e \| pbcopy 91 | 92 | "For when you forget to sudo.. Really Write the file. 93 | cmap w!! w !sudo tee % >/dev/null 94 | 95 | "Adjust viewports to the same size 96 | map = = 97 | 98 | "Rehighlight pasted text 99 | nnoremap v V`] 100 | 101 | "Save a keystroke 102 | nnoremap ; : 103 | 104 | "Bind jj to ESC for quicker switching modes 105 | inoremap jj 106 | 107 | "0 now goes to first char in line instead of blank" 108 | nnoremap 0 0^ 109 | 110 | "Hit f2 to go into pastemode 111 | :set pastetoggle= 112 | 113 | " }}} 114 | " Folding {{{ 115 | set foldlevelstart=20 116 | autocmd Syntax * normal zR 117 | 118 | " Space to toggle folds. 119 | nnoremap za 120 | vnoremap za 121 | 122 | " Make zO recursively open whatever top level fold we're in, no matter where the 123 | " cursor happens to be. 124 | nnoremap zO zCzO 125 | 126 | function! MyFoldText() " 127 | let line = getline(v:foldstart) 128 | 129 | let nucolwidth = &fdc + &number * &numberwidth 130 | let windowwidth = winwidth(0) - nucolwidth - 3 131 | let foldedlinecount = v:foldend - v:foldstart 132 | 133 | " expand tabs into spaces 134 | let onetab = strpart(' ', 0, &tabstop) 135 | let line = substitute(line, '\t', onetab, 'g') 136 | 137 | let line = strpart(line, 0, windowwidth - 2 -len(foldedlinecount)) 138 | let fillcharcount = windowwidth - len(line) - len(foldedlinecount) 139 | return line . '…' . repeat(" ",fillcharcount) . foldedlinecount . '…' . ' ' 140 | endfunction " 141 | set foldtext=MyFoldText() 142 | 143 | " }}} 144 | " Colorscheme, Gui, Font {{{ 145 | 146 | "Status line with fugitive git integration 147 | set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P 148 | 149 | "Setup solarized theme as default vim theme 150 | let g:solarized_termtrans = 1 151 | syntax enable 152 | colorscheme solarized 153 | set background=dark 154 | 155 | if has('gui_running') 156 | " removes scrollbar and toolbar" 157 | set guioptions+=lrb 158 | set guioptions-=lrb " Remove the toolbar 159 | set guioptions-=T 160 | set lines=40 " 40 lines of text instead of 24 161 | else 162 | set t_Co=256 163 | set term=screen-256color 164 | endif 165 | 166 | " Font , Text, Tabs {{{ 167 | 168 | " Auto format comment blocks 169 | set comments=sl:/*,mb:*,elx:*/ 170 | 171 | set guifont=Inconsolata\ 13 172 | "Set tabs to 2 spaces instead of the default 4 173 | set tabstop=2 174 | set shiftwidth=2 175 | set softtabstop=2 176 | set expandtab 177 | "Text wrapping 178 | set wrap 179 | set textwidth=80 180 | set formatoptions=qrn1 181 | set colorcolumn=+1 182 | 183 | " }}} 184 | 185 | " }}} 186 | " Quick Edit Common Files {{{ 187 | 188 | nnoremap ev :e ~/.vimrc.local 189 | nnoremap ez :e ~/.zshrc.local 190 | 191 | " }}} 192 | " File Editing {{{ 193 | 194 | " Edit another file in the same directory as the current file 195 | " uses expression to extract path from current file's path 196 | map e :e =expand("%:p:h") . '/' 197 | map s :split =expand("%:p:h") . '/' 198 | map v :vnew =expand("%:p:h") . '/' 199 | map :Scratch 200 | 201 | " RENAME CURRENT FILE (thanks Gary Bernhardt) 202 | function! RenameFile() 203 | let old_name = expand('%') 204 | let new_name = input('New file name: ', expand('%'), 'file') 205 | if new_name != '' && new_name != old_name 206 | exec ':saveas ' . new_name 207 | exec ':silent !rm ' . old_name 208 | redraw! 209 | endif 210 | endfunction 211 | map n :call RenameFile() 212 | 213 | " Make sure Vim returns to the same line when you reopen a file. 214 | " Thanks, Amit 215 | augroup line_return 216 | au! 217 | au BufReadPost * 218 | \ if line("'\"") > 0 && line("'\"") <= line("$") | 219 | \ execute 'normal! g`"zvzz' | 220 | \ endif 221 | augroup END 222 | " }}} 223 | " Navigation {{{ 224 | 225 | " Change Working Directory to that of the current file 226 | cmap cwd lcd %:p:h 227 | cmap cd. lcd %:p:h 228 | 229 | "Visual shifting (does not exit Visual mode on tab) 230 | vnoremap < >gv 232 | 233 | "Movement - better Navigation 234 | nnoremap j gj 235 | nnoremap k gk 236 | nnoremap k gk 237 | 238 | "Split Window Navigation mapping 239 | nnoremap w vl 240 | nnoremap h 241 | nnoremap j 242 | nnoremap k 243 | nnoremap l 244 | 245 | "Split window size mapping 246 | nnoremap :resize +5 247 | nnoremap :resize -5 248 | nnoremap :vertical resize -5 249 | nnoremap :vertical resize +5 250 | 251 | " This if is to make these bindings work inside tmux 252 | if &term =~ '^screen' 253 | " tmux will send xterm-style keys when its xterm-keys option is on 254 | execute "set =\e[1;*A" 255 | execute "set =\e[1;*B" 256 | execute "set =\e[1;*C" 257 | execute "set =\e[1;*D" 258 | endif 259 | 260 | " }}} 261 | " Searching {{{ 262 | 263 | "Fix broken searching by enabling regular regex I think? 264 | nnoremap / /\v 265 | vnoremap / /\v 266 | set ignorecase 267 | set smartcase 268 | set gdefault " assume the /g flag on :s substitutions to replace all matches in a line 269 | set hlsearch 270 | 271 | " highlighted in visual mode, any in normal 272 | nnoremap s :%s//gc 273 | nnoremap sa :%s//g 274 | vnoremap s "hy:%s/h//gc 275 | vnoremap sa "hy:%s/h//g 276 | 277 | "Undo highlignted searches 278 | nnoremap :noh 279 | 280 | " Keep search matches in the middle of the window. 281 | nnoremap n nzzzv 282 | nnoremap N Nzzzv 283 | 284 | " Same when jumping around 285 | nnoremap g; g;zz 286 | nnoremap g, g,zz 287 | nnoremap zz 288 | 289 | " Don't move on * 290 | nnoremap * * 291 | 292 | " Visual Mode */# from Scrooloose 293 | " Lets you use * in visual mode 294 | 295 | function! s:VSetSearch() 296 | let temp = @@ 297 | norm! gvy 298 | let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g') 299 | let @@ = temp 300 | endfunction 301 | 302 | vnoremap * :call VSetSearch()// 303 | vnoremap # :call VSetSearch()?? 304 | 305 | " }}} 306 | " Git Setup {{{ 307 | 308 | map gac :Gcommit -m -a "" 309 | map gc :Gcommit -m "" 310 | map gs :Gstatus 311 | map gw :!git add . && git commit -m 'WIP' && git push 312 | 313 | " }}} 314 | " duplicate selected content {{{ 315 | 316 | map d y'>p 317 | 318 | " }}} 319 | " Backups {{{ 320 | 321 | set backup " enable backups 322 | set noswapfile " it's 2013, Vim. 323 | 324 | set undodir=~/.vim/tmp/undo// " undo files 325 | set backupdir=~/.vim/tmp/backup// " backups 326 | set directory=~/.vim/tmp/swap// " swap files 327 | 328 | " Make those folders automatically if they don't already exist. 329 | if !isdirectory(expand(&undodir)) 330 | call mkdir(expand(&undodir), "p") 331 | endif 332 | if !isdirectory(expand(&backupdir)) 333 | call mkdir(expand(&backupdir), "p") 334 | endif 335 | if !isdirectory(expand(&directory)) 336 | call mkdir(expand(&directory), "p") 337 | endif 338 | 339 | " }}} 340 | " Plugins {{{ 341 | " CtrlP {{{ 342 | set wildignore+=*/.git/*,*/.hg/*,*/.svn/* 343 | 344 | let g:ctrlp_custom_ignore = '\v[\/](\.(git|hg|svn))|(node_modules|dist|tmp|platforms)$' 345 | " }}} 346 | " NERDTree {{{ 347 | map :NERDTreeToggle 348 | let NERDTreeHighlightCursorline = 1 349 | let NERDTreeIgnore = ['.vim$', '\~$', '.*\.pyc$', 'pip-log\.txt$', 'whoosh_index', 350 | \ 'xapian_index', '.*.pid', 'monitor.py', '.*-fixtures-.*.json', 351 | \ '.*\.o$', 'db.db', 'tags.bak', '.*\.pdf$', '.*\.mid$', 352 | \ '.*\.midi$'] 353 | 354 | let NERDTreeMinimalUI = 1 355 | let NERDTreeDirArrows = 1 356 | let NERDChristmasTree = 1 357 | let NERDTreeChDirMode = 2 358 | let NERDTreeMapJumpFirstChild = 'gK' 359 | " }}} 360 | " Sparkup {{{ 361 | 362 | let g:sparkupExecuteMapping = 'h' 363 | 364 | " }}} 365 | " Tabular {{{ 366 | nmap a= :Tabularize /= 367 | vmap a= :Tabularize /= 368 | nmap a: :Tabularize /:\zs 369 | vmap a: :Tabularize /:\zs 370 | nmap a> :Tabularize /=> 371 | vmap a> :Tabularize /=> 372 | nmap a\ :Tabularize /\| 373 | vmap a\ :Tabularize /\| 374 | " }}} 375 | " Ag {{{ 376 | let g:agprg="ag --column --smart-case --ignore tmp --ignore node_modules --ignore cordova --ignore dist --ignore vendor --ignore bower_components --ignore log --ignore coverage" 377 | " }}} 378 | " TagBar {{{ 379 | nmap tt :TagbarToggle 380 | let g:tagbar_ctags_bin = '/opt/boxen/homebrew/bin/ctags' 381 | let g:tagbar_type_markdown = { 382 | \ 'ctagstype' : 'markdown', 383 | \ 'kinds' : [ 384 | \ 'h:Heading_L1', 385 | \ 'i:Heading_L2', 386 | \ 'k:Heading_L3' 387 | \ ] 388 | \ } 389 | 390 | let g:tagbar_type_puppet = { 391 | \ 'ctagstype': 'puppet', 392 | \ 'kinds': [ 393 | \'c:class', 394 | \'s:site', 395 | \'n:node', 396 | \'d:definition' 397 | \] 398 | \} 399 | 400 | let g:tagbar_type_ruby = { 401 | \ 'kinds' : [ 402 | \ 'm:modules', 403 | \ 'c:classes', 404 | \ 'd:describes', 405 | \ 'C:contexts', 406 | \ 'f:methods', 407 | \ 'F:singleton methods' 408 | \ ] 409 | \ } 410 | 411 | let g:tagbar_type_coffee = { 412 | \ 'ctagstype' : 'coffee', 413 | \ 'kinds' : [ 414 | \ 'c:classes', 415 | \ 'm:methods', 416 | \ 'f:functions', 417 | \ 'v:variables', 418 | \ 'f:fields', 419 | \ ] 420 | \ } 421 | 422 | " Posix regular expressions for matching interesting items. Since this will 423 | " be passed as an environment variable, no whitespace can exist in the options 424 | " so [:space:] is used instead of normal whitespaces. 425 | " Adapted from: https://gist.github.com/2901844 426 | let s:ctags_opts = ' 427 | \ --langdef=coffee 428 | \ --langmap=coffee:.coffee 429 | \ --regex-coffee=/(^|=[ \t])*class ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+)( extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/ 430 | \ --regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?(([A-Za-z][A-Za-z0-9_.]*)+):.*[-=]>.*$/\3/m,method/ 431 | \ --regex-coffee=/^[ \t]*(module\.)?(exports\.)?(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=.*[-=]>.*$/\3/f,function/ 432 | \ --regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/v,variable/ 433 | \ --regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/f,field/ 434 | \ --regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,static field/ 435 | \ --regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,field/ 436 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?/\3/f,field/ 437 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){0}/\8/f,field/ 438 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){1}/\8/f,field/ 439 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){2}/\8/f,field/ 440 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){3}/\8/f,field/ 441 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){4}/\8/f,field/ 442 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){5}/\8/f,field/ 443 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){6}/\8/f,field/ 444 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){7}/\8/f,field/ 445 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){8}/\8/f,field/ 446 | \ --regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?(,[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?){9}/\8/f,field/' 447 | 448 | let $CTAGS = substitute(s:ctags_opts, '\v\([nst]\)', '\\', 'g') 449 | " }}} 450 | " Turbux {{{ 451 | " this line needed if not using zsh which auto does bundle exec 452 | "let g:turbux_command_prefix = 'bundle exec' 453 | let g:no_turbux_mappings = 1 454 | map m SendTestToTmux 455 | map M SendFocusedTestToTmux 456 | let g:turbux_command_prefix = 'bundle exec spring' " default: (empty) 457 | " }}} 458 | " Rails.vim {{{ 459 | " Add support for cucumber, activemodelserializers, and decorators 460 | let g:rails_projections = { 461 | \ "config/projections.json": { 462 | \ "command": "projections" 463 | \ }, 464 | \ "spec/features/*_spec.rb": { 465 | \ "command": "feature", 466 | \ "template": "require 'spec_helper'\n\nfeature '%h' do\n\nend", 467 | \ }} 468 | 469 | let g:rails_gem_projections = { 470 | \ "active_model_serializers": { 471 | \ "app/serializers/*_serializer.rb": { 472 | \ "command": "serializer", 473 | \ "affinity": "model", 474 | \ "test": "spec/serializers/%s_spec.rb", 475 | \ "related": "app/models/%s.rb", 476 | \ "template": "class %SSerializer < ActiveModel::Serializer\nend" 477 | \ } 478 | \ }, 479 | \ "draper": { 480 | \ "app/decorators/*_decorator.rb": { 481 | \ "command": "decorator", 482 | \ "affinity": "model", 483 | \ "test": "spec/decorators/%s_spec.rb", 484 | \ "related": "app/models/%s.rb", 485 | \ "template": "class %SDecorator < Draper::Decorator\nend" 486 | \ } 487 | \ }, 488 | \ "factory_girl_rails": { 489 | \ "spec/factories.rb": { 490 | \ "command": "factories", 491 | \ "template": "FactoryGirl.define do\nend" 492 | \ } 493 | \ }} 494 | " }}} 495 | " Ag {{{ 496 | nmap a :Ag 497 | 498 | " }}} 499 | " Syntastic {{{ 500 | let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-", " mzggg?G`z 512 | 513 | " Trim whitespace on save 514 | function! StripTrailingWhitespaces() 515 | " Preparation: save last search, and cursor position. 516 | let _s=@/ 517 | let l = line(".") 518 | let c = col(".") 519 | " Do the business: 520 | %s/\s\+$//e 521 | " Clean up: restore previous search history, and cursor position 522 | let @/=_s 523 | call cursor(l, c) 524 | endfunction 525 | 526 | autocmd BufWritePre *.py,*.js,*.rb,Gemfile,*.haml,*.erb :call StripTrailingWhitespaces() 527 | 528 | 529 | " Minify airline status bar 530 | let g:airline_section_a = airline#section#create(['mode']) 531 | let g:airline_section_y = airline#section#create(['%L']) 532 | let g:airline_section_y = airline#section#create(['%p', '%% of ', '%L']) 533 | " preserve filename when possilbe even when the width of the current 534 | " buffer is short 535 | let g:airline#extensions#default#section_truncate_width = { 'x': 30, 'y': 30 } 536 | " remove less used functions, preservs: 537 | " mode, file at left 538 | " type, line count of file at right 539 | " warning and color 540 | let g:airline#extensions#default#layout = [ 541 | \ ['a', 'c'], 542 | \ ['x', 'y', 'warning'] 543 | \ ] 544 | " use initial to represent current mode 545 | let g:airline_mode_map = { 546 | \ '__' : '-', 547 | \ 'n' : 'N', 548 | \ 'i' : 'I', 549 | \ 'R' : 'R', 550 | \ 'c' : 'C', 551 | \ 'v' : 'V', 552 | \ 'V' : 'V', 553 | \ '' : 'V', 554 | \ 's' : 'S', 555 | \ 'S' : 'S', 556 | \ '' : 'S', 557 | \ } 558 | " do not use deliminator 559 | let g:airline_left_sep='' 560 | let g:airline_right_sep='' 561 | " }}} 562 | 563 | " Local config 564 | if filereadable($HOME . "/.vimrc.local") 565 | source ~/.vimrc.local 566 | endif 567 | " 568 | --------------------------------------------------------------------------------