├── .gitignore ├── .gitmodules ├── LICENSE ├── README.md ├── ackrc ├── after └── plugin │ └── edit_plus.vim ├── bin ├── install ├── update └── update_ctags ├── gvimrc ├── init ├── ack.vim ├── autocorrect.vim ├── colorscheme.vim ├── commands.vim ├── ctags.vim ├── ctrlp.vim ├── cucumber.vim ├── fugitive.vim ├── golang.vim ├── gundo.vim ├── insert_mode_background_color.vim ├── keybindings.vim ├── language.vim ├── local_make_let.vim ├── matchit.vim ├── nerd_commenter.vim ├── omnicompletion.vim ├── options.vim ├── run_tests.vim ├── supertab.vim ├── surround.vim ├── syntastic.vim ├── tabline.vim ├── tmux.vim ├── vim-blockle.vim ├── vim-ruby-config.vim └── yankring.vim ├── snippets └── javascript.snippets ├── syntax └── css.vim └── vimrc /.gitignore: -------------------------------------------------------------------------------- 1 | .netrwhist 2 | doc/tags 3 | .vimlog 4 | bundle/* 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "bundle/vundle"] 2 | path = bundle/vundle 3 | url = https://github.com/gmarik/vundle.git 4 | ignore = dirty 5 | branch = master 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Case Commons, LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Pivotal vim-config has moved 2 | 3 | It is now located at [https://github.com/pivotal/vim-config](https://github.com/pivotal/vim-config). 4 | 5 | ## Upgrading 6 | 7 | If you have an existing installation of this vim-config, you can automatically migrate by running the `update` script twice. 8 | 9 | ``` 10 | $ ~/.vim/bin/update 11 | $ ~/.vim/bin/update 12 | ``` 13 | 14 | Alternatively, you can completely delete `~/.vim` and reinstall the new vim-config from scratch by following its [installation instructions](https://github.com/pivotal/vim-config#to-install). -------------------------------------------------------------------------------- /ackrc: -------------------------------------------------------------------------------- 1 | --type-set=handlebars=.handlebars 2 | --type-set=haml=.haml,.hamlc 3 | --type-set=scss=.scss,.sass 4 | --type-set=js=.coffee,.js 5 | 6 | --ignore-dir=tmp 7 | --ignore-dir=public 8 | -------------------------------------------------------------------------------- /after/plugin/edit_plus.vim: -------------------------------------------------------------------------------- 1 | " Disable override of standard "e" command 2 | silent! una e 3 | -------------------------------------------------------------------------------- /bin/install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd ~/.vim 3 | [[ -h "$HOME/.vimrc" ]] || ln -s ~/.vim/vimrc ~/.vimrc 4 | vim +qall 5 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd ~/.vim 3 | if (git remote get-url origin | grep pivotalcommon); 4 | then 5 | git remote set-url origin https://github.com/pivotal/vim-config.git 6 | git fetch origin 7 | git checkout master 8 | git reset --hard origin/master 9 | ~/.vim/bin/update 10 | else 11 | git pull 12 | vim +PluginInstall! +qall 13 | fi -------------------------------------------------------------------------------- /bin/update_ctags: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [[ -f Gemfile.lock ]]; then 3 | ctags -R --exclude=.git . `bundle list --paths` 4 | else 5 | ctags -R --exclude=.git . 6 | fi 7 | -------------------------------------------------------------------------------- /gvimrc: -------------------------------------------------------------------------------- 1 | silent! source ~/.gvimrc.local 2 | 3 | " vim:ft=vim: 4 | -------------------------------------------------------------------------------- /init/ack.vim: -------------------------------------------------------------------------------- 1 | " Find current word in command mode 2 | function! AckGrep() 3 | let command = "ack ".expand("") 4 | cexpr system(command) 5 | cw 6 | endfunction 7 | 8 | function! AckVisual() 9 | normal gv"xy 10 | let command = "ack ".@x 11 | cexpr system(command) 12 | cw 13 | endfunction 14 | -------------------------------------------------------------------------------- /init/autocorrect.vim: -------------------------------------------------------------------------------- 1 | ab conection connection 2 | ab modifed modified 3 | ab postresql postgresql 4 | ab recieve receive 5 | ab safty safety 6 | ab teh the 7 | -------------------------------------------------------------------------------- /init/colorscheme.vim: -------------------------------------------------------------------------------- 1 | set t_Co=256 2 | set background=dark 3 | silent! colorscheme Tomorrow-Night 4 | silent! let g:airline_theme='tomorrow' 5 | 6 | " Feel free to override the colorscheme by adding a line to ~/.vimrc.local 7 | " such as the following: 8 | " 9 | " colorscheme solarized 10 | " let g:airline_theme='solarized' 11 | -------------------------------------------------------------------------------- /init/commands.vim: -------------------------------------------------------------------------------- 1 | command CC CoffeeCompile vert 2 | -------------------------------------------------------------------------------- /init/ctags.vim: -------------------------------------------------------------------------------- 1 | set tags+=gems.tags 2 | -------------------------------------------------------------------------------- /init/ctrlp.vim: -------------------------------------------------------------------------------- 1 | let g:ctrlp_map = 'f' 2 | 3 | " https://github.com/kien/ctrlp.vim/issues/174 4 | let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard'] 5 | -------------------------------------------------------------------------------- /init/cucumber.vim: -------------------------------------------------------------------------------- 1 | " Find unused Cucumber steps 2 | command! CucumberFindUnusedSteps :call CucumberFindUnusedSteps() 3 | function! CucumberFindUnusedSteps() 4 | let olderrorformat = &l:errorformat 5 | try 6 | set errorformat=%m#\ %f:%l 7 | cexpr system('bundle exec cucumber --no-profile --no-color --format usage --dry-run features \| grep "NOT MATCHED BY ANY STEPS" -B1 \| egrep -v "(--\|NOT MATCHED BY ANY STEPS)"') 8 | cwindow 9 | finally 10 | let &l:errorformat = olderrorformat 11 | endtry 12 | endfunction 13 | -------------------------------------------------------------------------------- /init/fugitive.vim: -------------------------------------------------------------------------------- 1 | " Automatically delete Fugitive buffers that are no longer being used. 2 | " Otherwise, they tend to fill up the buffer list. 3 | " 4 | " Credit to Drew Neil of Vimcasts: 5 | " http://vimcasts.org/episodes/fugitive-vim-browsing-the-git-object-database/ 6 | 7 | autocmd BufReadPost fugitive://* set bufhidden=delete 8 | 9 | " Unset 'list' in :Gstatus window (which usually contains tab characters). 10 | autocmd BufReadPost .git/index set nolist 11 | -------------------------------------------------------------------------------- /init/golang.vim: -------------------------------------------------------------------------------- 1 | autocmd FileType go set noexpandtab 2 | autocmd FileType go set nolist 3 | -------------------------------------------------------------------------------- /init/gundo.vim: -------------------------------------------------------------------------------- 1 | " Automatically close the Gundo windows when reverting. 2 | let g:gundo_close_on_revert = 1 3 | -------------------------------------------------------------------------------- /init/insert_mode_background_color.vim: -------------------------------------------------------------------------------- 1 | " Change background color when inserting. 2 | " (Broken in terminal Vim: Solarized has a bug which makes it reload poorly.) 3 | " http://www.reddit.com/r/vim/comments/ggbcp/solarized_color_scheme/ 4 | if has("gui_running") 5 | " Commented out to support vim-powerline 6 | " let g:insert_mode_background_color = "#18434E" 7 | end 8 | -------------------------------------------------------------------------------- /init/keybindings.vim: -------------------------------------------------------------------------------- 1 | " Keybindings 2 | " ----------- 3 | 4 | let mapleader = "," 5 | let maplocalleader = ";" 6 | 7 | " Gracefully handle holding shift too long after : for common commands 8 | cabbrev W w 9 | cabbrev Q q 10 | cabbrev Wq wq 11 | cabbrev Tabe tabe 12 | cabbrev Tabc tabc 13 | 14 | "set pastetoggle keybinding 15 | set pastetoggle= 16 | 17 | " Make Y consistent with D and C 18 | map Y y$ 19 | 20 | " Search 21 | nmap s :%s/ 22 | vmap s :s/ 23 | 24 | " Split screen 25 | map v :vsp 26 | 27 | " Move between screens 28 | map w ^Ww 29 | map = ^W= 30 | map j ^Wj 31 | map k ^Wk 32 | nmap j 33 | nmap k 34 | nmap h 35 | nmap l 36 | 37 | " Open .vimrc file in new tab. Think Command + , [Preferences...] but with Shift. 38 | map :tabedit ~/.vimrc 39 | 40 | " Reload .vimrc 41 | map rv :source ~/.vimrc 42 | 43 | " Undo/redo - Doesn't MacVim already have this? 44 | map :earlier 1 45 | map :later 1 46 | 47 | " Auto-indent whole file 48 | nmap = gg=G`` 49 | map gg=G`` :delmarks z:echo "Reformatted." 50 | 51 | " Jump to a new line in insert mode 52 | imap o 53 | 54 | " Fast scrolling 55 | nnoremap 3 56 | nnoremap 3 57 | 58 | " File tree browser 59 | map \ :NERDTreeToggle 60 | 61 | " File tree browser showing current file - pipe (shift-backslash) 62 | map \| :NERDTreeFind 63 | 64 | " Previous/next quickfix file listings (e.g. search results) 65 | map :cn 66 | map :cp 67 | 68 | " Open and close the quickfix window 69 | map qo :copen 70 | map qc :cclose 71 | 72 | " Previous/next buffers 73 | map :bp 74 | map :bn 75 | 76 | "indent/unindent visual mode selection with tab/shift+tab 77 | vmap >gv 78 | vmap rt :!~/.vim/bin/update_ctags 2>/dev/null & 81 | 82 | " Git blame 83 | map g :Gblame 84 | 85 | " Comment/uncomment lines 86 | map / NERDCommenterToggle 87 | map NERDCommenterToggle 88 | imap NERDCommenterToggle i 89 | 90 | " In command-line mode, should go to the front of the line, as in bash. 91 | cmap 92 | 93 | " Copy current file path to system pasteboard 94 | map :let @* = expand("%"):echo "Copied: ".expand("%") 95 | map C :let @* = expand("%").":".line("."):echo "Copied: ".expand("%").":".line(".") 96 | 97 | " Run tests 98 | map t :wa:RunTestLine 99 | map T :wa:RunTest 100 | map tt :wa:RunTestAgain 101 | 102 | map :write:RunTest 103 | imap 104 | map :write:RunTestLine 105 | imap 106 | map :write:RunTestAgain 107 | imap 108 | map :write:RunTestPrevious 109 | imap 110 | 111 | " Disable middle mouse button, F1 112 | map 113 | imap 114 | map 115 | imap 116 | 117 | " Easy access to the shell 118 | map :! 119 | 120 | " AckGrep current word 121 | map a :call AckGrep() 122 | " AckVisual current selection 123 | vmap a :call AckVisual() 124 | 125 | " Recalculate diff when it gets messed up. 126 | nmap du :diffupdate 127 | 128 | " Gundo.vim 129 | map u :GundoToggle 130 | 131 | " ctrlp 132 | " f is the default trigger (set in init/ctrlp.vim) 133 | nnoremap F :CtrlPClearAllCaches:CtrlPCurWD 134 | 135 | " Additional mapping for buffer search 136 | nnoremap bb :CtrlPBuffer 137 | map :CtrlPBuffer 138 | 139 | " Map most recently used 140 | nnoremap :CtrlPMRU 141 | 142 | " Cmd-Shift-P to clear the cache 143 | nnoremap :ClearCtrlPCache 144 | 145 | " Idea from : http://www.charlietanksley.net/blog/blog/2011/10/18/vim-navigation-with-lustyexplorer-and-lustyjuggler/ 146 | " Open CtrlP starting from a particular path, making it much 147 | " more likely to find the correct thing first. mnemonic 'jump to [something]' 148 | map jm :CtrlP app/models 149 | map jc :CtrlP app/controllers 150 | map jv :CtrlP app/views 151 | map jh :CtrlP app/helpers 152 | map jl :CtrlP lib 153 | map jp :CtrlP public 154 | map js :CtrlP spec 155 | map jf :CtrlP fast_spec 156 | map jd :CtrlP db 157 | map jC :CtrlP config 158 | map jV :CtrlP vendor 159 | map jF :CtrlP factories 160 | map jT :CtrlP test 161 | 162 | "Cmd-Shift-(M)ethod - jump to a method (tag in current file) 163 | "Ctrl-m is not good - it overrides behavior of Enter 164 | nnoremap :CtrlPBufTag 165 | 166 | " Mappings inherited from FuzzyFinder 167 | map :CtrlPCurWD 168 | map n :CtrlPCurWD 169 | map :CtrlPCurWD 170 | 171 | " Write all 172 | map WriteAll :silent! wall 173 | 174 | " Press Space to turn off highlighting and clear any message already 175 | " displayed. 176 | nnoremap :nohlsearch:echo"" 177 | 178 | " Tagbar 179 | nmap l :TagbarToggle 180 | 181 | " Cmd-Shift-F searches the whole project (like in TextMate, RubyMine, etc.) 182 | map :Ag 183 | 184 | " YankRing show registers 185 | :nnoremap :YRShow 186 | 187 | " Convert a word to to let(:word) { double(:word) } 188 | nmap ld LocalMakelet 189 | 190 | nmap rp :RainbowParenthesesToggle 191 | 192 | " Convert simple_bdd steps into methods 193 | nnoremap bdd :SimpleBDD 194 | vnoremap bdd :SimpleBDD 195 | -------------------------------------------------------------------------------- /init/language.vim: -------------------------------------------------------------------------------- 1 | " Whitespace & highlighting & language-specific config 2 | " ---------------------------------------------------- 3 | 4 | " Strip trailing whitespace for code files on save 5 | function! StripTrailingWhitespace() 6 | let save_cursor = getpos(".") 7 | %s/\s\+$//e 8 | call setpos('.', save_cursor) 9 | endfunction 10 | 11 | " C family 12 | autocmd BufWritePre *.m,*.h,*.c,*.mm,*.cpp,*.hpp call StripTrailingWhitespace() 13 | 14 | " Ruby, Rails 15 | autocmd BufWritePre *.rb,*.yml,*.js,*.css,*.less,*.sass,*.scss,*.html,*.xml,*.erb,*.haml,*.feature call StripTrailingWhitespace() 16 | 17 | " Java, PHP 18 | autocmd BufWritePre *.java,*.php call StripTrailingWhitespace() 19 | 20 | " Haml 21 | au BufRead,BufNewFile *.hamlc set ft=haml 22 | 23 | " JavaScript, ECMAScript 24 | au BufRead,BufNewFile *.es6 set ft=javascript 25 | 26 | " Highlight Ruby files 27 | au BufRead,BufNewFile *.thor set filetype=ruby 28 | au BufRead,BufNewFile *.god set filetype=ruby 29 | au BufRead,BufNewFile Gemfile* set filetype=ruby 30 | au BufRead,BufNewFile Vagrantfile set filetype=ruby 31 | au BufRead,BufNewFile soloistrc set filetype=ruby 32 | 33 | " Highlight Jasmine fixture files as HTML 34 | autocmd BufRead,BufNewFile *.jasmine_fixture set filetype=html 35 | 36 | " Insert ' => ' 37 | autocmd FileType ruby imap => 38 | 39 | " Open all folds in Markdown. 40 | autocmd FileType mkd normal zR 41 | -------------------------------------------------------------------------------- /init/local_make_let.vim: -------------------------------------------------------------------------------- 1 | " Convert a word to to let(:word) { double(:word) } 2 | nmap LocalMakelet yiwIlet(:A) { double(:pa) }hh 3 | \:call repeat#set("\LocalMakelet") 4 | -------------------------------------------------------------------------------- /init/matchit.vim: -------------------------------------------------------------------------------- 1 | runtime macros/matchit.vim 2 | -------------------------------------------------------------------------------- /init/nerd_commenter.vim: -------------------------------------------------------------------------------- 1 | " Pad comment delimeters with spaces 2 | let NERDSpaceDelims = 1 3 | -------------------------------------------------------------------------------- /init/omnicompletion.vim: -------------------------------------------------------------------------------- 1 | autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS 2 | autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags 3 | autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS 4 | autocmd FileType python setlocal omnifunc=pythoncomplete#Complete 5 | autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags 6 | 7 | let g:rubycomplete_buffer_loading = 1 8 | let g:rubycomplete_rails = 1 9 | let g:rubycomplete_classes_in_global = 1 10 | autocmd Filetype ruby setlocal omnifunc=rubycomplete#Complete 11 | 12 | if has("autocmd") && exists("+omnifunc") 13 | autocmd Filetype * 14 | \ if &omnifunc == "" | 15 | \ setlocal omnifunc=syntaxcomplete#Complete | 16 | \ endif 17 | endif 18 | -------------------------------------------------------------------------------- /init/options.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | set guifont=Menlo:h14 4 | set guioptions-=T " Remove GUI toolbar 5 | set guioptions-=e " Use text tab bar, not GUI 6 | set guioptions-=rL " Remove scrollbars 7 | set guicursor=a:blinkon0 " Turn off the blinking cursor 8 | set visualbell " Suppress audio/visual error bell 9 | 10 | set notimeout " No command timeout 11 | set ttimeout " Add back a timeout for terminal vim 12 | set ttimeoutlen=100 " Keep the timeout very short 13 | 14 | set showcmd " Show typed command prefixes while waiting for operator 15 | set mouse=a " Use mouse support in XTerm/iTerm. 16 | 17 | set expandtab " Use soft tabs 18 | set tabstop=2 " Tab settings 19 | set autoindent 20 | set smarttab " Use shiftwidth to tab at line beginning 21 | set shiftwidth=2 " Width of autoindent 22 | set number " Line numbers 23 | set nowrap " No wrapping 24 | set backspace=indent,eol,start " Let backspace work over anything. 25 | set wildignore+=tags " Ignore tags when globbing. 26 | set wildignore+=tmp/** " ...Also tmp files. 27 | set wildignore+=public/uploads/** " ...Also uploads. 28 | set wildignore+=public/images/** " ...Also images. 29 | set wildignore+=vendor/** " ...Also vendor. 30 | 31 | set list " Show whitespace 32 | set listchars=trail:· 33 | 34 | set showmatch " Show matching brackets 35 | set hidden " Allow hidden, unsaved buffers 36 | set splitright " Add new windows towards the right 37 | set splitbelow " ... and bottom 38 | set wildmode=list:longest " Bash-like tab completion 39 | set scrolloff=3 " Scroll when the cursor is 3 lines from edge 40 | 41 | set laststatus=2 " Always show statusline 42 | 43 | set incsearch " Incremental search 44 | set history=1024 " History size 45 | set smartcase " Smart case-sensitivity when searching (overrides ignorecase) 46 | 47 | set autoread " No prompt for file changes outside Vim 48 | 49 | set swapfile " Keep swapfiles 50 | set directory=~/.vim-tmp,~/tmp,/var/tmp,/tmp 51 | set backupdir=~/.vim-tmp,~/tmp,/var/tmp,/tmp 52 | 53 | set hls " search with highlights by default 54 | 55 | " Write all writeable buffers when changing buffers or losing focus. 56 | set autowriteall " Save when doing various buffer-switching things. 57 | autocmd BufLeave,FocusLost * silent! wall " Save anytime we leave a buffer or MacVim loses focus. 58 | 59 | let g:sql_type_default="postgresql" 60 | 61 | " Turn off ri tooltips that don't work with Ruby 1.9 yet 62 | " http://code.google.com/p/macvim/issues/detail?id=342 63 | if has("gui_running") 64 | set noballooneval 65 | endif 66 | -------------------------------------------------------------------------------- /init/run_tests.vim: -------------------------------------------------------------------------------- 1 | " Run a test tool with the current file and line number 2 | " The test tool is run in the last Terminal window 3 | function! RunTestTool(tool_cmd) 4 | let dir = system('pwd') 5 | let applescript = "osascript -e '".'tell application "Terminal"' 6 | let applescript .= "\n" 7 | let applescript .= 'do script "cd '.dir.'" in last window' 8 | let applescript .= "\n" 9 | let applescript .= 'do script "'.a:tool_cmd.'" in last window' 10 | let applescript .= "\n" 11 | let applescript .= 'end tell'."'" 12 | let foo = system(applescript) 13 | endfunction 14 | 15 | " If the file ends with _spec.rb, RunTestTool with rspec 16 | " If the file ends with .feature, RunTestTool with cuke 17 | command! RunFocusedTest :call RunFocusedTest() 18 | function! RunFocusedTest() 19 | let spec_command = system('if [ x != "x"$(which spec) ] ; then echo -n spec ; elif [ x != "x"$(which rspec) ] ; then echo -n rspec ; fi') 20 | let filename = expand("%") 21 | if filename =~ '_spec\.rb$' 22 | call RunTestTool("be ".spec_command." ".expand("%").":".line(".")) 23 | endif 24 | if filename =~ '\.feature$' 25 | call RunTestTool("cuke ".expand("%").":".line(".")) 26 | endif 27 | endfunction 28 | 29 | command! RunTests :call RunTests() 30 | function! RunTests() 31 | let spec_command = system('if [ x != "x"$(which spec) ] ; then echo -n spec ; elif [ x != "x"$(which rspec) ] ; then echo -n rspec ; fi') 32 | let filename = expand("%") 33 | if filename =~ '_spec\.rb$' 34 | call RunTestTool("be ".spec_command." ".expand("%")) 35 | endif 36 | if filename =~ '\.feature$' 37 | call RunTestTool("cuke ".expand("%")) 38 | endif 39 | endfunction 40 | -------------------------------------------------------------------------------- /init/supertab.vim: -------------------------------------------------------------------------------- 1 | " Pick completion type based on context 2 | let g:SuperTabDefaultCompletionType = "context" 3 | 4 | " Default completion type is user (aka completefunc) 5 | let g:SuperTabContextDefaultCompletionType = "" 6 | 7 | " Always define completefunc based on omnifunc 8 | autocmd FileType * 9 | \ if &omnifunc != '' | 10 | \ call SuperTabChain(&omnifunc, "") | 11 | \ call SuperTabSetDefaultCompletionType("context") | 12 | \ endif 13 | -------------------------------------------------------------------------------- /init/surround.vim: -------------------------------------------------------------------------------- 1 | " surround.vim: Add $ as a jQuery surround, _ for Underscore.js 2 | autocmd FileType javascript let b:surround_36 = "$(\r)" 3 | \ | let b:surround_95 = "_(\r)" 4 | -------------------------------------------------------------------------------- /init/syntastic.vim: -------------------------------------------------------------------------------- 1 | let g:syntastic_enable_signs=1 2 | autocmd FileType javascript let b:syntastic_checkers = findfile('.eslintrc', '.;') != '' ? ['eslint'] : (findfile('.jscsrc', '.;') != '' ? ['jscs'] : ['jshint']) 3 | -------------------------------------------------------------------------------- /init/tabline.vim: -------------------------------------------------------------------------------- 1 | " Rename tabs to show tab number. 2 | " (Based on http://stackoverflow.com/questions/5927952/whats-implementation-of-vims-default-tabline-function) 3 | if exists("+showtabline") 4 | function! MyTabLine() 5 | let s = '' 6 | let wn = '' 7 | let t = tabpagenr() 8 | let i = 1 9 | while i <= tabpagenr('$') 10 | let buflist = tabpagebuflist(i) 11 | let winnr = tabpagewinnr(i) 12 | let s .= '%' . i . 'T' 13 | let s .= (i == t ? '%1*' : '%2*') 14 | let s .= ' ' 15 | let wn = tabpagewinnr(i,'$') 16 | 17 | let s .= '%#TabNum#' 18 | let s .= i 19 | " let s .= '%*' 20 | let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#') 21 | let bufnr = buflist[winnr - 1] 22 | let file = bufname(bufnr) 23 | let buftype = getbufvar(bufnr, 'buftype') 24 | if buftype == 'nofile' 25 | if file =~ '\/.' 26 | let file = substitute(file, '.*\/\ze.', '', '') 27 | endif 28 | else 29 | let file = fnamemodify(file, ':p:t') 30 | endif 31 | if file == '' 32 | let file = '[No Name]' 33 | endif 34 | let s .= ' ' . file . ' ' 35 | let i = i + 1 36 | endwhile 37 | let s .= '%T%#TabLineFill#%=' 38 | let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X') 39 | return s 40 | endfunction 41 | set stal=2 42 | set tabline=%!MyTabLine() 43 | set showtabline=1 44 | highlight link TabNum Special 45 | endif 46 | -------------------------------------------------------------------------------- /init/tmux.vim: -------------------------------------------------------------------------------- 1 | " Add tmux's higher F-key capabilities 2 | if &term == "screen-256color" 3 | set t_F3=[25~ 4 | set t_F4=[26~ 5 | set t_F5=[28~ 6 | set t_F6=[29~ 7 | set t_F7=[31~ 8 | set t_F8=[32~ 9 | set t_F9=[33~ 10 | endif 11 | -------------------------------------------------------------------------------- /init/vim-blockle.vim: -------------------------------------------------------------------------------- 1 | let g:blockle_mapping = 'B' 2 | -------------------------------------------------------------------------------- /init/vim-ruby-config.vim: -------------------------------------------------------------------------------- 1 | " Turn on syntax highlighting for ruby operators (==, ||, &&, etc) 2 | let ruby_operators=1 3 | -------------------------------------------------------------------------------- /init/yankring.vim: -------------------------------------------------------------------------------- 1 | let g:yankring_replace_n_pkey = '' 2 | let g:yankring_replace_n_nkey = '' 3 | let g:yankring_history_file = '.vim_yankring_history' 4 | 5 | 6 | -------------------------------------------------------------------------------- /snippets/javascript.snippets: -------------------------------------------------------------------------------- 1 | snippet it 2 | it("${1}", function() { 3 | ${2} 4 | }); 5 | snippet desc 6 | describe("${1}", function() { 7 | ${2} 8 | }); 9 | snippet con 10 | context("${1}", function() { 11 | ${2} 12 | }); 13 | snippet bef 14 | beforeEach(function() { 15 | ${1} 16 | }); 17 | -------------------------------------------------------------------------------- /syntax/css.vim: -------------------------------------------------------------------------------- 1 | syn match cssColorProp contained "\" 2 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | echom "The Pivotal vim-config has moved. Please run ~/.vim/bin/update to automatically migrate." 2 | 3 | " ---------- 4 | " Vim Config 5 | " ---------- 6 | " 7 | " 8 | " How this works: 9 | " 10 | " This file is minimal. Most of the vim settings and initialization is in 11 | " several files in .vim/init. This makes it easier to find things and to 12 | " merge between branches and repos. 13 | " 14 | " Please do not add configuration to this file, unless it *really* needs to 15 | " come first or last, like Vundle and sourcing the machine-local config. 16 | " Instead, add it to one of the files in .vim/init, or create a new one. 17 | 18 | set nocompatible " be iMproved 19 | filetype off " required! 20 | 21 | " Based on http://erikzaadi.com/2012/03/19/auto-installing-vundle-from-your-vimrc/ 22 | let need_to_install_plugins=0 23 | if empty(system("grep lazy_load ~/.vim/bundle/vundle/autoload/vundle.vim")) 24 | echo "Installing Vundle..." 25 | echo "" 26 | silent !mkdir -p ~/.vim/bundle 27 | silent !rm -rf ~/.vim/bundle/vundle 28 | silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle 29 | let need_to_install_plugins=1 30 | endif 31 | set rtp+=~/.vim/bundle/vundle/ 32 | call vundle#begin() 33 | 34 | Plugin 'gmarik/vundle' 35 | 36 | " 37 | " Colorschemes 38 | " 39 | Plugin 'tpope/vim-vividchalk' 40 | Plugin 'chriskempson/base16-vim' 41 | Plugin 'molokai' 42 | Plugin 'altercation/vim-colors-solarized' 43 | Plugin 'wgibbs/vim-irblack' 44 | Plugin 'chriskempson/vim-tomorrow-theme' 45 | Plugin 'candycode.vim' 46 | Plugin 'Color-Sampler-Pack' 47 | Plugin 'flazz/vim-colorschemes' 48 | 49 | " 50 | " Ruby / Rails 51 | " 52 | Plugin 'tpope/vim-rails' 53 | Plugin 'tpope/vim-endwise' 54 | Plugin 'ecomba/vim-ruby-refactoring' 55 | Plugin 'nelstrom/vim-textobj-rubyblock' 56 | Plugin 'jgdavey/vim-blockle' 57 | Plugin 'tpope/vim-rbenv' 58 | Plugin 'tpope/vim-rake' 59 | 60 | " 61 | " General Editing 62 | " 63 | Plugin 'tpope/vim-repeat' 64 | Plugin 'tpope/vim-surround' 65 | Plugin 'scrooloose/nerdcommenter' 66 | Plugin 'kana/vim-textobj-user' 67 | Plugin 'Julian/vim-textobj-variable-segment' 68 | Plugin 'kana/vim-textobj-line' 69 | Plugin 'thinca/vim-textobj-between' 70 | Plugin 'tpope/vim-unimpaired' 71 | Plugin 'sjl/gundo.vim' 72 | Plugin 'godlygeek/tabular' 73 | Plugin 'scrooloose/syntastic' 74 | Plugin 'bling/vim-airline' 75 | Plugin 'ervandew/supertab' 76 | Plugin 'mgamba/j-split' 77 | Plugin 'matt-royal/diffthese' 78 | Plugin 'camelcasemotion' 79 | Plugin 'mgamba/edit-plus' 80 | Plugin 'brysgo/quickfixfix' 81 | Plugin 'Lokaltog/vim-easymotion' 82 | Plugin 'regreplop.vim' 83 | Plugin 'Peeja/insert_mode_background_color' 84 | Plugin 'vim-scripts/L9' 85 | Plugin 'Peeja/vim-cdo' 86 | Plugin 'MarcWeber/vim-addon-mw-utils' 87 | Plugin 'tomtom/tlib_vim' 88 | Plugin 'garbas/vim-snipmate' 89 | Plugin 'honza/vim-snippets' 90 | Plugin 'YankRing.vim' 91 | Plugin 'terryma/vim-multiple-cursors' 92 | Plugin 'editorconfig/editorconfig-vim' 93 | Plugin 'tpope/vim-projectionist' 94 | Plugin 'kien/rainbow_parentheses.vim' 95 | 96 | " 97 | " Window Management 98 | " 99 | Plugin 'ZoomWin' 100 | 101 | " 102 | " Searching 103 | " 104 | Plugin 'mileszs/ack.vim' 105 | Plugin 'epmatsw/ag.vim' 106 | Plugin 'tpope/vim-abolish' 107 | Plugin 'henrik/vim-qargs' 108 | Plugin 'kien/ctrlp.vim' 109 | 110 | " 111 | " Navigation 112 | " 113 | Plugin 'scrooloose/nerdtree' 114 | Plugin 'majutsushi/tagbar' 115 | 116 | " 117 | " Languages 118 | " 119 | Plugin 'vim-ruby/vim-ruby' 120 | Plugin 'pangloss/vim-javascript' 121 | Plugin 'plasticboy/vim-markdown' 122 | Plugin 'slim-template/vim-slim' 123 | Plugin 'nono/vim-handlebars' 124 | Plugin 'kchmck/vim-coffee-script' 125 | Plugin 'tpope/vim-haml' 126 | Plugin 'tpope/vim-cucumber' 127 | Plugin 'quentindecock/vim-cucumber-align-pipes' 128 | Plugin 'juvenn/mustache.vim' 129 | Plugin 'fatih/vim-go' 130 | Plugin 'rosstimson/scala-vim-support' 131 | Plugin 'guns/vim-clojure-static' 132 | Plugin 'chrisbra/csv.vim' 133 | Plugin 'elzr/vim-json' 134 | Plugin 'briancollins/vim-jst' 135 | Plugin 'digitaltoad/vim-jade' 136 | Plugin 'mxw/vim-jsx' 137 | Plugin 'lambdatoast/elm.vim' 138 | 139 | " 140 | " Development Tool Integration 141 | " 142 | Plugin 'tpope/vim-fugitive' 143 | Plugin 'airblade/vim-gitgutter' 144 | Plugin 'pivotal/tmux-config' 145 | Plugin 'tpope/vim-dispatch' 146 | Plugin 'carlobaldassi/ConqueTerm' 147 | Plugin 'sjl/vitality.vim' 148 | Plugin 'brysgo/test_server' 149 | Plugin 'mdelillo/vim-simple-bdd' 150 | 151 | call vundle#end() 152 | filetype plugin indent on 153 | 154 | syntax on 155 | 156 | if need_to_install_plugins == 1 157 | echo "Installing plugins via Vundle. Please ignore warnings afterwards." 158 | echo "This is a one-time operation that will take about a minute..." 159 | silent! PluginInstall 160 | echo "Done installing Vundle plugins!" 161 | q 162 | endif 163 | 164 | runtime! init/**.vim 165 | 166 | if filereadable($HOME . "/.vimrc.local") 167 | source ~/.vimrc.local 168 | endif 169 | 170 | --------------------------------------------------------------------------------