├── .backup └── .gitignore ├── .tmp └── .gitignore ├── .undo └── .gitignore ├── .gitignore ├── screenshots ├── MacVim1.png ├── Windows1.png ├── MacVim1_small.png └── Windows1_small.png ├── after └── plugin │ ├── autoreadwatch.vim │ └── tabular_extra.vim ├── MyUltiSnips ├── eruby.snippets ├── ruby.snippets ├── coffee.snippets └── rails.snippets ├── ftplugin ├── stylus │ └── iskeyword.vim └── ruby │ └── iskeyword.vim ├── gvimrc ├── commands.vim ├── vimrc ├── LICENSE ├── scripts └── setup ├── platforms.vim ├── spell └── custom.en.utf-8.add ├── autocmds.vim ├── vundle.vim ├── Rakefile ├── config.vim ├── mappings.vim ├── functions.vim ├── README.md └── plugin_config.vim /.backup/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.tmp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.undo/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bundle 2 | /sessions 3 | .DS_Store 4 | 5 | /.netrwhist 6 | /spell/custom.en.utf-8.add.spl -------------------------------------------------------------------------------- /screenshots/MacVim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismccord/dot_vim/HEAD/screenshots/MacVim1.png -------------------------------------------------------------------------------- /screenshots/Windows1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismccord/dot_vim/HEAD/screenshots/Windows1.png -------------------------------------------------------------------------------- /screenshots/MacVim1_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismccord/dot_vim/HEAD/screenshots/MacVim1_small.png -------------------------------------------------------------------------------- /screenshots/Windows1_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chrismccord/dot_vim/HEAD/screenshots/Windows1_small.png -------------------------------------------------------------------------------- /after/plugin/autoreadwatch.vim: -------------------------------------------------------------------------------- 1 | " ----------------- 2 | " vim-autoreadwatch 3 | " ----------------- 4 | :silent! WatchForChangesAllFile 5 | -------------------------------------------------------------------------------- /MyUltiSnips/eruby.snippets: -------------------------------------------------------------------------------- 1 | snippet if "if" 2 | <% if ${1:condition} %> 3 | $0 4 | <% end %> 5 | endsnippet 6 | 7 | snippet ifelse "if / else" 8 | <% if ${1:condition} %> 9 | $0 10 | <% else %> 11 | <% end %> 12 | endsnippet 13 | -------------------------------------------------------------------------------- /MyUltiSnips/ruby.snippets: -------------------------------------------------------------------------------- 1 | snippet do "Create a do end block" 2 | do 3 | $0 4 | end 5 | endsnippet 6 | 7 | snippet doa "Create a do end block with an argument" 8 | do |${1:arg1}| 9 | $0 10 | end 11 | endsnippet 12 | 13 | snippet def "Create a method" 14 | def ${1:method_name}${2: ${3:*args}} 15 | ${0:# TODO} 16 | end 17 | endsnippet 18 | -------------------------------------------------------------------------------- /MyUltiSnips/coffee.snippets: -------------------------------------------------------------------------------- 1 | snippet property "Create a computed property" 2 | ${1:propertyName}: (-> 3 | $0 4 | ).property('${2:propertyName}') 5 | endsnippet 6 | 7 | snippet observes "Create an observer" 8 | observes${1:observerName}: (-> 9 | $0 10 | ).observes('${2:observerName}') 11 | endsnippet 12 | 13 | snippet get "This getter" 14 | @get('${1:propertyName}') 15 | endsnippet 16 | -------------------------------------------------------------------------------- /ftplugin/stylus/iskeyword.vim: -------------------------------------------------------------------------------- 1 | function! s:stylus_iskeyword() 2 | return &iskeyword . ",-,$" 3 | endfunction 4 | 5 | function! s:set_stylus_iskeyword(stylus_iskeyword) 6 | execute "setlocal iskeyword=" . a:stylus_iskeyword 7 | endfunction 8 | 9 | if exists("g:stylus_loaded_iskeyword") 10 | finish 11 | endif 12 | 13 | let g:stylus_loaded_iskeyword = 1 14 | autocmd FileType stylus call s:set_stylus_iskeyword(s:stylus_iskeyword()) 15 | -------------------------------------------------------------------------------- /gvimrc: -------------------------------------------------------------------------------- 1 | " Unmap these keys so they can be used for other mappings. 2 | if has('gui_macvim') 3 | " D-t 4 | macmenu &File.New\ Tab key= 5 | " D-p 6 | macmenu &File.Print key= 7 | 8 | " D-p 9 | macmenu Edit.Find.Find\.\.\. key= 10 | 11 | " D-b 12 | macmenu &Tools.Make key= 13 | " D-l 14 | macmenu &Tools.List\ Errors key= 15 | endif 16 | 17 | set visualbell " Keeps the audio bell from sounding in the GUI 18 | -------------------------------------------------------------------------------- /commands.vim: -------------------------------------------------------------------------------- 1 | " ---------------------------------------- 2 | " Commands 3 | " ---------------------------------------- 4 | 5 | " Silently execute an external command 6 | " No 'Press Any Key to Contiue BS' 7 | " from: http://vim.wikia.com/wiki/Avoiding_the_%22Hit_ENTER_to_continue%22_prompts 8 | command! -nargs=1 SilentCmd 9 | \ | execute ':silent !'. 10 | \ | execute ':redraw!' 11 | 12 | " Fixes common typos 13 | command! W w 14 | command! Q q 15 | " Restart Pow.cx for the Current App 16 | command! PowRestart :SilentCmd touch tmp/restart.txt; touch tmp/.livereload.rb 17 | -------------------------------------------------------------------------------- /ftplugin/ruby/iskeyword.vim: -------------------------------------------------------------------------------- 1 | " Additions for Ruby filetype 2 | " from http://git.io/vXX8fg 3 | function! s:ruby_iskeyword() 4 | " ? and ! are used in method name, like `nil?`, `save!` 5 | " $ used in global variable. 6 | return &iskeyword . ",?,!,$,=" 7 | endfunction 8 | 9 | function! s:set_ruby_iskeyword(ruby_iskeyword) 10 | execute "setlocal iskeyword=" . a:ruby_iskeyword 11 | endfunction 12 | 13 | if exists("g:loaded_iskeyword") 14 | finish 15 | endif 16 | 17 | let g:loaded_iskeyword = 1 18 | autocmd FileType ruby call s:set_ruby_iskeyword(s:ruby_iskeyword()) 19 | -------------------------------------------------------------------------------- /MyUltiSnips/rails.snippets: -------------------------------------------------------------------------------- 1 | snippet valp "validates presence (ruby 1.9)" 2 | validates :${1:attribute}, presence: true 3 | endsnippet 4 | 5 | snippet it "create it statement for rspec" 6 | it '${1:test}' do 7 | end 8 | endsnippet 9 | 10 | snippet add_column "add column in a migration" 11 | add_column :${1:table}, :${2:column}, :${3: :boolean, :datetime, :float, :integer, :string, :text, :time} 12 | endsnippet 13 | 14 | snippet describe "create describe and it statement for rspec" 15 | describe '${1:something}' do 16 | it '${2:test}' do 17 | $0 18 | end 19 | end 20 | endsnippet 21 | -------------------------------------------------------------------------------- /after/plugin/tabular_extra.vim: -------------------------------------------------------------------------------- 1 | if !exists(':Tabularize') 2 | finish " Give up here; the Tabular plugin musn't have been loaded 3 | endif 4 | 5 | " Make line wrapping possible by resetting the 'cpo' option, first saving it 6 | let s:save_cpo = &cpo 7 | set cpo&vim 8 | 9 | " Patterns from 10 | " http://git.io/tCXofg 11 | " http://vimcasts.org/episodes/aligning-text-with-tabular-vim/ 12 | AddTabularPattern hash /:\zs 13 | AddTabularPattern hash_rocket /=> 14 | AddTabularPattern json /: 15 | AddTabularPattern symbol /:/l1c0 16 | AddTabularPattern equals /= 17 | AddTabularPattern comma /,\zs 18 | 19 | " Restore the saved value of 'cpo' 20 | let &cpo = s:save_cpo 21 | unlet s:save_cpo 22 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | " =========================================== 2 | " Who: Jeremy Mack (@mutewinter) 3 | " What: .vimrc of champions 4 | " Version: 2.0 - Now individual config files! 5 | " =========================================== 6 | 7 | " All of the plugins are installed with Vundle from this file. 8 | source ~/.vim/vundle.vim 9 | 10 | " Automatically detect file types. (must turn on after Vundle) 11 | filetype plugin indent on 12 | 13 | " Platform (Windows, Mac, etc.) configuration. 14 | source ~/.vim/platforms.vim 15 | " All of the Vim configuration. 16 | source ~/.vim/config.vim 17 | " New commands 18 | source ~/.vim/commands.vim 19 | " All hotkeys, not dependant on plugins, are mapped here. 20 | source ~/.vim/mappings.vim 21 | " Plugin-specific configuration. 22 | source ~/.vim/plugin_config.vim 23 | " Small custom functions. 24 | source ~/.vim/functions.vim 25 | " Auto commands. 26 | source ~/.vim/autocmds.vim 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2013 Jeremy Mack 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the “Software”), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | 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 THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /scripts/setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # setup the Vim Configuration of Champions 4 | 5 | info () { 6 | printf " [ \033[00;34m..\033[0m ] $1\n" 7 | } 8 | 9 | success () { 10 | printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n" 11 | } 12 | 13 | fail () { 14 | printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n" 15 | echo '' 16 | exit 17 | } 18 | 19 | echo '' 20 | info 'Setting up the Vim Configuration of Champions' 21 | info '=============================================' 22 | echo '' 23 | 24 | info 'Installing Vundle' 25 | info '-----------------' 26 | git clone http://github.com/gmarik/vundle.git bundle/vundle 27 | 28 | info 'Setting up Symlinks' 29 | info '--------------' 30 | if test $(which rake) 31 | then 32 | rake vim:link 33 | else 34 | fail 'Install Ruby and Rake to continue' 35 | fi 36 | 37 | info 'Installing plugins and compiling custom spellings' 38 | info '-------------------------------------------------' 39 | if test $(which zmvim) 40 | then 41 | mvim -v "+mkspell ~/.vim/spell/custom.en.utf-8.add" +BundleInstall +qall 42 | else 43 | if test $(which vim) 44 | then 45 | vim "+mkspell ~/.vim/spell/custom.en.utf-8.add" +BundleInstall +qall 46 | else 47 | fail 'mvim or vim not found in path.' 48 | fi 49 | fi 50 | 51 | success 'Setup complete. Run vim and enjoy' 52 | -------------------------------------------------------------------------------- /platforms.vim: -------------------------------------------------------------------------------- 1 | " ---------------------------------------- 2 | " Platform Specific Configuration 3 | " ---------------------------------------- 4 | 5 | if has('win32') || has('win64') 6 | " Windows 7 | source $VIMRUNTIME/mswin.vim 8 | set guifont=Consolas:h10 9 | set guioptions-=T " Toolbar 10 | set guioptions-=m " Menubar 11 | 12 | " Set height and width on Windows 13 | set lines=60 14 | set columns=120 15 | 16 | " Disable quickfixsigns on Windows due to incredible slowdown. 17 | let g:loaded_quickfixsigns=1 18 | 19 | " Windows has a nasty habit of launching gVim in the wrong working directory 20 | cd ~ 21 | elseif has('gui_macvim') 22 | " MacVim 23 | 24 | " Custom Source Code font for Powerline 25 | " From: https://github.com/Lokaltog/powerline-fonts 26 | " set guifont=Source\ Code\ Pro\ for\ Powerline:h14 27 | set guifont=BitstreamVeraSansMono-Roman:h14 28 | 29 | if has("gui_running") 30 | set guioptions=egmrt " Hide Toolbar in MacVim 31 | set guioptions-=r " Hide scrollbar in MacVim 32 | endif 33 | 34 | " Use option (alt) as meta key. 35 | set macmeta 36 | endif 37 | 38 | if has('macunix') || has('mac') 39 | " Fix meta key for Mac 40 | let c='a' 41 | while c <= 'z' 42 | exec "set =\e".c 43 | exec "imap \e".c." " 44 | let c = nr2char(1+char2nr(c)) 45 | endw 46 | endif 47 | -------------------------------------------------------------------------------- /spell/custom.en.utf-8.add: -------------------------------------------------------------------------------- 1 | podcasting 2 | Reddit 3 | RSS 4 | app 5 | iPad 6 | GitHub 7 | IRC 8 | Showbot 9 | Mashboard 10 | Mashboard's 11 | jQuery 12 | plugin 13 | SVG 14 | API 15 | by5 16 | tv 17 | OmniFocus 18 | podcast 19 | Harr 20 | Serializers 21 | json 22 | js 23 | RailsConf 24 | JSConf 25 | railsconf 26 | www 27 | jsconf 28 | GIFs 29 | APIs 30 | CSS 31 | Mixins 32 | HTML5 33 | screencasts 34 | Peepcode 35 | iPads 36 | Grosenbach 37 | Grosenbach's 38 | Screenshots 39 | plugins 40 | readme 41 | ack 42 | MacVim 43 | Vundle 44 | vim's 45 | GitEgo 46 | vimrc 47 | gVim 48 | Minecraft 49 | malware 50 | Jotti's 51 | Bloks 52 | HD 53 | biomes 54 | YogCraft 55 | OptiFine 56 | Screenshot 57 | Modpack 58 | wiki 59 | Hubot 60 | iOS 61 | Sparkbox 62 | hipchat 63 | https 64 | HipChat 65 | Trello 66 | trello 67 | planscope 68 | UI 69 | Pinboard 70 | Workflow 71 | workflow 72 | nvAlt 73 | Delish 74 | Terpstra 75 | Pinbook 76 | Dropbox 77 | apps 78 | bookmarklet 79 | CloudApp 80 | URLs 81 | iTerm 82 | Pinboard's 83 | WriteRoom 84 | Dash's 85 | github 86 | blog 87 | Repos 88 | OAMM 89 | metadata 90 | Sprintly 91 | Readmes 92 | Railscasts 93 | Yongwei 94 | Yongwei's 95 | symlinks 96 | syntastic 97 | MultiMarkdown 98 | Powerline 99 | ActionType 100 | programmatically 101 | Angular's 102 | changelogs 103 | Testacular 104 | paypal 105 | cancelation 106 | io 107 | YouCompleteMe 108 | Cakefile 109 | css 110 | Tapas 111 | minification 112 | localhost 113 | scaffolt 114 | continiously 115 | tapas 116 | cx 117 | dev 118 | phantomjs 119 | ShowGap 120 | -------------------------------------------------------------------------------- /autocmds.vim: -------------------------------------------------------------------------------- 1 | " ---------------------------------------- 2 | " Auto Commands 3 | " ---------------------------------------- 4 | 5 | if has("autocmd") 6 | augroup MyAutoCommands 7 | " Clear the auto command group so we don't define it multiple times 8 | " Idea from http://learnvimscriptthehardway.stevelosh.com/chapters/14.html 9 | autocmd! 10 | " No formatting on o key newlines 11 | autocmd BufNewFile,BufEnter * set formatoptions-=o 12 | 13 | " No more complaining about untitled documents 14 | autocmd FocusLost silent! :wa 15 | 16 | " When editing a file, always jump to the last cursor position. 17 | " This must be after the uncompress commands. 18 | autocmd BufReadPost * 19 | \ if line("'\"") > 1 && line ("'\"") <= line("$") | 20 | \ exe "normal! g`\"" | 21 | \ endif 22 | 23 | " Fix trailing whitespace in my most used programming langauges 24 | autocmd BufWritePre *.ex,*.exs,*.py,*.coffee,*.rb,*.erb,*.md,*.scss,*.vim,Cakefile 25 | \ silent! :StripTrailingWhiteSpace 26 | 27 | " Help mode bindings 28 | " to follow tag, to go back, and q to quit. 29 | " From http://ctoomey.com/posts/an-incremental-approach-to-vim/ 30 | autocmd filetype help nnoremap 31 | autocmd filetype help nnoremap 32 | autocmd filetype help nnoremap q :q 33 | 34 | " Fix accidental indentation in html files 35 | " from http://morearty.com/blog/2013/01/22/fixing-vims-indenting-of-html-files.html 36 | autocmd FileType html setlocal indentkeys-=* 37 | 38 | " Leave the return key alone when in command line windows, since it's used 39 | " to run commands there. 40 | autocmd! CmdwinEnter * :unmap 41 | autocmd! CmdwinLeave * :call MapCR() 42 | augroup END 43 | endif 44 | -------------------------------------------------------------------------------- /vundle.vim: -------------------------------------------------------------------------------- 1 | " ---------------------------------------- 2 | " Vundle 3 | " ---------------------------------------- 4 | 5 | set nocompatible " be iMproved 6 | filetype off " required! 7 | 8 | set rtp+=~/.vim/bundle/Vundle.vim 9 | call vundle#begin() 10 | 11 | " let Vundle manage Vundle, required 12 | Plugin 'gmarik/vundle' 13 | 14 | " --------------- 15 | " Plugin Plugins 16 | " --------------- 17 | 18 | " Navigation 19 | Plugin 'ZoomWin' 20 | Plugin 'kien/ctrlp.vim' 21 | Plugin 'JazzCore/ctrlp-cmatcher' 22 | Plugin 'tacahiroy/ctrlp-funky' 23 | " UI Additions 24 | Plugin 'nathanaelkane/vim-indent-guides' 25 | Plugin 'bling/vim-airline' 26 | Plugin 'scrooloose/nerdtree' 27 | Plugin 'Rykka/colorv.vim' 28 | Plugin 'chrismccord/jellybeans.vim' 29 | Plugin 'luan/vim-hybrid' 30 | " Plugin 'mhinz/vim-signify' 31 | Plugin 'airblade/vim-gitgutter' 32 | " Plugin 'mhinz/vim-startify' 33 | Plugin 'mbbill/undotree' 34 | Plugin 'jszakmeister/vim-togglecursor' 35 | " Commands 36 | Plugin 'chrismccord/bclose.vim' 37 | Plugin 'tomtom/tcomment_vim' 38 | Plugin 'tpope/vim-surround' 39 | Plugin 'tpope/vim-fugitive' 40 | " Plugin 'godlygeek/tabular' 41 | Plugin 'rking/ag.vim' 42 | " Plugin 'milkypostman/vim-togglelist' 43 | " Plugin 'mutewinter/swap-parameters' 44 | Plugin 'tpope/vim-abolish' 45 | Plugin 'scratch.vim' 46 | " Plugin 'mattn/emmet-vim' 47 | " Plugin 'mutewinter/GIFL' 48 | " Plugin 'AndrewRadev/switch.vim' 49 | " Plugin 'tpope/vim-eunuch' 50 | " Plugin 'itspriddle/vim-marked' 51 | " Plugin 'mutewinter/UnconditionalPaste' 52 | " Plugin 'HelpClose' 53 | " Plugin 'mattn/gist-vim' 54 | " Plugin 'nelstrom/vim-visual-star-search' 55 | " Plugin 'sk1418/Join' 56 | " Plugin 'SirVer/ultisnips' 57 | " Plugin 'g3orge/vim-voogle' 58 | " Plugin 'benmills/vimux' 59 | " Plugin 'jgdavey/vim-turbux' 60 | " Plugin 'ecomba/vim-ruby-refactoring' 61 | " Plugin 'christoomey/vim-tmux-navigator' 62 | " Plugin 'dsawardekar/portkey' 63 | " Plugin 'dsawardekar/ember.vim' 64 | " Plugin 'rizzatti/dash.vim' 65 | Plugin 'terryma/vim-multiple-cursors' 66 | " Automatic Helpers 67 | " Plugin 'osyo-manga/vim-anzu' 68 | Plugin 'xolox/vim-session' 69 | Plugin 'Raimondi/delimitMate' 70 | " Plugin 'scrooloose/syntastic' 71 | Plugin 'ervandew/supertab' 72 | Plugin 'Valloric/MatchTagAlways' 73 | " Plugin 'Valloric/YouCompleteMe' 74 | Plugin 'kballenegger/vim-autoreadwatch' 75 | " Language Additions 76 | " Ruby 77 | Plugin 'vim-ruby/vim-ruby' 78 | Plugin 'tpope/vim-haml' 79 | Plugin 'tpope/vim-rails' 80 | Plugin 'tpope/vim-rake' 81 | Plugin 'tpope/vim-bundler' 82 | " Elixir 83 | Plugin 'elixir-lang/vim-elixir' 84 | " JavaScript 85 | Plugin 'pangloss/vim-javascript' 86 | Plugin 'kchmck/vim-coffee-script' 87 | Plugin 'leshill/vim-json' 88 | " HTML 89 | Plugin 'nono/vim-handlebars' 90 | Plugin 'othree/html5.vim' 91 | Plugin 'indenthtml.vim' 92 | " TomDoc 93 | Plugin 'mutewinter/tomdoc.vim' 94 | Plugin 'jc00ke/vim-tomdoc' 95 | " Other Languages 96 | Plugin 'msanders/cocoa.vim' 97 | Plugin 'mutewinter/taskpaper.vim' 98 | Plugin 'mutewinter/nginx.vim' 99 | Plugin 'timcharper/textile.vim' 100 | Plugin 'mutewinter/vim-css3-syntax' 101 | Plugin 'mutewinter/vim-tmux' 102 | Plugin 'plasticboy/vim-markdown' 103 | Plugin 'groenewege/vim-less' 104 | Plugin 'wavded/vim-stylus' 105 | Plugin 'tpope/vim-cucumber' 106 | Plugin 'chrisbra/csv.vim' 107 | " MatchIt 108 | Plugin 'matchit.zip' 109 | Plugin 'kana/vim-textobj-user' 110 | Plugin 'nelstrom/vim-textobj-rubyblock' 111 | " Libraries 112 | Plugin 'L9' 113 | " Plugin 'tpope/vim-repeat' 114 | Plugin 'mattn/webapi-vim' 115 | Plugin 'xolox/vim-misc' 116 | Plugin 'rizzatti/funcoo.vim' 117 | 118 | call vundle#end() " required 119 | filetype plugin indent on " required 120 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Rakefile 2 | # 3 | # Simple tasks for managing my .vim files 4 | 5 | require 'open-uri' 6 | require 'openssl' 7 | require 'rubygems' 8 | require 'json' 9 | 10 | 11 | PLUGIN_LIST_TAG = '## Plugin List' 12 | PLUGIN_LIST_NOTE = '_Note: Auto generated by `rake plugins:update_readme`_' 13 | README_FILE = 'README.md' 14 | 15 | FILES_TO_LINK = %w{vimrc gvimrc} 16 | 17 | task :default => ['vim:link'] 18 | 19 | namespace :vim do 20 | desc 'Create symlinks' 21 | task :link do 22 | begin 23 | FILES_TO_LINK.each do |file| 24 | dot_file = File.expand_path("~/.#{file}") 25 | if File.exists? dot_file 26 | puts "#{dot_file} already exists, skipping link." 27 | else 28 | File.symlink(".vim/#{file}", dot_file) 29 | puts "Created link for #{file} in your home folder." 30 | end 31 | end 32 | rescue NotImplementedError 33 | puts "File.symlink not supported, you must do it manually." 34 | if RUBY_PLATFORM.downcase =~ /(mingw|win)(32|64)/ 35 | puts 'Windows 7 use mklink, e.g.' 36 | puts ' mklink _vimrc .vim\vimrc' 37 | end 38 | end 39 | 40 | end 41 | end 42 | 43 | namespace :plugins do 44 | 45 | desc 'Update the list of plugins in README.md' 46 | task :update_readme do 47 | plugins = parse_plugins_from_vimrc 48 | delete_old_plugins_from_readme 49 | add_plugins_to_readme(plugins) 50 | end 51 | end 52 | 53 | 54 | # ---------------------------------------- 55 | # Helper Methods 56 | # ---------------------------------------- 57 | 58 | 59 | # Just takes an array of strings that resolve to plugins from Vundle 60 | def add_plugins_to_readme(plugins = []) 61 | lines = File.readlines(README_FILE).map{|l| l.chomp} 62 | index = lines.index(PLUGIN_LIST_TAG) 63 | unless index.nil? 64 | lines.insert(index+1, "\n#{PLUGIN_LIST_NOTE}\n\n") 65 | lines.insert(index+2, plugins.map{|p| " * [#{p[:name]}](#{p[:uri]}) - #{p[:description]}"}) 66 | lines << "\n_That's #{plugins.length} plugins, holy crap._" 67 | write_lines_to_readme(lines) 68 | else 69 | puts "Error: Plugin List Tag (#{PLUGIN_LIST_TAG}) not found" 70 | end 71 | 72 | end 73 | 74 | def delete_old_plugins_from_readme 75 | lines = [] 76 | File.readlines(README_FILE).map do |line| 77 | line.chomp! 78 | lines << line 79 | if line == PLUGIN_LIST_TAG 80 | break 81 | end 82 | end 83 | 84 | write_lines_to_readme(lines) 85 | end 86 | 87 | def write_lines_to_readme(lines) 88 | readme_file = File.open(README_FILE, 'w') 89 | readme_file << lines.join("\n") 90 | readme_file.close 91 | end 92 | 93 | # Returns an array of plugins denoted with Bundle 94 | def parse_plugins_from_vimrc 95 | plugins = [] 96 | File.new('vundle.vim').each do |line| 97 | if line =~ /^Bundle\s+["'](.+)["']/ 98 | plugins << convert_to_link_hash($1) 99 | end 100 | end 101 | 102 | plugins 103 | end 104 | 105 | # Converts a Vundle link to a URI 106 | def convert_to_link_hash(link) 107 | link_hash = {} 108 | 109 | if link =~ /([a-zA-Z0-9\-]*)\/([a-zA-Z0-9\-\._]*)/ 110 | user = $1 111 | name = $2 112 | link_hash[:user] = user 113 | link_hash[:name] = name 114 | link_hash[:uri] = "https://github.com/#{user}/#{name}" 115 | link_hash[:description] = fetch_github_repo_description(user, name) 116 | else 117 | name = link 118 | link_hash[:name] = name 119 | link_hash[:uri] = "https://github.com/vim-scripts/#{name}" 120 | link_hash[:description] = fetch_github_repo_description('vim-scripts', name) 121 | end 122 | 123 | link_hash 124 | end 125 | 126 | def fetch_github_repo_description(user, name) 127 | response = '' 128 | api_url = "https://api.github.com/repos/#{user}/#{name}" 129 | 130 | # Without a GitHub Client / Secret token you will only be able to make 60 131 | # requests per hour, meaning you can only update the readme once. 132 | # Read more here http://developer.github.com/v3/#rate-limiting. 133 | if ENV['GITHUB_CLIENT_ID'] and ENV['GITHUB_CLIENT_SECRET'] 134 | api_url += "?client_id=#{ENV['GITHUB_CLIENT_ID']}&client_secret=#{ENV['GITHUB_CLIENT_SECRET']}" 135 | end 136 | 137 | if RUBY_VERSION < '1.9' 138 | response = open(api_url).read 139 | else 140 | response = open(api_url, :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE).read 141 | end 142 | 143 | repo = JSON.parse response 144 | repo['description'].strip 145 | end 146 | -------------------------------------------------------------------------------- /config.vim: -------------------------------------------------------------------------------- 1 | " --------------------------------------------- 2 | " Regular Vim Configuration (No Plugins Needed) 3 | " --------------------------------------------- 4 | 5 | " --------------- 6 | " Color 7 | " --------------- 8 | set background=dark 9 | colorscheme jellybeans 10 | " Force 256 color mode if available 11 | if $TERM =~ "-256color" 12 | set t_Co=256 13 | endif 14 | 15 | " ----------------------------- 16 | " File Locations 17 | " ----------------------------- 18 | set backupdir=~/.vim/.backup 19 | set directory=~/.vim/.tmp 20 | set spellfile=~/.vim/spell/custom.en.utf-8.add 21 | " Persistent Undo 22 | if has('persistent_undo') 23 | set undofile 24 | set undodir=~/.vim/.undo 25 | endif 26 | 27 | " --------------- 28 | " UI 29 | " --------------- 30 | set ruler " Ruler on 31 | set number " Line numbers on 32 | set nowrap " Line wrapping off 33 | set laststatus=2 " Always show the statusline 34 | set cmdheight=1 " Make the command area one lines high 35 | set cursorline 36 | set encoding=utf-8 37 | set noshowmode " Don't show the mode since Powerline shows it 38 | set title " Set the title of the window in the terminal to the file 39 | if exists('+colorcolumn') 40 | set colorcolumn=80 " Color the 80th column differently as a wrapping guide. 41 | endif 42 | " Disable tooltips for hovering keywords in Vim 43 | if exists('+ballooneval') 44 | " This doesn't seem to stop tooltips for Ruby files 45 | set noballooneval 46 | " 100 second delay seems to be the only way to disable the tooltips 47 | set balloondelay=100000 48 | endif 49 | 50 | 51 | " --------------- 52 | " Behaviors 53 | " --------------- 54 | syntax enable 55 | set backup " Turn on backups 56 | set autoread " Automatically reload changes if detected 57 | set wildmenu " Turn on WiLd menu 58 | set hidden " Change buffer - without saving 59 | set history=768 " Number of things to remember in history. 60 | set cf " Enable error files & error jumping. 61 | set clipboard+=unnamed " Yanks go on clipboard instead. 62 | set autowrite " Writes on make/shell commands 63 | set timeoutlen=350 " Time to wait for a command (after leader for example). 64 | set nofoldenable " Disable folding entirely. 65 | set foldlevelstart=99 " I really don't like folds. 66 | set formatoptions=crql 67 | set iskeyword+=\$,- " Add extra characters that are valid parts of variables 68 | set nostartofline " Don't go to the start of the line after some commands 69 | set scrolloff=3 " Keep three lines below the last line when scrolling 70 | set gdefault " this makes search/replace global by default 71 | set switchbuf=useopen " Switch to an existing buffer if one exists 72 | 73 | " --------------- 74 | " Text Format 75 | " --------------- 76 | set tabstop=2 77 | set backspace=indent,eol,start " Delete everything with backspace 78 | set shiftwidth=2 " Tabs under smart indent 79 | set cindent 80 | set autoindent 81 | set smarttab 82 | set expandtab 83 | 84 | " --------------- 85 | " Searching 86 | " --------------- 87 | set ignorecase " Case insensitive search 88 | set smartcase " Non-case sensitive search 89 | set incsearch " Incremental search 90 | set hlsearch " Highlight search results 91 | set wildignore+=*.o,*.obj,*.exe,*.so,*.dll,*.pyc,.svn,.hg,.bzr,.git, 92 | \.sass-cache,*.class,*.scssc,*.cssc,sprockets%*,*.lessc 93 | 94 | " ctags optimization 95 | " set autochdir 96 | set tags=tags;/ 97 | 98 | " --------------- 99 | " Visual 100 | " --------------- 101 | set showmatch " Show matching brackets. 102 | set matchtime=2 " How many tenths of a second to blink 103 | " Show invisible characters 104 | set list 105 | 106 | " Show trailing spaces as dots and carrots for extended lines. 107 | " From Janus, http://git.io/PLbAlw 108 | 109 | " Reset the listchars 110 | set listchars="" 111 | " make tabs visible 112 | set listchars=tab:▸▸ 113 | " show trailing spaces as dots 114 | set listchars+=trail:. 115 | " The character to show in the last column when wrap is off and the line 116 | " continues beyond the right of the screen 117 | set listchars+=extends:> 118 | " The character to show in the last column when wrap is off and the line 119 | " continues beyond the right of the screen 120 | set listchars+=precedes:< 121 | 122 | " --------------- 123 | " Sounds 124 | " --------------- 125 | set noerrorbells 126 | set novisualbell 127 | set t_vb= 128 | 129 | " --------------- 130 | " Mouse 131 | " --------------- 132 | set mousehide " Hide mouse after chars typed 133 | set mouse=a " Mouse in all modes 134 | 135 | " Better complete options to speed it up 136 | set complete=.,w,b,u,U 137 | -------------------------------------------------------------------------------- /mappings.vim: -------------------------------------------------------------------------------- 1 | " ---------------------------------------- 2 | " Mappings 3 | " ---------------------------------------- 4 | 5 | " Set leader to , 6 | " Note: This line MUST come before any mappings 7 | let mapleader="," 8 | let maplocalleader = "\\" 9 | 10 | " --------------- 11 | " Regular Mappings 12 | " --------------- 13 | 14 | " Use ; for : in normal and visual mode, less keystrokes 15 | nnoremap ; : 16 | vnoremap ; : 17 | 18 | " Yank entire buffer with gy 19 | nnoremap gy :%y+ 20 | 21 | " Select entire buffer 22 | nnoremap vy ggVG 23 | 24 | " Make Y behave like other capital commands. 25 | " Hat-tip http://vimbits.com/bits/11 26 | nnoremap Y y$ 27 | 28 | " Just to beginning and end of lines easier. From http://vimbits.com/bits/16 29 | noremap H ^ 30 | noremap L $ 31 | 32 | " Create newlines without entering insert mode 33 | nnoremap go ok 34 | nnoremap gO Oj 35 | 36 | " remap U to for easier redo 37 | " from http://vimbits.com/bits/356 38 | nnoremap U 39 | 40 | " Swap implementations of ` and ' jump to markers 41 | " By default, ' jumps to the marked line, ` jumps to the marked line and 42 | " column, so swap them 43 | nnoremap ' ` 44 | nnoremap ` ' 45 | 46 | " --------------- 47 | " Window Movement 48 | " --------------- 49 | 50 | " Here's a visual guide for moving between window splits. 51 | " 4 Window Splits 52 | " -------- 53 | " g1 | g2 54 | " ---|---- 55 | " g3 | g4 56 | " ------- 57 | " 58 | " 6 Window Splits 59 | " ------------- 60 | " g1 | gt | g2 61 | " ---|----|---- 62 | " g3 | gb | g4 63 | " ------------- 64 | nnoremap gh :wincmd h 65 | nnoremap gj :wincmd j 66 | nnoremap gk :wincmd k 67 | nnoremap gl :wincmd l 68 | " Upper left window 69 | nnoremap g1 :wincmd t 70 | " Upper right window 71 | nnoremap g2 :wincmd b:wincmd k 72 | " Lower left window 73 | nnoremap g3 :wincmd t:wincmd j 74 | " Lower right window 75 | nnoremap g4 :wincmd b 76 | 77 | " Top Middle 78 | nnoremap gt g2:wincmd h 79 | " Bottom Middle 80 | nnoremap gb g3:wincmd l 81 | 82 | " Previous Window 83 | nnoremap gp :wincmd p 84 | " Equal Size Windows 85 | nnoremap g= :wincmd = 86 | " Swap Windows 87 | nnoremap gx :wincmd x 88 | 89 | " --------------- 90 | " Modifer Mappings 91 | " --------------- 92 | 93 | " Make line completion easier. 94 | inoremap 95 | 96 | " Easier Scrolling (think j/k with left hand) 97 | " All variations are mapped for now until I get used to one 98 | " C/M/D + d (page up) 99 | " C/M/D + f (page down) 100 | nnoremap 15gjzz 101 | nnoremap 15gkzz 102 | vnoremap 15gjzz 103 | vnoremap 15gkzz 104 | 105 | " --------------- 106 | " Insert Mode Mappings 107 | " --------------- 108 | 109 | " Let's make escape better, together. 110 | inoremap jk 111 | inoremap JK 112 | inoremap Jk 113 | inoremap jK 114 | 115 | " --------------- 116 | " Leader Mappings 117 | " --------------- 118 | 119 | " Clear search 120 | noremap / :nohls 121 | 122 | " Highlight search word under cursor without jumping to next 123 | nnoremap h * 124 | 125 | " Toggle spelling mode with ,s 126 | nnoremap s :set spell! 127 | 128 | " Begin to edit any file in .vim directory 129 | nnoremap v :e ~/.vim/ 130 | 131 | " Quickly switch to last buffer 132 | nnoremap , :e# 133 | 134 | " Underline the current line with '-' 135 | nnoremap ul :t.\|s/./-/\|:nohls 136 | 137 | " Underline the current line with '=' 138 | nnoremap uul :t.\|s/./=/\|:nohls 139 | 140 | " Surround the commented line with lines. 141 | " 142 | " Example: 143 | " # Test 123 144 | " becomes 145 | " # -------- 146 | " # Test 123 147 | " # -------- 148 | nnoremap cul :normal "lyy"lpwv$r-^"lyyk"lP 149 | 150 | " Format the entire file 151 | nnoremap fef mx=ggG='x 152 | 153 | " Format a json file with Python's built in json.tool. 154 | " from https://github.com/spf13/spf13-vim/blob/3.0/.vimrc#L390 155 | nnoremap jt :%!underscore print:set filetype=json 156 | nnoremap jts :%!underscore print --strict:set filetype=json 157 | 158 | " Split window vertically or horizontally *and* switch to the new split! 159 | nnoremap hs :split:wincmd j 160 | nnoremap vs :vsplit:wincmd l 161 | 162 | " Close the current window 163 | nnoremap sc :close 164 | 165 | " Close the current buffer without quitting 166 | nnoremap w :Bclose 167 | 168 | " --------------- 169 | " Typo Fixes 170 | " --------------- 171 | 172 | noremap 173 | inoremap 174 | cnoremap w' w 175 | 176 | " Disable the ever-annoying Ex mode shortcut key. Type visual my ass. Instead, 177 | " make Q repeat the last macro instead. *hat tip* http://vimbits.com/bits/263 178 | nnoremap Q @@ 179 | 180 | " Removes doc lookup mapping because it's easy to fat finger and never useful. 181 | nnoremap K k 182 | vnoremap K k 183 | -------------------------------------------------------------------------------- /functions.vim: -------------------------------------------------------------------------------- 1 | " ---------------------------------------- 2 | " Functions 3 | " ---------------------------------------- 4 | 5 | " --------------- 6 | " OpenURL 7 | " --------------- 8 | 9 | if has('ruby') 10 | ruby << EOF 11 | require 'open-uri' 12 | require 'openssl' 13 | 14 | def extract_url(url) 15 | re = %r{(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]| 16 | [a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>] 17 | +\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]\{\};:'" 18 | .,<>?«»“”‘’]))} 19 | 20 | url.match(re).to_s 21 | end 22 | 23 | def open_url 24 | line = VIM::Buffer.current.line 25 | 26 | if url = extract_url(line) 27 | if RUBY_PLATFORM.downcase =~ /(win|mingw)(32|64)/ 28 | `start cmd /c chrome #{url}` 29 | VIM::message("Opened #{url}") 30 | else 31 | `open #{url}` 32 | VIM::message("Opened #{url}") 33 | end 34 | else 35 | VIM::message("No URL found on this line.") 36 | end 37 | 38 | end 39 | 40 | # Returns the contents of the tag of a given page 41 | def fetch_title(url) 42 | if RUBY_VERSION < '1.9' 43 | open(url).read.match(/<title>(.*?)<\/title>?/i)[1] 44 | else 45 | open(url, :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE).read. 46 | match(/<title>(.*?)<\/title>?/i)[1] 47 | end 48 | end 49 | 50 | # Paste the title and url for the url on the clipboard in markdown format: 51 | # [Title](url) 52 | # Note: Clobbers p register 53 | def paste_url_and_title 54 | clipboard = VIM::evaluate('@+') 55 | url = extract_url(clipboard) 56 | if url and url.strip != "" 57 | puts "Fetching title" 58 | title = fetch_title(url) 59 | VIM::command "let @p = '[#{title}](#{url})'" 60 | VIM::command 'normal! "pp' 61 | else 62 | VIM::message("Clipboard does not contain URL: '#{clipboard[1..10]}'...") 63 | end 64 | end 65 | EOF 66 | 67 | " Open a URL 68 | if !exists("*OpenURL") 69 | function! OpenURL() 70 | :ruby open_url 71 | endfunction 72 | endif 73 | 74 | command! OpenUrl call OpenURL() 75 | nnoremap <leader>o :call OpenURL()<CR> 76 | 77 | " --------------- 78 | " Paste link with Title 79 | " --------------- 80 | 81 | " Open a URL 82 | if !exists("*PasteURLTitle") 83 | function! PasteURLTitle() 84 | :ruby paste_url_and_title 85 | endfunction 86 | endif 87 | 88 | command! PasteURLTitle call PasteURLTitle() 89 | noremap <leader>pt :PasteURLTitle<CR> 90 | 91 | endif " endif has('ruby') 92 | 93 | " --------------- 94 | " Quick spelling fix (first item in z= list) 95 | " --------------- 96 | function! QuickSpellingFix() 97 | if &spell 98 | normal 1z= 99 | else 100 | " Enable spelling mode and do the correction 101 | set spell 102 | normal 1z= 103 | set nospell 104 | endif 105 | endfunction 106 | 107 | command! QuickSpellingFix call QuickSpellingFix() 108 | nnoremap <silent> <leader>z :QuickSpellingFix<CR> 109 | 110 | " --------------- 111 | " Convert Ruby 1.8 hash rockets to 1.9 JSON style hashes. 112 | " From: http://git.io/cxmJDw 113 | " Note: Defaults to the entire file unless in visual mode. 114 | " --------------- 115 | command! -bar -range=% NotRocket execute 116 | \'<line1>,<line2>s/:\(\w\+\)\s*=>/\1:/e' . (&gdefault ? '' : 'g') 117 | 118 | " ------------------------------------ 119 | " Convert .should rspec syntax to expect. 120 | " From: https://coderwall.com/p/o2oyrg 121 | " ------------------------------------ 122 | command! -bar -range=% Expect execute 123 | \'<line1>,<line2>s/\(\S\+\).should\(\s\+\)==\s*\(.\+\)' . 124 | \'/expect(\1).to\2eq(\3)/e' . 125 | \(&gdefault ? '' : 'g') 126 | 127 | " --------------- 128 | " Strip Trailing White Space 129 | " --------------- 130 | " From http://vimbits.com/bits/377 131 | " Preserves/Saves the state, executes a command, and returns to the saved state 132 | function! Preserve(command) 133 | " Preparation: save last search, and cursor position. 134 | let _s=@/ 135 | let l = line(".") 136 | let c = col(".") 137 | " Do the business: 138 | execute a:command 139 | " Clean up: restore previous search history, and cursor position 140 | let @/=_s 141 | call cursor(l, c) 142 | endfunction 143 | function! StripTrailingWhiteSpaceAndSave() 144 | :call Preserve("%s/\\s\\+$//e")<CR> 145 | :write 146 | endfunction 147 | command! StripTrailingWhiteSpaceAndSave :call StripTrailingWhiteSpaceAndSave()<CR> 148 | nnoremap <silent>stw :silent! StripTrailingWhiteSpaceAndSave<CR> 149 | 150 | " --------------- 151 | " Paste using Paste Mode 152 | " 153 | " Keeps indentation in source. 154 | " --------------- 155 | function! PasteWithPasteMode() 156 | if &paste 157 | normal p 158 | else 159 | " Enable paste mode and paste the text, then disable paste mode. 160 | set paste 161 | normal p 162 | set nopaste 163 | endif 164 | endfunction 165 | 166 | command! PasteWithPasteMode call PasteWithPasteMode() 167 | nnoremap <silent> <leader>p :PasteWithPasteMode<CR> 168 | 169 | " --------------- 170 | " Write Buffer if Necessary 171 | " 172 | " Writes the current buffer if it's needed, unless we're the in QuickFix mode. 173 | " --------------- 174 | 175 | function WriteBufferIfNecessary() 176 | if &filetype == "qf" 177 | execute "normal! \<enter>" 178 | else 179 | " File is modified or doesn't exist yet. 180 | if &modified || !filereadable(expand('%')) 181 | :write 182 | endif 183 | endif 184 | endfunction 185 | 186 | " Clear the search buffer when hitting return 187 | " Idea for MapCR from http://git.io/pt8kjA 188 | function! MapCR() 189 | nnoremap <silent> <enter> :call WriteBufferIfNecessary()<CR> 190 | endfunction 191 | call MapCR() 192 | 193 | " --------------- 194 | " Make a scratch buffer with all of the leader keybindings. 195 | " 196 | " Adapted from http://ctoomey.com/posts/an-incremental-approach-to-vim/ 197 | " --------------- 198 | function! ListLeaders() 199 | silent! redir @b 200 | silent! nmap <LEADER> 201 | silent! redir END 202 | silent! new 203 | silent! set buftype=nofile 204 | silent! set bufhidden=hide 205 | silent! setlocal noswapfile 206 | silent! put! b 207 | silent! g/^s*$/d 208 | silent! %s/^.*,// 209 | silent! normal ggVg 210 | silent! sort 211 | silent! let lines = getline(1,"$") 212 | silent! normal <esc> 213 | endfunction 214 | 215 | command! ListLeaders :call ListLeaders() 216 | 217 | function! CopyMatches(reg) 218 | let hits = [] 219 | %s//\=len(add(hits, submatch(0))) ? submatch(0) : ''/ge 220 | let reg = empty(a:reg) ? '+' : a:reg 221 | execute 'let @'.reg.' = join(hits, "\n") . "\n"' 222 | endfunction 223 | command! -register CopyMatches call CopyMatches(<q-reg>) 224 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vim Configuration 2 | > Modified from [Jeremy Macks' excellently curated configuration](https://github.com/mutewinter/dot_vim) 3 | 4 | ## Installation 5 | 6 | 1. `git clone http://github.com/chrismccord/dot_vim.git ~/.vim`. 7 | 1. `cd ~/.vim`. 8 | 9 | Now you have a choice. The automated script or the manual process. 10 | 11 | 1. Run `scripts/setup`. 12 | 13 | **or** 14 | 15 | 1. `rake vim:link` to make the .vimrc symbolic link. 16 | 2. Install [Vundle](https://github.com/gmarik/vundle) with `git clone 17 | http://github.com/gmarik/vundle.git bundle/vundle` 18 | 3. `vim "+mkspell ~/.vim/spell/custom.en.utf-8.add" +BundleInstall +qall` 19 | _installs all of the plugins and compiles custom spellings._ 20 | 21 | 22 | ## Screenshots 23 | 24 | **MacVim** / **Windows gVim** 25 | 26 | [![MacVim](https://github.com/chrismccord/dot_vim/raw/master/screenshots/MacVim1_small.png)](https://github.com/chrismccord/dot_vim/raw/master/screenshots/MacVim1.png) [![Windows gVim](https://github.com/chrismccord/dot_vim/raw/master/screenshots/Windows1_small.png)](https://github.com/mutewinter/dot_vim/raw/master/screenshots/Windows1.png) 27 | 28 | ## Requirements 29 | 30 | **Mac** 31 | 32 | * [MacVim](https://github.com/b4winckler/macvim) - I'm currently using 33 | [snapshot 65](https://github.com/b4winckler/macvim/downloads) on Mountain Lion. 34 | 35 | **Windows** 36 | 37 | * [gVim](http://www.vim.org/download.php#pc) - I'm using [Wu 38 | Yongwei's](http://wyw.dcweb.cn) pre-compiled [gVim 39 | 7.3.333](http://wyw.dcweb.cn/download.asp?path=vim&file=gvim73.zip) because it 40 | has Ruby support and the latest patches. 41 | 42 | ## Mappings 43 | 44 | * Typing `jk` insert mode is equivalent to `Escape`. 45 | * Pressing `enter` in normal mode saves the current buffer. 46 | 47 | And many more. See [`mappings.vim`](mappings.vim) and 48 | [`plugin_config.vim`](plugin_config.vim) for more. 49 | 50 | ## Notes 51 | 52 | Be sure to always edit the vimrc using `,v`, which opens the vimrc in the 53 | `.vim` folder. Vim has a nasty habit of overriding symlinks. 54 | 55 | ## Plugin Installation / Requirements 56 | 57 | Here's a list of plugins that require further installation or have 58 | dependencies. 59 | 60 | * [Ag.vim](https://github.com/rking/ag.vim) Requires 61 | [The Silver Searcher](https://github.com/ggreer/the_silver_searcher) to be 62 | installed. 63 | * [Source Code for Powerline](http://git.io/H3fYBg) The custom font I'm using 64 | for vim-airline. 65 | * [CtrlP C Matching Extension](https://github.com/JazzCore/ctrlp-cmatcher) 66 | requires compilation. See the steps [in its 67 | readme](https://github.com/JazzCore/ctrlp-cmatcher). 68 | * [underscore-cli](https://github.com/ddopson/underscore-cli) for sweet JSON 69 | formatting. 70 | 71 | 72 | ## Plugin List 73 | 74 | _Note: Auto generated by `rake plugins:update_readme`_ 75 | 76 | 77 | * [vundle](https://github.com/gmarik/vundle) - Vundle, the plug-in manager for Vim 78 | * [ZoomWin](https://github.com/vim-scripts/ZoomWin) - Zoom in/out of windows (toggle between one window and multi-window) 79 | * [ctrlp.vim](https://github.com/kien/ctrlp.vim) - Fuzzy file, buffer, mru, tag, etc finder. 80 | * [ctrlp-cmatcher](https://github.com/https://github.com/JazzCore/ctrlp-cmatcher) - Fuzzy Match "Jump to definition" without ctags 81 | * [ctrlp-funky](https://github.com/JazzCore/ctrlp-cmatcher) - CtrlP C matching extension 82 | * [vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides) - A Vim plugin for visually displaying indent levels in code 83 | * [vim-airline](https://github.com/bling/vim-airline) - lean & mean status/tabline for vim that's light as air 84 | * [vim-gitgutter](https://github.com/airblade/vim-gitgutter) - shows a git diff in the gutter (sign column) 85 | * [nerdtree](https://github.com/scrooloose/nerdtree) - A tree explorer plugin for vim. 86 | * [colorv.vim](https://github.com/Rykka/colorv.vim) - A powerful color tool. 87 | * [jellybeans.vim](https://github.com/nanotech/jellybeans.vim) - A colorful, dark color scheme for Vim. 88 | * [vim-startify](https://github.com/mhinz/vim-startify) - A fancy start screen for Vim. 89 | * [undotree](https://github.com/mbbill/undotree) - Display your undo history in a graph. 90 | * [vim-togglecursor](https://github.com/jszakmeister/vim-togglecursor) - Toggle the cursor shape in the terminal for Vim. 91 | * [tcomment_vim](https://github.com/tomtom/tcomment_vim) - An extensible & universal comment vim-plugin that also handles embedded filetypes 92 | * [vim-surround](https://github.com/tpope/vim-surround) - surround.vim: quoting/parenthesizing made simple 93 | * [ag.vim](https://github.com/rking/ag.vim) - Vim plugin for the_silver_searcher, 'ag', a replacement for the Perl module / CLI script 'ack' 94 | * [scratch.vim](https://github.com/vim-scripts/scratch.vim) - Plugin to create and use a scratch Vim buffer 95 | * [vim-session](https://github.com/xolox/vim-session) - Extended session management for Vim (:mksession on steroids) 96 | * [delimitMate](https://github.com/Raimondi/delimitMate) - Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc. 97 | * [MatchTagAlways](https://github.com/Valloric/MatchTagAlways) - A Vim plugin that always highlights the enclosing html/xml tags 98 | * [YouCompleteMe](https://github.com/Valloric/YouCompleteMe) - A code-completion engine for Vim 99 | * [vim-autoreadwatch](https://github.com/kballenegger/vim-autoreadwatch) - A forked script for vim auto reloading of buffers when changed on disk. 100 | * [vim-ruby](https://github.com/vim-ruby/vim-ruby) - Vim/Ruby Configuration Files 101 | * [vim-haml](https://github.com/tpope/vim-haml) - Vim runtime files for Haml, Sass, and SCSS 102 | * [vim-rails](https://github.com/tpope/vim-rails) - rails.vim: Ruby on Rails power tools 103 | * [vim-rake](https://github.com/tpope/vim-rake) - rake.vim: it's like rails.vim without the rails 104 | * [vim-bundler](https://github.com/tpope/vim-bundler) - bundler.vim: Lightweight support for Ruby's Bundler 105 | * [vim-javascript](https://github.com/pangloss/vim-javascript) - Vastly improved Javascript indentation and syntax support in Vim. 106 | * [vim-coffee-script](https://github.com/kchmck/vim-coffee-script) - CoffeeScript support for vim 107 | * [vim-json](https://github.com/leshill/vim-json) - Syntax highlighting for JSON in Vim 108 | * [vim-handlebars](https://github.com/nono/vim-handlebars) - Vim plugin for Handlebars 109 | * [html5.vim](https://github.com/othree/html5.vim) - HTML5 omnicomplete and syntax 110 | * [indenthtml.vim](https://github.com/vim-scripts/indenthtml.vim) - alternative html indent script 111 | * [tomdoc.vim](https://github.com/mutewinter/tomdoc.vim) - A simple syntax add-on for vim that highlights your TomDoc comments. 112 | * [vim-tomdoc](https://github.com/jc00ke/vim-tomdoc) - Simple vim plugin that adds TomDoc templates to your code. 113 | * [cocoa.vim](https://github.com/msanders/cocoa.vim) - Vim plugin for Cocoa/Objective-C development. 114 | * [taskpaper.vim](https://github.com/mutewinter/taskpaper.vim) - This package contains a syntax file and a file-type plugin for the simple format used by the TaskPaper application. 115 | * [nginx.vim](https://github.com/mutewinter/nginx.vim) - Syntax highlighting for nginx.conf and related config files. 116 | * [textile.vim](https://github.com/timcharper/textile.vim) - Textile for VIM 117 | * [vim-css3-syntax](https://github.com/mutewinter/vim-css3-syntax) - Add CSS3 syntax support to vim's built-in `syntax/css.vim`. 118 | * [vim-tmux](https://github.com/mutewinter/vim-tmux) - http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/examples/tmux.vim?view=log 119 | * [vim-markdown](https://github.com/plasticboy/vim-markdown) - Markdown Vim Mode 120 | * [vim-less](https://github.com/groenewege/vim-less) - vim syntax for LESS (dynamic CSS) 121 | * [vim-stylus](https://github.com/wavded/vim-stylus) - Syntax Highlighting for Stylus 122 | * [vim-cucumber](https://github.com/tpope/vim-cucumber) - Vim Cucumber runtime files 123 | * [csv.vim](https://github.com/chrisbra/csv.vim) - A Filetype plugin for csv files 124 | * [matchit.zip](https://github.com/vim-scripts/matchit.zip) - extended % matching for HTML, LaTeX, and many other languages 125 | * [vim-textobj-user](https://github.com/kana/vim-textobj-user) - Vim plugin: Create your own text objects 126 | * [vim-textobj-rubyblock](https://github.com/nelstrom/vim-textobj-rubyblock) - A custom text object for selecting ruby blocks. 127 | * [L9](https://github.com/vim-scripts/L9) - Vim-script library 128 | * [vim-repeat](https://github.com/tpope/vim-repeat) - repeat.vim: enable repeating supported plugin maps with "." 129 | * [webapi-vim](https://github.com/mattn/webapi-vim) - vim interface to Web API 130 | * [vim-misc](https://github.com/xolox/vim-misc) - Miscellaneous auto-load Vim scripts 131 | * [funcoo.vim](https://github.com/rizzatti/funcoo.vim) - Functional Object Oriented VimL 132 | 133 | -------------------------------------------------------------------------------- /plugin_config.vim: -------------------------------------------------------------------------------- 1 | " ---------------------------------------- 2 | " Plugin Configuration 3 | " ---------------------------------------- 4 | 5 | " --------------- 6 | " Vundle 7 | " --------------- 8 | command! ReloadVundle source ~/.vim/vundle.vim 9 | function BundleReloadAndRun(command) 10 | :ReloadVundle 11 | execute a:command 12 | endfunction 13 | 14 | nnoremap <Leader>bi :call BundleReloadAndRun("BundleInstall")<CR> 15 | nnoremap <Leader>bu :call BundleReloadAndRun("BundleInstall!")<CR> 16 | nnoremap <Leader>bc :call BundleReloadAndRun("BundleClean")<CR> 17 | 18 | " --------------- 19 | " space.vim 20 | " --------------- 21 | " Disables space mappings in select mode to fix snipMate. 22 | let g:space_disable_select_mode = 1 23 | 24 | " --------------- 25 | " Syntastic 26 | " --------------- 27 | " let g:syntastic_enable_signs = 1 28 | " let g:syntastic_auto_loc_list = 1 29 | " let g:syntastic_loc_list_height = 5 30 | " let g:syntastic_mode_map = { 'mode': 'active', 31 | " \ 'active_filetypes': [], 32 | " \ 'passive_filetypes': [] } 33 | " let g:syntastic_html_checkers = ['handlebars'] 34 | " 35 | " " Hat tip http://git.io/SPIBfg 36 | " let g:syntastic_error_symbol = '✗' 37 | " let g:syntastic_warning_symbol = '⚠' 38 | " let g:syntastic_full_redraws = 1 39 | 40 | " --------------- 41 | " NERDTree 42 | " --------------- 43 | nnoremap <leader>nn :NERDTreeToggle<CR> 44 | nnoremap <leader>nf :NERDTreeFind<CR> 45 | let g:NERDTreeShowBookmarks = 1 46 | let g:NERDTreeChDirMode = 1 47 | let g:NERDTreeMinimalUI = 1 48 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") 49 | \&& b:NERDTreeType == "primary") | q | endif 50 | 51 | " --------------- 52 | " Indent Guides 53 | " --------------- 54 | let g:indent_guides_enable_on_vim_startup = 1 55 | let g:indent_guides_start_level=2 56 | let g:indent_guides_guide_size=1 57 | 58 | 59 | " --------------- 60 | " Session 61 | " --------------- 62 | let g:session_autosave = 0 63 | let g:session_autoload = 0 64 | nnoremap <leader>os :OpenSession<CR> 65 | 66 | " --------------- 67 | " Tabular 68 | " --------------- 69 | " nnoremap <Leader>t= :Tabularize assignment<CR> 70 | " vnoremap <Leader>t= :Tabularize assignment<CR> 71 | " nnoremap <Leader>t: :Tabularize symbol<CR> 72 | " vnoremap <Leader>t: :Tabularize symbol<CR> 73 | " nnoremap <Leader>t, :Tabularize comma<CR> 74 | " vnoremap <Leader>t, :Tabularize comma<CR> 75 | 76 | " --------------- 77 | " Fugitive 78 | " --------------- 79 | nnoremap <Leader>gc :Gcommit -v<CR> 80 | nnoremap <Leader>gw :Gwrite<CR> 81 | nnoremap <Leader>gs :Gstatus<CR> 82 | nnoremap <Leader>gp :Git push<CR> 83 | " Mnemonic, gu = Git Update 84 | nnoremap <Leader>gu :Git pull<CR> 85 | nnoremap <Leader>gd :Gdiff<CR> 86 | " Exit a diff by closing the diff window 87 | nnoremap <Leader>gx :wincmd h<CR>:q<CR> 88 | " Start git command 89 | nnoremap <leader>gi :Git<space> 90 | " Undo the last commit 91 | command! Gcundo :Git reset HEAD~1 92 | 93 | " --------------- 94 | " Zoomwin 95 | " --------------- 96 | " Zoom Window to Full Size 97 | nnoremap <silent> <leader>wo :ZoomWin<CR> 98 | 99 | " --------------- 100 | " ctrlp.vim 101 | " --------------- 102 | " Ensure Ctrl-P isn't bound by default 103 | let g:ctrlp_map = '' 104 | 105 | " Ensure max height isn't too large. (for performance) 106 | let g:ctrlp_max_height = 10 107 | " let g:ctrlp_match_func = {'match' : 'matcher#cmatch' } 108 | let g:ctrlp_extensions = ['funky'] 109 | let g:ctrlp_custom_ignore = '_build\|deps\|DS_Store\|git\|vendor/gems\|public/uploads' 110 | " Leader Commands 111 | nnoremap <leader>t :CtrlPRoot<CR> 112 | nnoremap <leader>b :CtrlPBuffer<CR> 113 | nnoremap <leader>u :CtrlPCurFile<CR> 114 | nnoremap <leader>m :CtrlPTag<CR> 115 | nnoremap <leader>r :CtrlPFunky<CR> 116 | nnoremap <leader>. :tag /^<C-R><C-w>[.]*<cr> 117 | 118 | " --------------- 119 | " airline 120 | " --------------- 121 | let g:airline_theme = 'jellybeans' 122 | " let g:airline_powerline_fonts = 1 123 | let g:airline_symbols = {} 124 | " unicode symbols 125 | " let g:airline_symbols.linenr = '␊' 126 | " let g:airline_symbols.linenr = '␤' 127 | " let g:airline_symbols.linenr = '¶' 128 | " let g:airline_symbols.branch = '⎇' 129 | " let g:airline_symbols.paste = 'ρ' 130 | " let g:airline_symbols.paste = 'Þ' 131 | " let g:airline_symbols.paste = '∥' 132 | let g:airline_symbols.whitespace = 'Ξ' 133 | let g:airline_left_sep = '⮀' 134 | let g:airline_left_alt_sep = '⮁' 135 | let g:airline_right_sep = '⮂' 136 | let g:airline_right_alt_sep = '⮃' 137 | let g:airline_fugitive_prefix = '⭠' 138 | let g:airline_readonly_symbol = '⭤' 139 | let g:airline_linecolumn_prefix = '⭡' 140 | 141 | let g:airline_detect_modified = 1 142 | let g:airline#extensions#whitespace#enabled = 1 143 | let g:airline#extensions#hunks#enabled = 0 144 | let g:airline_mode_map = { 145 | \ 'n' : 'N', 146 | \ 'i' : 'I', 147 | \ 'R' : 'R', 148 | \ 'v' : 'V', 149 | \ 'V' : 'VL', 150 | \ 'c' : 'CMD', 151 | \ '' : 'VB', 152 | \ } 153 | " Show the current working directory folder name 154 | let g:airline_section_b = '%{substitute(getcwd(), ".*\/", "", "g")} ' 155 | " Just show the file name 156 | let g:airline_section_c = '%t' 157 | 158 | " --------------- 159 | " jellybeans.vim colorscheme tweaks 160 | " --------------- 161 | " Make cssAttrs (center, block, etc.) the same color as units 162 | hi! link cssAttr Constant 163 | 164 | " --------------- 165 | " Ag.vim 166 | " --------------- 167 | nnoremap <silent> <leader>as :AgFromSearch<CR> 168 | nnoremap <leader>ag :Ag<space> 169 | 170 | " --------------- 171 | " surround.vim 172 | " --------------- 173 | " Use # to get a variable interpolation (inside of a string)} 174 | " ysiw# Wrap the token under the cursor in #{} 175 | " Thanks to http://git.io/_XqKzQ 176 | let g:surround_35 = "#{\r}" 177 | " Expand {xyz} to { xyz } 178 | " pneumonic: Change to Open Brace 179 | nnoremap cob :normal cs{{<cr> 180 | 181 | " --------------- 182 | " Gifl - Google I'm Feeling Lucky URL Grabber 183 | " --------------- 184 | let g:LuckyOutputFormat='markdown' 185 | " I sometimes run vim without ruby support. 186 | let g:GIFLSuppressRubyWarning = 1 187 | 188 | " ------------ 189 | " sideways.vim 190 | " ------------ 191 | noremap gs :SidewaysRight<cr> 192 | noremap gS :SidewaysLeft<cr> 193 | 194 | " --------------- 195 | " switch.vim 196 | " --------------- 197 | nnoremap - :Switch<cr> 198 | 199 | " --------------- 200 | " indenthtml 201 | " --------------- 202 | " Setup indenthtml to propertly indent html. Without this, formatting doesn't 203 | " work on html. 204 | let g:html_indent_inctags = "html,body,head,tbody" 205 | let g:html_indent_script1 = "inc" 206 | let g:html_indent_style1 = "inc" 207 | 208 | " --------------- 209 | " vim-markdown 210 | " --------------- 211 | let g:vim_markdown_folding_disabled = 1 212 | 213 | " --------------- 214 | " Unconditional Paste 215 | " --------------- 216 | let g:UnconditionalPaste_NoDefaultMappings = 1 217 | nnoremap gcP <Plug>UnconditionalPasteCharBefore 218 | nnoremap gcp <Plug>UnconditionalPasteCharAfter 219 | 220 | " --------------- 221 | " Gist.vim 222 | " --------------- 223 | if has('macunix') || has('mac') 224 | let g:gist_clip_command = 'pbcopy' 225 | endif 226 | let g:gist_post_private = 1 227 | 228 | " --------------- 229 | " MatchTagAlways 230 | " --------------- 231 | let g:mta_filetypes = { 232 | \ 'html' : 1, 233 | \ 'xhtml' : 1, 234 | \ 'xml' : 1, 235 | \ 'handlebars' : 1, 236 | \ 'eruby' : 1, 237 | \} 238 | 239 | " --------------- 240 | " YouCompleteMe 241 | " --------------- 242 | let g:ycm_complete_in_comments = 1 243 | let g:ycm_collect_identifiers_from_comments_and_strings = 1 244 | let g:ycm_filetype_specific_completion_to_disable = { 245 | \ 'ruby' : 1, 246 | \ 'javascript' : 1, 247 | \} 248 | 249 | " --------- 250 | " SuperTab 251 | " --------- 252 | let g:SuperTabDefaultCompletionType = "<c-n>" 253 | 254 | " --------------- 255 | " vim-signify 256 | " --------------- 257 | " let g:signify_mapping_next_hunk = '<leader>gj' 258 | " let g:signify_mapping_prev_hunk = '<leader>gk' 259 | " let g:signify_mapping_toggle_highlight="<nop>" 260 | " let g:signify_mapping_toggle="<nop>" 261 | " " Makes switching buffers in large repos have no delay 262 | " let g:signify_update_on_bufenter = 0 263 | " let g:signify_sign_overwrite = 0 264 | 265 | " --------------- 266 | " vim-startify 267 | " --------------- 268 | let g:startify_list_order = ['files', 'dir', 'bookmarks', 'sessions'] 269 | let g:startify_files_number = 5 270 | let g:startify_session_dir = '~/.vim/sessions' 271 | 272 | " --------------- 273 | " vim-togglecursor 274 | " --------------- 275 | let g:togglecursor_leave='line' 276 | 277 | " ----------------------- 278 | " rails.vim and ember.vim 279 | " ----------------------- 280 | " nnoremap <leader>e :E 281 | " nnoremap <leader>emm :Emodel<space> 282 | " nnoremap <leader>evv :Eview<space> 283 | " nnoremap <leader>ecc :Econtroller<space> 284 | " 285 | " " Rails Only 286 | " nnoremap <leader>eff :Efabricator<space> 287 | " nnoremap <leader>ell :Elayout<space> 288 | " nnoremap <leader>ela :Elayout<space> 289 | " nnoremap <leader>elo :Elocale<space> 290 | " nnoremap <leader>elb :Elib<space> 291 | " nnoremap <leader>eee :Eenvironment<space> 292 | " nnoremap <leader>ehh :Ehelper<space> 293 | " nnoremap <leader>eii :Einitializer<space> 294 | " nnoremap <leader>ejj :Ejavascript<space> 295 | " nnoremap <leader>ess :Espec<space> 296 | " nnoremap <leader>esm :Espec models/ 297 | " nnoremap <leader>esc :Espec controllers/ 298 | " nnoremap <leader>esv :Espec views/ 299 | " nnoremap <leader>esl :Espec lib/ 300 | " 301 | " " Add custom commands for Rails.vim 302 | " " Thanks to http://git.io/_cBVeA and http://git.io/xIKnCw 303 | " let g:rails_projections = { 304 | " \ 'app/models/*.rb': {'keywords': 'validates_conditional'}, 305 | " \ 'db/seeds/*.rb': {'command': 'seeds'}, 306 | " \ 'app/concerns/*.rb': {'command': 'concern'}, 307 | " \ 'spec/support/*.rb': {'command': 'support'}, 308 | " \ 'db/seeds.rb': {'command': 'seeds'}} 309 | " 310 | " let g:rails_gem_projections = { 311 | " \ 'factory_girl_rails': { 312 | " \ 'spec/factories.rb': {'command': 'factory'}, 313 | " \ 'spec/factories/*_factory.rb': { 314 | " \ 'command': 'factory', 315 | " \ 'affinity': 'model', 316 | " \ 'alternate': 'app/models/%s.rb', 317 | " \ 'related': 'db/schema.rb#%p', 318 | " \ 'test': 'spec/models/%s_spec.rb', 319 | " \ 'template': "FactoryGirl.define do\n factory :%s do\n end\nend", 320 | " \ 'keywords': 'factory sequence' 321 | " \ }, 322 | " \ 'spec/factories/*.rb': { 323 | " \ 'command': 'factory', 324 | " \ 'affinity': 'collection', 325 | " \ 'alternate': 'app/models/%o.rb', 326 | " \ 'related': 'db/schema.rb#%s', 327 | " \ 'test': 'spec/models/%o_spec.rb', 328 | " \ 'template': "FactoryGirl.define do\n factory :%o do\n end\nend", 329 | " \ 'keywords': 'factory sequence' 330 | " \ }, 331 | " \ }, 332 | " \ 'fabrication': { 333 | " \ 'spec/fabricators/*_fabricator.rb': { 334 | " \ 'command': 'fabricator', 335 | " \ 'affinity': 'model', 336 | " \ 'alternate': 'app/models/%s.rb', 337 | " \ 'related': 'db/schema.rb#%p', 338 | " \ 'test': 'spec/models/%s_spec.rb', 339 | " \ 'template': "Fabricator(:%s) do\nend", 340 | " \ 'keywords': 'sequence initialize_with on_init transient after_build before_validation after_validation before_save before_create after_create after_save' 341 | " \ }, 342 | " \ }, 343 | " \ 'draper': { 344 | " \ 'app/decorators/*_decorator.rb': { 345 | " \ 'command': 'decorator', 346 | " \ 'affinity': 'model', 347 | " \ 'test': 'spec/decorators/%s_spec.rb', 348 | " \ 'related': 'app/models/%s.rb', 349 | " \ 'template': "class %SDecorator < Draper::Decorator\nend" 350 | " \ } 351 | " \ }, 352 | " \ 'cucumber-rails': { 353 | " \ 'features/*.feature': {'command': 'feature'}, 354 | " \ 'features/step_definitions/*_steps.rb': {'command': 'steps'}, 355 | " \ 'features/support/*.rb': {'command': 'support'} 356 | " \ }} 357 | 358 | " --------------- 359 | " UltiSnips 360 | " --------------- 361 | " let g:UltiSnipsSnippetDirectories=["MyUltiSnips"] 362 | " function! g:UltiSnips_Complete() 363 | " call UltiSnips_JumpForwards() 364 | " if g:ulti_jump_forwards_res == 0 365 | " call UltiSnips_ExpandSnippet() 366 | " if g:ulti_expand_res == 0 367 | " if pumvisible() 368 | " return "\<C-n>" 369 | " else 370 | " return "\<TAB>" 371 | " endif 372 | " endif 373 | " endif 374 | " return "" 375 | " endfunction 376 | " 377 | " au BufEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>" 378 | " let g:UltiSnipsExpandTrigger="<tab>" 379 | " let g:UltiSnipsJumpForwardTrigger="<tab>" 380 | 381 | " --------------- 382 | " Voogle 383 | " --------------- 384 | " let g:voogle_map="<leader>gg" 385 | 386 | " --------------- 387 | " Vimux 388 | " --------------- 389 | " let g:VimuxUseNearestPane = 1 390 | " nnoremap <leader>j :silent! VimuxScrollDownInspect<CR> 391 | " nnoremap <leader>k :silent! VimuxScrollUpInspect<CR> 392 | " nnoremap <leader>a :call VimuxRunCommand("spring rspec --fail-fast")<CR> 393 | " nnoremap <leader>A :call VimuxRunCommand("spring rspec")<CR> 394 | " nnoremap <leader>cu :call VimuxRunCommand("spring cucumber")<CR> 395 | " nnoremap <leader>ca :call VimuxRunCommand("spring cucumber; spring rspec")<CR> 396 | " nnoremap <leader>cm :VimuxPromptCommand<CR> 397 | " function WriteAndVimuxRunLastCommand() 398 | " :call WriteBufferIfNecessary() 399 | " :call VimuxRunLastCommand() 400 | " endfunction 401 | " nnoremap <leader>w :call WriteAndVimuxRunLastCommand()<CR> 402 | " command! REmigrate :call VimuxRunCommand("rake db:drop db:create db:migrate test:prepare") 403 | " command! Migrate :call VimuxRunCommand("rake db:migrate test:prepare") 404 | " command! Rollback :call VimuxRunCommand("rake db:rollback") 405 | 406 | " --------------- 407 | " Turbux 408 | " --------------- 409 | " let g:no_turbux_mappings = 1 410 | " map <leader>X <Plug>SendTestToTmux 411 | " map <leader>x <Plug>SendFocusedTestToTmux 412 | " let g:turbux_command_rspec = 'spring rspec' 413 | " let g:turbux_command_cucumber = 'spring cucumber' 414 | 415 | " --------------- 416 | " tcomment_vim 417 | " --------------- 418 | let g:tcommentMaps = 0 419 | nnoremap <silent><leader>cc :TComment<CR> 420 | vnoremap <silent><leader>cc :TComment<CR> 421 | nnoremap <silent><leader>cb :TCommentBlock<CR> 422 | vnoremap <silent><leader>cb :TCommentBlock<CR> 423 | 424 | " -------------- 425 | " tmux navigator 426 | " -------------- 427 | " let g:tmux_navigator_no_mappings = 1 428 | " 429 | " nnoremap <silent> <M-h> :TmuxNavigateLeft<cr> 430 | " nnoremap <silent> <M-j> :TmuxNavigateDown<cr> 431 | " nnoremap <silent> <M-k> :TmuxNavigateUp<cr> 432 | " nnoremap <silent> <M-l> :TmuxNavigateRight<cr> 433 | " nnoremap <silent> <M-i> :TmuxNavigatePrevious<cr> 434 | 435 | " ------ 436 | " ColorV 437 | " ------ 438 | let g:colorv_preview_ftype = 'css,javascript,scss,stylus' 439 | 440 | " ------- 441 | " portkey 442 | " ------- 443 | " let g:portkey_autostart = 1 444 | 445 | " --------- 446 | " Ember.vim 447 | " --------- 448 | " nnoremap <leader>eaa :Easset<space> 449 | " nnoremap <leader>err :Eroute<space> 450 | " nnoremap <leader>ett :Etemplate<space> 451 | 452 | " -------- 453 | " vim-anzu 454 | " -------- 455 | " nmap n <Plug>(anzu-n) 456 | " nmap N <Plug>(anzu-N) 457 | " nmap * <Plug>(anzu-star) 458 | " nmap # <Plug>(anzu-sharp) 459 | " let g:airline#extensions#anzu#enabled = 1 460 | " 461 | " -------------- 462 | " vim-gitgutter 463 | " -------------- 464 | " By default vim-gitgutter runs often so the signs are as accurate as possible. 465 | " However on some systems this causes a noticeable lag. 466 | " If you would like to trade a little accuracy for speed, comment out these: 467 | let g:gitgutter_realtime = 0 468 | let g:gitgutter_eager = 0 469 | 470 | --------------------------------------------------------------------------------