├── .gitignore ├── .gitmodules ├── LICENSE ├── LaunchVimReadme.md ├── README.md ├── ackrc ├── after └── plugin │ └── edit_plus.vim ├── bin ├── install ├── update ├── update_ctags └── upgrade ├── gvimrc ├── init ├── .vimrc.local ├── 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 | spell/ 6 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /LaunchVimReadme.md: -------------------------------------------------------------------------------- 1 | ## Vim Config Tutorial For Launch Academy 2 | 3 | This tutorial is going to assume you have very little experience with Vim. I am 4 | assuming you know how to enter the different modes, you can move with hjkl, and 5 | you know how to save/quit Vim. 6 | 7 | This is also a tutorial for how to properly use THIS Vim config. Disclaimer: 8 | some of these are my opinions and there might be better ways to perform certain 9 | tasks. Goal of this is to help people new to Vim get up and running with this 10 | config file. 11 | 12 | ### Table Of Contents 13 | 14 | * [General](#general) 15 | 16 | 17 | #### General 18 | 19 | One of the most important keys when using Vim is your `leader`. The `leader` is 20 | a key that allows you to set up shortcuts that are namespaced from normal Vim 21 | commands. Using `leader` avoids hotkey collisions that might come pre-packaged 22 | with Vim. 23 | 24 | The `leader` for this config is comma ','. Whenever I reference `leader` I will 25 | be referring to using comma. 26 | 27 | **Overiding Default Settings**: Any Vim settings you'd like to override (for 28 | example the colorscheme) should be put in the ~/.vimrc.local file. You will 29 | need to initially create this file in order to customize your local Vim. 30 | 31 | **Package Management**: This config uses 32 | [Vundle](https://github.com/gmarik/Vundle.vim) to manage plugins. You shouldn't 33 | need to worry about any plugins until you are a more advanced Vim user. 34 | 35 | #### File Structure 36 | 37 | This config uses NerdTree. To activate nerd tree you type: '\' 38 | 39 | Inside nerd tree: 40 | * `leader` + m - this will activate NerdTree commands for creating, deleting, 41 | moving files. 42 | * Inside nerd tree type '?' to learn more about it. 43 | * Shift + '\' when in a file buffer will take you to that file in the NerdTree 44 | 45 | **Fuzzy Finder**: The fuzzy finder package is called CtrlP. In order to 46 | activate it you type + 'f' and then your file name. 47 | 48 | * when you find file type + 's' to open file in split window 49 | * enter will make that file the new buffer 50 | * move up and down the list with + 'j' or 'k' 51 | * sometimes you need to re-index the finder (for example if you just created a 52 | new file with NerdTree) to re-index type: + 'F' 53 | 54 | #### Text Editing 55 | 56 | **Comment/Uncomment**: To toggle highlighting you type: + '/' 57 | 58 | * highlight text and use command. 59 | * preface that command with a number to comment a certain number of lines. 60 | 61 | 62 | 63 | #### Lightning Talk Commands 64 | 65 | ``` 66 | cmd + ` = switch between different mac vim instances 67 | 68 | , + f = fuzzy finder 69 | , + F = reload fuzzy finder 70 | , + = = will format the whole file for you 71 | , + s = will create subsitution for you 72 | 73 | # substitution example 74 | %s/old_word/new_word/gc (g stands for global, c stands for confirm each change) 75 | 76 | gt + = go to 77 | dt + = delete to 78 | ct + = delete to AND enter insert mode 79 | 80 | :vs = vertical split screen 81 | :sp = horizontal split screen 82 | 83 | ctrl + w shift + h/j/k/l = move screen somewhere else 84 | var (on a def) = will highlight a whole method 85 | vir (on a def or end) = will highlight the inside of a method 86 | 87 | cir (on a def or end) = will delete insides of a ruby method and put into insert 88 | mode 89 | 90 | ctrl + hjkl = move to different screens 91 | Y or yy = copy line 92 | Y = copy lines 93 | 94 | . = will repeat last motion/command you did 95 | 96 | :tabnew = will create a new tab 97 | cmd + t = will create new tab 98 | cmd + shift + [ / ] = cycle through tabs 99 | 100 | cs = will change string surround 101 | 102 | ctrl + o / i = will cycle through vim buffers back and forward 103 | 104 | J = joins line below 105 | H = move cursor to top 106 | M = move cursor to middle 107 | L = move cursor to bottom 108 | 109 | ma = set a mark on a 110 | 'a = go back to that mark 111 | 112 | mb = set a mark on b 113 | 'b = go back to that mark 114 | 115 | I = go to beg of line and enter insert mode 116 | A = go to end of line and enter insert mode 117 | R = replace indefinitely 118 | 119 | / = search forwards 120 | ? = search backwards 121 | 122 | # after search: 123 | n = cycle forward 124 | N = cycle backwards 125 | 126 | spacebar = will clear search highlighting 127 | * = will search for word your currently on 128 | ``` 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # To Install 2 | (Re)move ~/.vim and ~/.vimrc if you have them already, and run: 3 | 4 | git clone https://github.com/launchacademy/vim-config.git ~/.vim 5 | ~/.vim/bin/install 6 | 7 | # Updating 8 | Fetch the latest version of vim-config and install all the new bundles by running: 9 | 10 | ~/.vim/bin/update 11 | 12 | # Upgrading from an old vim-config 13 | 14 | If you're upgrading from a previous version that uses Pathogen instead of 15 | Vundle, you may need to do some one-time cleanup: 16 | 17 | ~/.vim/bin/upgrade 18 | 19 | # Functionality 20 | 21 | Plugins and configuration provide most of the functionality of the pivotal vim 22 | config. Below is a broad overview of the included plugins and what they do. 23 | Each plugin is linked to its documentation page, when readng the docs keep in 24 | mind that this config has comma mapped as the leader key: 25 | 26 | # Launch Academy VIM Tutorial (For this config) 27 | 28 | [Learn how to use this VIM config](https://github.com/LaunchAcademy/vim-config/blob/master/LaunchVimReadme.md) 29 | 30 | ## Rails 31 | * [vim-rails](https://github.com/tpope/vim-rails) lets `gf` and `:Rextract` work on partials, highlights Rails functions. 32 | * [vim-endwise](https://github.com/tpope/vim-endwise) automatically puts in `end`s for your` if` and `do` blocks. 33 | * [vim-ruby-refactoring](https://github.com/ecomba/vim-ruby-refactoring) gives some IDE-like refactoring support to vim. A favorite is `:RExtractLet` (aliased as `,rel`) which takes a local variable in a spec and makes it into a let statement. Others are `:RAddParameter`, `:RInlineTemp`, `:RConvertPostConditional`, `:RExtractConstant`, `:RExtractLocalVariable`, `:RRenameLocalVariable`, `:RRenameInstanceVariable`, `:RExtractMethod`. They can also be accessed with the leader key followed by the capital letters in the command, so `:RAlphaBeta` becomes `,rab`. 34 | * [test_server](https://github.com/brysgo/test_server) lets you use F9 thru F12 to run specs and report the output in vim. 35 | * [vim-blockle](https://github.com/jgdavey/vim-blockle) lets you change a `do..end` into a `{..}` by pressing `b` with the cursor on part of the block. 36 | * Convert a line with `local_variable_foo` to `let(:local_variable_foo) { double(:local_variable_foo) }` with `,ld`. Just place your cursor anywhere on the variable and press `,ld`. 37 | 38 | ## General Editing 39 | * [vim-surround](https://github.com/tpope/vim-surround) helps add/remove/change surround parentheses, quotes, and XML tags. Inside of `"yolokitten"`, type `cs"'` to switch the surround double quotes to single quotes. `t` can generally be used to refer to XML tags, so inside of `Hello` you can do `cit` to modify the word "Hello." To add quotes around something, you can use the command `ys` followed by a motion and the character to surround it with. For instance, inside of "hello", typing `ysiw(` will change it to "( hello )". 40 | * [vim-repeat](https://github.com/tpope/vim-repeat) lets plugins override `.` (the period) to repeat commands. Allows you to use `.` with the vim-surround magic above. 41 | * [nerdcommenter](https://github.com/scrooloose/nerdcommenter) lets you comment and uncomment things. The most useful command is `,/` which comments or uncomments either the current line or the currently selected block. This config has `,/` mapped to the Toggle instead of `,c` as listed in the docs (the rest of the commands use the `c` as listed). 42 | * [vim-unimpaired](https://github.com/tpope/vim-unimpaired) contains a bunch of shortcuts for longer commands that start with colons. Some of the better ones are: 43 | * `]q` and `[q` to go back and forth through the quickfix list (the result of using `:Ag` or `:Ack`). 44 | * `[f` and `]f` to navigate through files in the same directory as the current file. 45 | * `]n` and `[n` to go through merge conflicts. 46 | * It's not provided by this plugin, but `[h` and `]h` let you move through working copy changes in git in a similar manner. 47 | * [gundo](http://sjl.bitbucket.org/gundo.vim/) lets you navigate your vim undo history as a tree. Ever do that thing where you undo a few times, make a change, and want to undo your initial undo? Type `:GundoToggle` and use the arrow keys to find the version you want. 48 | * [tabular](https://github.com/godlygeek/tabular) makes it easy to make pretty ASCII tables and align equal signs of successive variable definitions. 49 | * [syntastic](https://github.com/scrooloose/syntastic) runs your compiler or interpreter and displays syntax errors in vim. A `>>` in the gutter means there is an error on that line, you can mouse over it for more details. 50 | * [vim-airline](https://github.com/bling/vim-airline) sets the status bar and makes it more configurable and useful by showing things like the current Git branch, etc. 51 | * [supertab](https://github.com/ervandew/supertab) lets you press Tab after Ctrl-P or Ctrl-N to cycle through completion options. 52 | * [j-split](https://github.com/mgamba/j-split/blob/master/plugin/j-split.vim) converts spaces in the current line to new lines by pressing `,j` (kind of like a simple use of `xargs`). 53 | * [diffthese](https://github.com/matt-royal/diffthese) lets you use vimdiff on open windows. You can use `:DiffLeft`, `:DiffRight`, etc. `:DiffThese` lets you specify window numbers with number 1 in the top left, increasing clockwise. 54 | * [camelcasemotion](http://www.vim.org/scripts/script.php?script_id=1905) defines motions to work on camelCase text. The usual motions `w`, `b`, and `e` get the friends `,w`, `,b`, and `,e` that move within a word. If your cursor is on the first letter of `lolCatAge` and you press `,w`, you will go the "C" in "Cat." You can also use them as text objects, for instance if you are on the lowercase "a" in "lolCatAge" you can type `ci,w` to change it to 'lolDogAge'. 55 | * [edit-plus](https://github.com/mgamba/edit-plus/blob/master/plugin/edit-plus.vim) lets you refer to line numbers when opening files. For instance, type `:EP README.md:10` to jump to line 10 of your helpful README. Sometimes when you type `:e` it is automatically changed to `:EP`. This is useful for opening test failures from the command line into vim. 56 | * [quickfixfix](https://github.com/brysgo/quickfixfix) maps the NERDtree key bindings to the quickfix window. If you open NERDtree (`\\`) and press `?`, the descriptions of `o`, `i`, `s`, and `go` can be used in the quickfix window. 57 | * [vim-easymotion](https://github.com/Lokaltog/vim-easymotion) lets you use see where repeated motions would take you. If you've ever used vimium's link navigation, it's like that. Type the leader key twice and a motion to see a bunch of annotations in your file based on where repeated uses of that motion would take you, then press a number to go there. For instance, to jump 2 words you can do `,,wb` instead of `2w`. 58 | * [regreplop](http://www.vim.org/scripts/script.php?script_id=2702) lets you paste text over other text without destroying your default register. Usually, if you yanked something and wanted to paste it over a word using `viwp`, you couldn't paste it again because the word you deleted overwrote what you originally yanked. This plugin provides Ctrl-K to paste while keeping your buffer. You can use it in visual mode or follow with a motion. Very handy for repeated replacements. 59 | * [insert_mode_background_color](https://github.com/Peeja/insert_mode_background_color) changes the background color when you are insert mode. 60 | * [vim-cdo](https://github.com/Peeja/vim-cdo) runs commands on every entry in the quickfix or location windows. For instance, if you just searched for something with `:L9GrepBuffer foo` or `:Ag foo` and want to change the foos you found into bar, you could run `:Cdo s/foo/bar/`. If you're doing a replacement like that, make sure not to do `:Cdo %s/.../...` with the percent sign because the first replacement in a file will mess up the later ones. `:Ldo` is the same but for the location list, and suffix your commands with `/c` to confirm changes. 61 | * [vim-snipmate](https://github.com/garbas/vim-snipmate) and [vim-snippets](https://github.com/honza/vim-snippets) provide TextMate like snippets where you can jump around the snippet with the tab key. 62 | * [vim-addon-mw-utils](https://github.com/MarcWeber/vim-addon-mw-utils) is a prequisite of snipmate 63 | * [tlib_vim](https://github.com/tomtom/tlib_vim) is as well 64 | * [vim-textobj-user](https://github.com/kana/vim-textobj-user) allows definition of custom vim "nouns". 65 | * [vim-textobj-rubyblock](https://github.com/nelstrom/vim-textobj-rubyblock) lets you use `ar` and `ir` to select Ruby blocks just like you can do `a"` to select a string. 66 | * [kana/vim-textobj-line](https://github.com/kana/vim-textobj-line) selects entire lines. 67 | * `il` selects the entire line without leading or trailing whitespace. 68 | * `al` selects the entire line with all whitespace except for the linebreak. 69 | * `dd` continues to select the entire line including the linebreak. 70 | * [thinca/vim-textobj-between](https://github.com/thinca/vim-textobj-between) selects between arbitrary delimiters. 71 | * `if` selects the region between the delimiters, excluding the delimiters themselves. 72 | * `af` selects the region between the delimiters plus the delimiters. 73 | * Particularly useful with URLs. If `|` represents the cursor position: `/demonstration/with/riculo|usly/long/pathname/ -> cif/notso -> /demonstration/with/notso/long/pathname/` 74 | * [Julian/vim-textobj-variable-segment](https://github.com/Julian/vim-textobj-variable-segment) selects pieces of snake case or camel case identifiers. If `|` represents the cursor position: 75 | * `foo_ba|r_baz -> civquux -> foo_quux_baz` 76 | * `eggsAn|dCheese -> civOr -> eggsOrCheese` 77 | * [YankRing](http://www.vim.org/scripts/script.php?script_id=1234) 78 | lets you view and cycle through your previous copy and paste registers on the fly 79 | * After pasting use `` and `` to cycle through previously copied text. 80 | * In normal mode press `F6` to view previously copied text. Select one to paste it. 81 | * [terryma/vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) gives you multiple cursor support, similar to Sublime Text. 82 | * While in normal mode, press `` to add a second cursor on the next occurance of the word or symbol under your cursor. 83 | * Use `` to make a vertical selection, then press `` to convert the selection into multiple cursors. 84 | * [editorconfig/editorconfig-vim](https://github.com/editorconfig/editorconfig-vim) teaches vim how to follow the rules defined in `.editorconfig` files in your project, so that you can unify project preferences across multiple editors. See the [editorconfig homepage](http://editorconfig.org/) for more information. 85 | 86 | ## Window Management 87 | * [ZoomWin](http://www.vim.org/scripts/script.php?script_id=508) lets you close all other windows with `o`. You can restore all the closed windows with the same command. Useful with `:tabo` to close everything but what you're working on. 88 | 89 | ## Searching 90 | * [ack](https://github.com/mileszs/ack.vim) lets you shell out to ack within vim using `:Ack pattern [directory]`. By default, results show up in the quickfix window. You can use `:AckAdd` to append to the quickfix window or prefix 'Ack' with an 'L' to use the location list (just like `:grep`'s siblings). 91 | * [ag](https://github.com/epmatsw/ag.vim) is the above but for ag ([a faster ack replacement](https://github.com/ggreer/the_silver_searcher)) 92 | * [vim-abolish](https://github.com/tpope/vim-abolish) deserves a few lines: 93 | * It replaces `teh` with `the`. Say hello to autocorrect memes, Ruby edition. You can define your own with a regex-like syntax. 94 | * It helps you replace things with capitalization differences. If you had the line `foo = Foo.new`, you could run `:S/foo/bar/g` to get `bar = Bar.new` (note the capital 'S'). You can also use curly braces like you would on the command line, for instance `:%S/facilit{y,ies}/building{,s}/g`. 95 | * It converts between camelCase and snake_case. Use `cr` followed 's' for snake_case, 'm' for MixedCase, 'c' for camelCase, or 'u' for UPPER_CASE (these work within the current word and don't take a motion). 96 | * [vim-qargs](https://github.com/nelstrom/vim-qargs) ([stack overflow](http://stackoverflow.com/questions/5686206/search-replace-using-quickfix-list-in-vim/5686810#5686810)) is kind of like Cdo. 97 | * [ctrlp](https://github.com/kien/ctrlp.vim) is a fuzzy file finder invoked by hitting Ctrl-P in normal mode and typing some part of the file name you'd like to open. This config also has `,f` mapped to the same function. 98 | 99 | ## Navigation 100 | * [nerdtree](https://github.com/scrooloose/nerdtree) puts a directory tree on the left side of the screen. Press `\` to open it at your project root, or `Shift-\` to open it with the current file selected. You can press `m` to move, delete, or create files. Press `?` inside the tree to get more help. 101 | * [tagbar](http://majutsushi.github.io/tagbar/) puts ctags for the current file in a pane on the right. Make sure [ctags](http://ctags.sourceforge.net/) is installed and then do `:TagbarToggle` to see them in vim. 102 | 103 | ## Development Tool Integration 104 | * [vim-fugitive](https://github.com/tpope/vim-fugitive) puts git into vim. It can do almost everything git related, some of the most useful features are: 105 | * `:Gblame` to blame the current file. Press enter on a commit to see the full commit. Do `:Gedit` to go back to the current version (or just open it again). 106 | * `:Gread` to check out the current file from git. Very useful if you made some experimental changes that you want to get rid of. 107 | * `:Gbrowse` to open the current file on GitHub, useful for sending links to other people. 108 | * [vim-gitgutter](https://github.com/airblade/vim-gitgutter) puts + and - signs in the gutter to show you what's changed in your working tree. Use `[h` and `]h` to navigate between modified hunks. This plugin can slow down vim, so remove it if you're having problems. 109 | * [tmux-config](https://github.com/pivotal/tmux-config) integrates tmux with Vim. It helps with autosave support and pasting your tmux buffer into vim. 110 | * [vim-dispatch](https://github.com/tpope/vim-dispatch) supplies `:Make` and `:Make!` which run in the background instead of blocking like `:make`. 111 | * [ConqueTerm](http://code.google.com/p/conque/) lets your run interactive commands within vim. Try `:ConqueTerm bash`. 112 | * [vitality.vim](https://github.com/sjl/vitality.vim) makes Vim play nicely with iTerm2 and tmux. It adds things like cursor change on insert mode and focus-lost detection for triggering auto-save. 113 | 114 | ## Colorschemes 115 | * [Vivid Chalk](https://github.com/tpope/vim-vividchalk) 116 | * [Molokai](https://github.com/tomasr/molokai) 117 | * [Solarized](http://ethanschoonover.com/solarized) ([github](https://github.com/altercation/vim-colors-solarized)) 118 | * [ir_black](https://github.com/wesgibbs/vim-irblack) 119 | * [tomorrow](https://github.com/chriskempson/vim-tomorrow-theme) 120 | * [candycode](http://www.vim.org/scripts/script.php?script_id=1635) 121 | * Color-Sampler-Pack 122 | * [colorschemes](https://github.com/flazz/vim-colorschemes) 123 | * [base16](https://github.com/chriskempson/base16-vim) 124 | 125 | ## Languages 126 | * [vim-ruby](https://github.com/vim-ruby/vim-ruby) 127 | * [vim-javascript](https://github.com/pangloss/vim-javascript) 128 | * [vim-markdown](https://github.com/plasticboy/vim-markdown) 129 | * [vim-slim](https://github.com/slim-template/vim-slim) 130 | * [vim-handlebars](https://github.com/nono/vim-handlebars) 131 | * [vim-coffee-script](https://github.com/kchmck/vim-coffee-script) 132 | * [vim-haml](https://github.com/tpope/vim-haml) 133 | * [vim-cucumber](https://github.com/tpope/vim-cucumber) 134 | * [mustache.vim](https://github.com/juvenn/mustache.vim) 135 | * [vim-gocode](https://github.com/Blackrush/vim-gocode) 136 | * [scala-vim-support](https://github.com/rosstimson/scala-vim-support) 137 | * [vim-clojure-static](https://github.com/guns/vim-clojure-static) 138 | * [csv.vim](https://github.com/chrisbra/csv.vim) 139 | * [vim-json](https://github.com/elzr/vim-json) 140 | 141 | # Advanced 142 | 143 | ## Updating manually 144 | 145 | First, fetch the latest vim-config via Git. You can also rebase or merge your 146 | own project-specific customizations. 147 | 148 | To install the necessary bundles: 149 | 150 | vim +PluginInstall +qall # or run :PluginInstall within Vim 151 | 152 | To upgrade bundles to their latest version, use the bang version: 153 | 154 | vim +PluginInstall! +qall # or run :PluginInstall! within Vim 155 | 156 | ## tmux support (optional) 157 | 158 | If you will be using VIM with tmux for remote pairing or window management, see 159 | the [pivotal/tmux-config README](https://github.com/pivotal/tmux-config). 160 | -------------------------------------------------------------------------------- /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 | git pull 4 | vim +PluginInstall! +qall 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /bin/upgrade: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd ~/.vim 3 | rm -rf bundle 4 | bin/install 5 | -------------------------------------------------------------------------------- /gvimrc: -------------------------------------------------------------------------------- 1 | silent! source ~/.gvimrc.local 2 | 3 | " vim:ft=vim: 4 | -------------------------------------------------------------------------------- /init/.vimrc.local: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaunchAcademy/vim-config/6921348c8edbca006f50a76aebc5820e102364f3/init/.vimrc.local -------------------------------------------------------------------------------- /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 | colorscheme railscasts 7 | 8 | " Feel free to override the colorscheme by adding a line to ~/.vimrc.local 9 | " such as the following: 10 | " 11 | " colorscheme solarized 12 | " let g:airline_theme='solarized' 13 | -------------------------------------------------------------------------------- /init/commands.vim: -------------------------------------------------------------------------------- 1 | command CC CoffeeCompile vert 2 | 3 | " Function to Toggle relative line numbers 4 | function! EnableRelativeNumbers() 5 | set number 6 | set relativenumber 7 | endfunc 8 | 9 | function! DisableRelativeNumbers() 10 | set number 11 | set norelativenumber 12 | endfunc 13 | 14 | function StartLecture() 15 | let g:solarized_termcolors=256 16 | syntax enable 17 | set background=light 18 | colorscheme solarized 19 | endfunction 20 | 21 | " Control + n twice to Enable Relative Line Numbers 22 | nnoremap :call EnableRelativeNumbers() 23 | 24 | " Control + n to Disable Relative Line 25 | nnoremap :call DisableRelativeNumbers() 26 | -------------------------------------------------------------------------------- /init/ctags.vim: -------------------------------------------------------------------------------- 1 | set tags+=gems.tags 2 | -------------------------------------------------------------------------------- /init/ctrlp.vim: -------------------------------------------------------------------------------- 1 | let g:ctrlp_map = 'f' 2 | 3 | " The Silver Searcher 4 | " courtesy of https://robots.thoughtbot.com/faster-grepping-in-vim 5 | if executable('ag') 6 | " Use ag over grep 7 | set grepprg=ag\ --nogroup\ --nocolor 8 | 9 | " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore 10 | let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' 11 | 12 | " ag is fast enough that CtrlP doesn't need to cache 13 | let g:ctrlp_use_caching = 0 14 | else 15 | " https://github.com/kien/ctrlp.vim/issues/174 16 | let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard'] 17 | endif 18 | -------------------------------------------------------------------------------- /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 | " Dictionary with VIM: 191 | nmap d :!open dict:// 192 | 193 | -------------------------------------------------------------------------------- /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 | " Highlight Ruby files 21 | au BufRead,BufNewFile *.thor set filetype=ruby 22 | au BufRead,BufNewFile *.god set filetype=ruby 23 | au BufRead,BufNewFile Gemfile* set filetype=ruby 24 | au BufRead,BufNewFile Vagrantfile set filetype=ruby 25 | au BufRead,BufNewFile soloistrc set filetype=ruby 26 | 27 | " Highlight Jasmine fixture files as HTML 28 | autocmd BufRead,BufNewFile *.jasmine_fixture set filetype=html 29 | 30 | " Insert ' => ' 31 | autocmd FileType ruby imap => 32 | 33 | " Open all folds in Markdown. 34 | autocmd FileType mkd normal zR 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | 4 | " Line wrap at 80 characters for Ruby Convention 5 | set tw=80 6 | -------------------------------------------------------------------------------- /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 | 6 | snippet desc 7 | describe("${1}", function() { 8 | ${2} 9 | }); 10 | snippet con 11 | context("${1}", function() { 12 | ${2} 13 | }); 14 | snippet bef 15 | beforeEach(function() { 16 | ${1} 17 | }); 18 | -------------------------------------------------------------------------------- /syntax/css.vim: -------------------------------------------------------------------------------- 1 | syn match cssColorProp contained "\" 2 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | " ---------- 2 | " Vim Config 3 | " ---------- 4 | " 5 | " 6 | " How this works: 7 | " 8 | " This file is minimal. Most of the vim settings and initialization is in 9 | " several files in .vim/init. This makes it easier to find things and to 10 | " merge between branches and repos. 11 | " 12 | " Please do not add configuration to this file, unless it *really* needs to 13 | " come first or last, like Vundle and sourcing the machine-local config. 14 | " Instead, add it to one of the files in .vim/init, or create a new one. 15 | 16 | set nocompatible " be iMproved 17 | filetype off " required! 18 | 19 | " Based on http://erikzaadi.com/2012/03/19/auto-installing-vundle-from-your-vimrc/ 20 | let need_to_install_plugins=0 21 | if empty(system("grep lazy_load ~/.vim/bundle/vundle/autoload/vundle.vim")) 22 | echo "Installing Vundle..." 23 | echo "" 24 | silent !mkdir -p ~/.vim/bundle 25 | silent !rm -rf ~/.vim/bundle/vundle 26 | silent !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle 27 | let need_to_install_plugins=1 28 | endif 29 | set rtp+=~/.vim/bundle/vundle/ 30 | call vundle#begin() 31 | 32 | Plugin 'gmarik/vundle' 33 | 34 | " 35 | " Colorschemes 36 | " 37 | Plugin 'tpope/vim-vividchalk' 38 | Plugin 'chriskempson/base16-vim' 39 | Plugin 'molokai' 40 | Plugin 'altercation/vim-colors-solarized' 41 | Plugin 'wgibbs/vim-irblack' 42 | Plugin 'chriskempson/vim-tomorrow-theme' 43 | Plugin 'candycode.vim' 44 | Plugin 'Color-Sampler-Pack' 45 | Plugin 'flazz/vim-colorschemes' 46 | 47 | " 48 | " Rails 49 | " 50 | Plugin 'tpope/vim-rails' 51 | Plugin 'tpope/vim-endwise' 52 | Plugin 'ecomba/vim-ruby-refactoring' 53 | Plugin 'nelstrom/vim-textobj-rubyblock' 54 | Plugin 'brysgo/test_server' 55 | Plugin 'jgdavey/vim-blockle' 56 | 57 | " 58 | " General Editing 59 | " 60 | Plugin 'tpope/vim-repeat' 61 | Plugin 'tpope/vim-surround' 62 | Plugin 'scrooloose/nerdcommenter' 63 | Plugin 'kana/vim-textobj-user' 64 | Plugin 'Julian/vim-textobj-variable-segment' 65 | Plugin 'kana/vim-textobj-line' 66 | Plugin 'thinca/vim-textobj-between' 67 | Plugin 'tpope/vim-unimpaired' 68 | Plugin 'sjl/gundo.vim' 69 | Plugin 'godlygeek/tabular' 70 | Plugin 'scrooloose/syntastic' 71 | Plugin 'bling/vim-airline' 72 | Plugin 'ervandew/supertab' 73 | Plugin 'mgamba/j-split' 74 | Plugin 'matt-royal/diffthese' 75 | Plugin 'camelcasemotion' 76 | Plugin 'mgamba/edit-plus' 77 | Plugin 'brysgo/quickfixfix' 78 | Plugin 'Lokaltog/vim-easymotion' 79 | Plugin 'regreplop.vim' 80 | Plugin 'Peeja/insert_mode_background_color' 81 | Plugin 'vim-scripts/L9' 82 | Plugin 'Peeja/vim-cdo' 83 | Plugin 'MarcWeber/vim-addon-mw-utils' 84 | Plugin 'tomtom/tlib_vim' 85 | Plugin 'garbas/vim-snipmate' 86 | Plugin 'honza/vim-snippets' 87 | Plugin 'YankRing.vim' 88 | Plugin 'terryma/vim-multiple-cursors' 89 | Plugin 'editorconfig/editorconfig-vim' 90 | 91 | " 92 | " Window Management 93 | " 94 | Plugin 'ZoomWin' 95 | 96 | " 97 | " Searching 98 | " 99 | Plugin 'mileszs/ack.vim' 100 | Plugin 'epmatsw/ag.vim' 101 | Plugin 'tpope/vim-abolish' 102 | Plugin 'henrik/vim-qargs' 103 | Plugin 'junegunn/fzf' 104 | Plugin 'junegunn/fzf.vim' 105 | 106 | " 107 | " Navigation 108 | " 109 | Plugin 'scrooloose/nerdtree' 110 | Plugin 'majutsushi/tagbar' 111 | 112 | " 113 | " Languages 114 | " 115 | Plugin 'vim-ruby/vim-ruby' 116 | Plugin 'pangloss/vim-javascript' 117 | Plugin 'mxw/vim-jsx' 118 | Plugin 'plasticboy/vim-markdown' 119 | Plugin 'slim-template/vim-slim' 120 | Plugin 'nono/vim-handlebars' 121 | Plugin 'kchmck/vim-coffee-script' 122 | Plugin 'tpope/vim-haml' 123 | Plugin 'tpope/vim-cucumber' 124 | Plugin 'juvenn/mustache.vim' 125 | Plugin 'Blackrush/vim-gocode' 126 | Plugin 'rosstimson/scala-vim-support' 127 | Plugin 'guns/vim-clojure-static' 128 | Plugin 'chrisbra/csv.vim' 129 | Plugin 'elzr/vim-json' 130 | Plugin 'isRuslan/vim-es6' 131 | 132 | " 133 | " Development Tool Integration 134 | " 135 | Plugin 'tpope/vim-fugitive' 136 | Plugin 'airblade/vim-gitgutter' 137 | Plugin 'pivotal/tmux-config' 138 | Plugin 'tpope/vim-dispatch' 139 | Plugin 'carlobaldassi/ConqueTerm' 140 | Plugin 'sjl/vitality.vim' 141 | Plugin 'itspriddle/vim-marked' 142 | 143 | call vundle#end() 144 | filetype plugin indent on 145 | 146 | syntax on 147 | 148 | if need_to_install_plugins == 1 149 | echo "Installing plugins via Vundle. Please ignore warnings afterwards." 150 | echo "This is a one-time operation that will take about a minute..." 151 | silent! PluginInstall 152 | echo "Done installing Vundle plugins!" 153 | q 154 | endif 155 | 156 | runtime! init/**.vim 157 | 158 | if filereadable($HOME . "/.vimrc.local") 159 | source ~/.vimrc.local 160 | endif 161 | 162 | au BufRead,BufNewFile *.hamlc set ft=haml 163 | 164 | Plugin 'junegunn/goyo.vim' 165 | function! ProseMode() 166 | call goyo#execute(0, []) 167 | set spell noci nosi noai nolist noshowmode noshowcmd 168 | set complete+=s 169 | set bg=light 170 | colors solarized 171 | endfunction 172 | 173 | command! ProseMode call ProseMode() 174 | --------------------------------------------------------------------------------