├── .gitignore ├── Changelog ├── LICENSE ├── Makefile ├── README.markdown ├── after.vim ├── after └── plugin │ └── after.vim ├── before.vim ├── bindings.vim ├── bundles.vim ├── colors ├── buttercream.vim └── colorzone.vim ├── find-ruby.sh ├── ftplugin ├── bash.vim ├── coffee.vim ├── erlang.vim ├── haml.vim ├── json.vim ├── markdown.vim ├── pool.vim ├── ruby.vim └── sh.vim ├── global.vim ├── gvimrc ├── macros.vim ├── plugins-override.vim ├── plugins.vim ├── ru-translit-bindings.vim ├── snippets ├── eruby.snippets ├── rspec.snippets └── ruby-rails │ ├── mcol.snippet │ ├── mct.snippet │ ├── tcb.snippet │ ├── tcbi.snippet │ ├── tcd.snippet │ ├── tcda.snippet │ ├── tcdt.snippet │ ├── tcf.snippet │ ├── tch.snippet │ ├── tci.snippet │ ├── tcl.snippet │ ├── tcr.snippet │ ├── tcs.snippet │ ├── tct.snippet │ ├── tcti.snippet │ ├── tcts.snippet │ └── tctss.snippet ├── vimrc └── writer.vim /.gitignore: -------------------------------------------------------------------------------- 1 | sessions 2 | .netrwhist 3 | spell 4 | bundle/ 5 | -------------------------------------------------------------------------------- /Changelog: -------------------------------------------------------------------------------- 1 | * unreleased 2 | - vim-tmux-navigator 3 | 4 | * 2015-09-0 5 | - jsx and javascript syntax highlighting 6 | 7 | * 2015-07-21 8 | - mintplant/vim-literate-coffeescript repo is gone. replaced with a cached 9 | copy at vitaly/vim-literate-coffeescript 10 | 11 | * 2015-06-19 12 | - vim-i18n plugin for extracting i18n strings into .yml files 13 | - syntax support: mustashe-handlebars, literate coffeescript and React cjsx 14 | - upgraded clojure syntax support 15 | - vim plugin for emmet.io HTML/CSS workflow 16 | - improved CtrlP ignore list to skip image files 17 | - editorconfig.org file support 18 | - disabled chrisbra/NrrwRgn 19 | - rust language support 20 | - string interpolation for easy surround (tyanks @erez-rabih) 21 | 22 | * 2014-11-25 23 | - fix a deprecation warning by the latest NeoBundle version. 24 | 25 | * 2014-11-20 26 | - upgrade to NeoBundle. IMPORTANT: See readme for upgrade instructions 27 | - vim-airline. Replacement for vim-powerline. IMPORTANT: See readme for upgrade instructions. Also: https://github.com/bling/vim-airline 28 | - disable gitgutter in writer.vim 29 | - reworked makefile. new targets: edit and update. 30 | - vim-less syntax support 31 | 32 | * 2014-02-05 33 | - golang syntax support (thanks @torkale) 34 | - josemarluedke/vim-rspec - lightweight Rspec runner for Vim (@torkale) 35 | - girblade/vim-gitgutter - it diff in the gutter (sign column) and stages/reverts hunks (@torkale) 36 | - backupskip for /private/tmp and ~/tmp. 37 | skip backups on OSX temp dir, for crontab -e to properly work 38 | - replaced threesome by splice. splice is a newer version of threesome by 39 | the same author. 40 | - Dockerfile syntax support 41 | - replace ack by ag - faster better ack (@torkale) 42 | 43 | * 2013-08-28 44 | - fix startup echo messages redirect 45 | - prevent multiple after.vim loads 46 | 47 | * 2013-08-27 48 | - writer.vim 49 | - faster Esc into normal mode (ttimeoutlen=50) 50 | - syntastic fixes (no re-check on exit, fancy marks) 51 | - vim-dispatch (async external commands with output in vim) 52 | - unite.vim (generic user-interface plugin) 53 | 54 | * 2013-07-09 55 | - prompt before deleting bundles directory 56 | - annotate bundles.vim 57 | - blockle.vim plugin 58 | - README updates 59 | 60 | * 2013-04-01 61 | - elixir language support 62 | 63 | * 2013-03-21 64 | - NERDTreeTabs plugin 65 | 66 | * 2012-01-24 (II) 67 | - resurrect old vim-powerline project. The new one has installation issues 68 | on OSX 69 | 70 | * 2012-01-24 71 | - .vimrc.before and .vimrc.after support 72 | - removed .vim_local and .local.vim support 73 | - reprecated .local-before and .local-after 74 | - updated repo for vim-slim plugin 75 | - powerline upgraded to the new pythin based project. (the old one is 76 | deprecated) 77 | 78 | * 2012-12-25 79 | - 'switch' plugin 80 | 81 | * 2012-09-05 82 | - tomorrow-theme 83 | - changed yankring_history file location to ~/.backup/ 84 | 85 | * 2012-08-15 86 | - improved utf8 support (thanks to Arik Fraimovich) 87 | 88 | * 2012-08-04 89 | - added .local-before.vim 90 | - deprecated .local.vim. use .local-after.vim instead 91 | 92 | * 2012-08-02 93 | - support for ~/.local-gui.vim 94 | - removed default background and colorscheme settings 95 | Those are highly personal and should go into ~/.local.vim and ~/.local-gui.vim 96 | 97 | * 2012-07-17 98 | - forced space and tab settings for markdown and haml 99 | - auto wrap for markdown on 80 chars 100 | 101 | * 2012-07-12 102 | - Changed CtrlP mapping `,,` to use CtrlP instead of CtrlPMixed 103 | - added `,l` mapping to CtrlPLine 104 | - removed minibufexpl settings (plugin removed long ago) 105 | - added `,b` mapping to CtrlPBuff 106 | 107 | * 2012-07-10 108 | - CtrlP merged into master 109 | 110 | * 2012-07-05 111 | - make CtrlP see files that are not yet in the git 112 | 113 | * 2012-07-04 114 | - mappings for :diffupdate/put/get 115 | - buttercream and colorzone themes 116 | - renamed vundles.vim to bundles.vim 117 | - %% mapping for command mode to expand to current file's directory 118 | - Command-T replaced with CtrlP 119 | 120 | * 2012-07-01 121 | - fixed missing space at the end of ,g and ,k maps 122 | - mapped ,d to :diffupdate 123 | 124 | * 2012-06-24 125 | - added mapping for :QA and :Qa to be same as :qa 126 | 127 | * 2012-06-19 128 | - calendar.vim 129 | - NrrwRgn plugin (Narrow Region) 130 | - utl.vim plugin (universal text links) 131 | - VimOrganizer plugin (emacs' org mode support) 132 | - settings.vim merged into global.vim 133 | - added after-plugins.vim to override plugin settings 134 | - Gundo plugin 135 | 136 | * 2012-06-18 137 | - support persistent undo 138 | - OSX russian translit keyboard layout support 139 | - READE table of contents 140 | 141 | * 2012-06-11 142 | - attempt to support command-t install on non-OSX systems. trying to guess 143 | ruby binary 144 | - vim-slim plugin for Slim syntax support 145 | 146 | * 2012-06-07 147 | - after.vim: reworked loading of bindings.vim after plugins. 148 | local now also loaded after all the plugins 149 | - deprecated ~/.vim_local 150 | - new file ~/.local.vim 151 | - macros.vim - a couple of useful macros 152 | - added CHANGELOG ;) 153 | - change command-t repo to github. original is down all the time 154 | use 'make install' or remove bundle/command-t before you update 155 | - use direct clone for vundle instead of submodules. 156 | latest git submodules cupport is incompatible with vundle 157 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Vitaly Kushner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # find out where ruby is. can override this by providing environment or command 2 | # line variable 3 | RUBY ?= $(shell ./find-ruby.sh) 4 | 5 | .PHONY: help delete 6 | default: help 7 | 8 | delete: 9 | @echo going to remove the bundle directory. press ENTER to continue. 10 | @read something 11 | rm -rf bundle 12 | 13 | NEOBUNDLE := bundle/neobundle.vim 14 | ${NEOBUNDLE}: 15 | @echo 16 | @echo 17 | @echo '**************************************************************' 18 | @echo '* UPGRADING vundle => neobundle *' 19 | @echo '* *' 20 | @echo '* Your existing vundle repository will be DELETED!!!! *' 21 | @echo '* press ENTER to continue, Ctrl-C to stop *' 22 | @echo '**************************************************************' 23 | @read a 24 | rm -rf bundle/vundle 25 | mkdir -p bundle && cd bundle && git clone https://github.com/Shougo/neobundle.vim.git 26 | @echo 27 | @echo '**************************************************************************' 28 | @echo '* DONE! You might need to upgrade your bundles.vim to the new format. *' 29 | @echo '* see https://github.com/Shougo/neobundle.vim *' 30 | @echo '**************************************************************************' 31 | @echo 32 | 33 | .PHONY: cleanup compile-command-t compile 34 | 35 | cleanup: 36 | vim -u bundles.vim +NeoBundleClean +NeoBundleCheck +NeoBundleDocs 37 | 38 | compile-command-t: 39 | test ! -d bundle/Command-T || (cd bundle/Command-T/ruby/command-t/ && $(RUBY) extconf.rb && make) 40 | 41 | compile: compile-command-t 42 | 43 | .PHONY: install reinstall 44 | 45 | install: ${NEOBUNDLE} cleanup compile 46 | 47 | reinstall: delete install 48 | 49 | .PHONY: edit-bundles edit 50 | 51 | edit-bundles: 52 | vim bundles.vim 53 | 54 | edit: edit-bundles install 55 | 56 | .PHONY: cleanup-bundles update-bundles update 57 | 58 | cleanup-bundles: 59 | ls bundle | while read b;do (cd bundle/$$b && git clean -f);done 60 | 61 | update-bundles: ${NEOBUNDLE} 62 | vim -u bundles.vim +NeoBundleUpdate 63 | 64 | update: cleanup-bundles update-bundles install 65 | 66 | .PHONY: help 67 | 68 | help: 69 | @echo COMMON: 70 | @echo 'make help (default) print this message' 71 | @echo 'make install make sure all bundles installed and compiled' 72 | @echo 'make reinstall [DANGEROUS!] - remove bundles and reinstall' 73 | @echo 'make edit edit bundles file and install/refresh bundles' 74 | @echo 'make update update installed bundles' 75 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | ## Dotvim 2 | 3 | > NOTE: this project is no longer supported. The development moved to the 4 | > [Dotvim v2](https://github.com/vitaly/dotvim2). Beta testers and 5 | > contributions are welcome. 6 | 7 | ### An attempt at The Ultimate Vim Configuration™ ;) 8 | 9 | All the right plugins are in. Nerdtree, CtrlP, you name it. 10 | 11 | The focus is on supporting Rails, but there is a lot of generic stuff too, so 12 | it will surely serve you well with any language of your choice. 13 | 14 | The config is using [NeoBundle](https://github.com/Shougo/neobundle.vim) for easy 15 | upgrading. The list of installed bundles is in the `bundles.vim` 16 | 17 | > IMPORTANT: 18 | > - Vundle was replaced with 19 | > [Neobundle](https://github.com/Shougo/neobundle.vim). See [Neobundle 20 | > upgrade instructions](#upgrade_neobundle) if you have an older Vundle based 21 | > install. 22 | > - vim-powerline was replaced with [vim-airline](#airline). Please see 23 | > [installation instructions](#installation_note) 24 | 25 | *Some* help tips are provided for *some* of the plugins. please check out the 26 | plugin's docs for more info. 27 | 28 | Follow [@vkushner][@vkushner] and [@astrails][@astrails] on Twitter to receive 29 | announcements of new versions, tips, etc. 30 | 31 | [@vkushner]: https://twitter.com/vkushner 32 | [@astrails]: https://twitter.com/astrails 33 | 34 | 35 | #### Contents 36 | 37 | * [Installation](#installation) 38 | * [Neobundle upgrade](#upgrade_neobundle) 39 | * [General Configuration](#general) 40 | * [Local configuration](#local) 41 | * [Backups](#backups) 42 | * [Persistent Undo](#undo) 43 | * [Macros](#macros) 44 | * [Interesting Plugins](#interesting) 45 | * [nerdtree](#nerdtree) 46 | * [nerdtree-tabs](#nerdtreetabs) 47 | * [nerdcommenter](#nerdcommenter) 48 | * [Command-T](#Command-T) 49 | * [CtrlP](#CtrlP) 50 | * [AutoComplPop](#AutoComplPop) 51 | * [taglist.vim](#taglist.vim) 52 | * [YankRing.vim](#YankRing.vim) 53 | * [vim-fugitive](#vim-fugitive) 54 | * [syntastic](#syntastic) 55 | * [snipmate](#snipmate) 56 | * [vim-surround](#vim-surround) 57 | * [vim-align](#vim-align) 58 | * [ack.vim](#ack.vim) 59 | * [vim-indentobject](#vim-indentobject) 60 | * [greplace.vim](#greplace.vim) 61 | * [vim-airline](#airline) 62 | * [splice.vim](#splice.vim) 63 | * [vim-endwise](#vim-endwise) 64 | * [delimitMate](#delimitMate) 65 | * [Gundo](#gundo) 66 | * [vim-dispatch](#vim-dispatch) 67 | * [unite.vim](#unite.vim) 68 | * [vim-gitgutter](#gitgutter) 69 | * [vim-i18n](#i18n) 70 | * [switch](#switch) 71 | * [emmet-vim](#emmet) 72 | * [editorconfig](#editorconfig) 73 | * [Ruby/Rails Support](#ruby) 74 | * [vim-rails](#vim-rails) 75 | * [vim-bundler](#vim-bundler) 76 | * [vim-rake](#vim-rake) 77 | * [vim-textobj-rubyblock](#vim-textobj-rubyblock) 78 | * [vim-ruby-refactoring](#vim-ruby-refactoring) 79 | * [blockle.vim](#blockle) 80 | * [apidock.vim](#apidock.vim) 81 | * [Org mode and support plugins](#orgmode) 82 | * [calendar](#calendar) 83 | * [NrrwRgn](#NrrwRgn) 84 | * [utl.vim](#utl.vim) 85 | * [VimOrganizer](#VimOrganizer) 86 | * [Color themes](#themes) 87 | * [vim-colors-solarized](#vim-colors-solarized) 88 | * [vim-vividchalk](#vim-vividchalk) 89 | * [Syntax plugins](#syntax) 90 | * ["Support" and "minor" plugins](#minor) 91 | * [Misc Bindings](#misc) 92 | * [Russian Translit Layout support](#russian) 93 | 94 | 95 | ##### Installation 96 | 97 | From your homedirectory (on Linux/Mac OSX): 98 | 99 | * `git clone https://github.com/astrails/dotvim.git # or git@github.com:astrails/dotvim.git for ssh` 100 | * `ln -sfn dotvim .vim` 101 | * `ln -sfn dotvim/vimrc .vimrc` 102 | * `cd .vim; make install` 103 | 104 | 105 | > Note: if you already have `~/.vim` `~/.vimrc` REMOVE THEM (you might want to backup them first :) 106 | 107 | * create `~/.vimrc.before` or `~/.vimrc.after` if you want to have some 108 | local/personal settings you don't want to commit into the repo. see "[Local Configuration](#local)" 109 | 110 | 111 | > **IMPORTANT** 112 | > - **always** add a `colorscheme` to your `~/.vimrc.after` file. Even if you 113 | > use the defaults scheme add `colorscheme default`. Othewise you will get a 114 | > highlighting error `"E411: highlight group not found: Normal"` during vim 115 | > startup. 116 | > - [vim-airline](#airline) requires some extra glyphs to work properly. Check 117 | > the official documentation on [font > 118 | > installation](https://github.com/bling/vim-airline#integrating-with-powerline-fonts) 119 | > and follow the instructions. If you do not, then strange symbols will be 120 | > displayed instead (can be fixed by configuring it to use regular fonts. see 121 | > help) 122 | 123 | [top](#top) 124 | 125 | 126 | #### Neobundle Upgrade 127 | 128 | Dotvim was updated to use Neobundle instead of Vundle. NeoBundle is mostly 129 | similar but supports more ways to install bundles, better install, locked 130 | revisions and more. 131 | 132 | To upgrade from an older Vundle based setup simply pull the latest version and 133 | run `make`. 134 | 135 | > Note: if you modified your `bundles.vim` you will need to replace all 136 | > instances of `Bundle` with `NeoBundle` in it. Until you do your vim might 137 | > print error messages during startup. ignore them and fix the `bundles.vim`, 138 | > then run `make`. 139 | 140 | [top](#top) 141 | 142 | 143 | #### General configuration 144 | 145 | `,` is used as mapleader 146 | `backslash` is used as localleader 147 | 148 | * `,e` mapped to `:e **/`. essentially you do `,efoo` to get a list of all files starting with foo 149 | * `,s` - toggle invisible characters display 150 | * `,n` - next `quicklist` result (like :Ggrep etc) 151 | * `,N` - previous `quicklist` result (like :Ggrep etc) 152 | * `Ctrl-E` - switch between 2 last buffers (its just a `:b#` :) 153 | * `Ctrl-N` to cancel current search highlighing 154 | * `,f` global Ggrep for word under the cursor or for selection 155 | * `+`, `-` - easily inc/decrement integers 156 | * `,W` - remove trailing spaces 157 | * `Ctrl`-`h`/`j`/`k`/`l` - simplified split panes navigation 158 | * `,d` - `:diffupdate` 159 | * `,dp` - `:diffput` 160 | * `,dg` - `:diffget` 161 | * `%%` - in **control mode**, i.e. after you typed `:` it will expand to the 162 | directory name of the currently opened file. 163 | 164 | Check out the 'plugins.vim' and 'after/plugin/bindings.vim' files for more... 165 | 166 | [top](#top) 167 | 168 | 169 | #### Local configuration 170 | 171 | For easy upgrades its preferable not to change the dotvim configuration files. 172 | Instead you can add your own local configuration into one of the local override 173 | files. There are several override files supported by dotvim. 174 | 175 | They are loaded in the following order: 176 | 177 | * base dotvim configuration (global, plugin configurations, bindings, macros) 178 | * `~/.vimrc.bundles` 179 | 180 | Loads additional bundles inside the `neobundle#begin/end` block. 181 | Should contain lines like `NeoBundle 'my-custom/bundle'` 182 | 183 | * `~/.local-before.vim` _[deprecated]_ 184 | * `~/.vimrc.before` 185 | 186 | Loaded **before** the plugins 187 | 188 | This is where you should pre-set various plugin flags, enable/disable options 189 | etc. This is for things you would normally put into your vimrc file. 190 | 191 | * `~/.gvimrc.before` _[when GUI running]_ 192 | * vim plugins 193 | * dotvim bindings and overrides (loaded from `~/.vim/after.vim`) 194 | * `.local-after.vim` _[deprecated]_ 195 | * `.vimrc.after` 196 | 197 | Loaded **after** the plugins 198 | 199 | This is where you can override settings set by plugins that have no 200 | customization options. 201 | 202 | * `.gvimrc.after` _[when GUI running]_ 203 | 204 | [top](#top) 205 | 206 | 207 | #### Backups 208 | 209 | Backups and swapfiles are disabled. I really hate them both. 210 | 211 | You can re-enable backups by adding the following to your `~/.local.vim`: 212 | 213 | set backup 214 | 215 | and swapfiles by 216 | 217 | set swapfile 218 | 219 | backup dir is set to ~/.backup/ 220 | 221 | The directory is created if it doesn't exist. 222 | 223 | [top](#top) 224 | 225 | 226 | #### Persistent Undo 227 | 228 | Persistent undos are enabled by default. 229 | 230 | You can disable by adding the following to your `~/.local.vim`: 231 | 232 | set noundo 233 | 234 | [top](#top) 235 | 236 | 237 | #### Macros 238 | 239 | I included a couple of macros that I frequently use in macros.vim which 240 | is loaded from after.vim: 241 | 242 | * `@q` (re)format paragraph forward 243 | * `@s` enclose selection with double \*. e.g. \*\*foo\*\*. 244 | 245 | You really should start writing your own macros. The life will never be the 246 | same ;). 247 | 248 | I recommend editing your macros in a vim buffer. 249 | 250 | To load a macro into a register you can 'yank' it. 251 | 252 | For example if you have a line with a macro and cursor is at the beginning of 253 | it `"ay$` will load the macro into register `a`, so that you will be able to 254 | execute it with `@a`. 255 | 256 | [top](#top) 257 | 258 | 259 | #### "Interesting" Plugins: 260 | 261 | 262 | * [nerdtree](http://github.com/scrooloose/nerdtree) ([top](#top)) 263 | 264 | hax0r vim script to give you a tree explorer 265 | 266 | * `Ctrl-P` - open directory browser (**Note:** this is now handled by 267 | [nerdtree-tabs](#nerdtreetabs) (see below)) 268 | * `,p` - to find and highlight the currently open file in the tree 269 | 270 | * [nerdtree-tabs](https://github.com/jistr/vim-nerdtree-tabs) ([top](#top)) 271 | 272 | NERDTree and tabs together in Vim, painlessly 273 | 274 | * `Ctrl-P` - open directory browser 275 | 276 | * [nerdcommenter](http://github.com/scrooloose/nerdcommenter) ([top](#top)) 277 | 278 | Vim plugin for intensely orgasmic commenting 279 | 280 | * `,/` - toggle comment 281 | * `,cc` - add commenting 282 | * `,cu` - Uncomment 283 | * check docs for more 284 | 285 | * [Command-T](http://github.com/vim-scripts/Command-T) ([top](#top)) 286 | 287 | TextMate Command-T like file finder for vim 288 | 289 | Note: This plugin is currently **DISABLED**. See [CtrlP](#CtrlP) plugin 290 | that is used instead 291 | 292 | * `,,` - `CommandT` - find file 293 | * `,.` - `CommandTFlush` - refresh the file list and then find a file 294 | * while at the finder prompt: 295 | * `Ctrl-Enter` - open file in a new split 296 | * `Ctrl-s` - open file in a new split 297 | * `Ctrl-v` - open file in a new vertical split 298 | * `Ctrl-U` - clear current partial path 299 | * `Esc` - cancel 300 | * `Ctrl-c` - cancel 301 | 302 | * [CtrlP](https://github.com/kien/ctrlp.vim) ([top](#top)) 303 | 304 | Fuzzy file, buffer, mru, tag, etc finder. 305 | 306 | This is the new fuzzy finder used by dotvim. It replaced 307 | [Command-T](#Command-T) that was used before. 308 | 309 | The default mapping is still the same: 310 | 311 | * `,,` - `CtrlP` - fuzzy find. 312 | * `,.` - `CtrlPClearCache` followed by `CtrlP` - clears the cache and 313 | searches the files (not including MRU and buffers) 314 | * `,m` - `CtrlPBufTag` - search tags in the current buffer 315 | * `,M` - `CtrlPBufTagAll` - search tags in all buffers 316 | * `,l` - `CtrlPLine` - fuzzy search lines in all opened buffers 317 | * `,b` - `CtrlPBuff` - fuzzy search open buffers 318 | * `,,?` - to quickly open help for CtrlP 319 | 320 | 321 | This plugin has lots of options, see `:h ctrlp` for more. 322 | 323 | * [AutoComplPop](http://github.com/vim-scripts/AutoComplPop) ([top](#top)) 324 | 325 | Automatically opens popup menu for completions 326 | 327 | Shouldn't require config. 328 | 329 | * [taglist.vim](http://github.com/vim-scripts/taglist.vim) ([top](#top)) 330 | 331 | Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc) 332 | 333 | * `,t` - toggle tags window 334 | 335 | * [YankRing.vim](http://github.com/vim-scripts/YankRing.vim) ([top](#top)) 336 | 337 | Maintains a history of previous yanks, changes and deletes 338 | 339 | * `,y` to show the yankring 340 | * `,[`/`,]` - to cycle the just-pasted text though the yankring. 341 | * `:h yankring.txt` and `:h yankring-tutorial` for more 342 | 343 | * [vim-fugitive](http://github.com/tpope/vim-fugitive) ([top](#top)) 344 | 345 | A Git wrapper so awesome, it should be illegal 346 | 347 | * `:Gstatus` 348 | 349 | Bring up the output of git-status in the preview 350 | window. Press `-` to stage or unstage the file on the 351 | cursor line. Press `p` to do so on a per hunk basis 352 | (--patch). Press `C` to invoke :Gcommit. 353 | 354 | * `:Gcommit [args]` 355 | 356 | A wrapper around git-commit. 357 | 358 | * `:Ggrep [args]` 359 | 360 | :grep with git-grep as 'grepprg'. 361 | 362 | * `,g` 363 | 364 | shortcut to run :Ggrep 365 | 366 | * `//` 367 | 368 | global git search for the word under the cursor for for selection (in visual mode) 369 | 370 | * `:Gblame` 371 | 372 | Run git-blame on the file and open the results in a 373 | scroll bound vertical split. Press enter on a line to 374 | reblame the file as it was in that commit. 375 | 376 | Much more in the plugin's doc 377 | 378 | * [syntastic](http://github.com/scrooloose/syntastic) ([top](#top)) 379 | 380 | syntax checking plugin 381 | 382 | it will display the number of syntax errors in the current file in the vim's status line. 383 | 384 | use `:Errors` to display a window detailing the errors 385 | 386 | * [snipmate](http://github.com/msanders/snipmate.vim) ([top](#top)) 387 | 388 | TextMate-style snippets for Vim 389 | 390 | write a snipped text and press TAB to expand it. 391 | 392 | To see the list of available snippets type `Ctrl-R ` in the insert mode 393 | 394 | * [vim-surround](http://github.com/tpope/vim-surround) ([top](#top)) 395 | 396 | Delete/change/add parentheses/quotes/XML-tags/much more with ease 397 | 398 | * `dsX` - delete surround X 399 | * `csXY` - change surround X with Y 400 | * `s/S` in visual mode - wrap selection 401 | * `ysMovementX` - surround movement with X 402 | 403 | You should REALLY read the docs if you want to use this one 404 | 405 | * [vim-align](http://github.com/tsaleh/vim-align) ([top](#top)) 406 | 407 | Align and AlignMaps lets you align statements on their equal signs, make comment boxes, align comments, align declarations, etc. 408 | 409 | * `,t=` - align on = 410 | * `,tsp` - align on whitespace 411 | * `,t,` - align on commas 412 | * `,t|` - align on vertical bars 413 | * `,acom` - align comments (C/C++) 414 | * `:AlignSEPARATORS` - align on separators 415 | * `:h align` - see help for more options 416 | 417 | * [ag.vim](http://github.com/rking/ag.vim) ([top](#top)) 418 | 419 | This plugin is a front for ag, A.K.A. 420 | [the_silver_searcher](https://github.com/ggreer/the_silver_searcher). Ag can 421 | be used as a replacement for 153% of the uses of `ack`. This plugin will allow 422 | you to run ag from vim, and shows the results in a split window. 423 | 424 | * `:Ag [options] {pattern} [{directory}]` - grep for the pattern in side directory and open result in a QuickFix window 425 | * `:h Ag` - more help about Ag 426 | 427 | Installation: 428 | 429 | * on OSX: `brew install the_silver_searcher` or `port install the_silver_searcher` 430 | * on Ubuntu: `apt-get install silversearcher-ag` 431 | 432 | * [vim-indentobject](https://github.com/austintaylor/vim-indentobject) ([top](#top)) 433 | 434 | A text object for manipulating blocks based on their indentation 435 | 436 | This is good for Python, YAML, HAML etc. 437 | 438 | Usage is similar to textobj-rubyblock, just with `i` instead of `r` 439 | 440 | * `vai` / `vii` - select indent block including / excluding the outer lines 441 | * `yai` / `yii` - yank ... 442 | 443 | * [greplace.vim](http://github.com/vim-scripts/greplace.vim) ([top](#top)) 444 | 445 | Replace a pattern across multiple files interactively 446 | 447 | Use `:Gsearch` to search for a pattern. Edit the result buffer to your 448 | liking, then `:Greplace` to incorporate your edits into the source files 449 | 450 | * `:Gsearch` - Search for a given pattern in the specified group of files 451 | and display the matches in the replace buffer. 452 | * `:Gbuffersearch` - Search for a given pattern in all the buffers in the Vim buffer list. 453 | * `:Greplace` - Incorporate the modifications from the replace buffer into 454 | the corresponding files. 455 | 456 | * [vim-airline](https://github.com/bling/vim-airline) ([top](#top)) 457 | 458 | Lean & mean status/tabline for vim that's light as air. 459 | 460 | A better replacement for vim-powerline. Optimized for speed; it loads in 461 | under a millisecond. 462 | 463 | [Install fonts](https://github.com/bling/vim-airline#integrating-with-powerline-fonts) 464 | for best results. 465 | 466 | * [splice.vim](https://github.com/sjl/splice.vim) ([top](#top)) 467 | 468 | A plugin for resolving conflicts during three-way merges. 469 | 470 | Add the following lines to ~/.gitconfig to use 471 | 472 | [merge] 473 | tool = splice 474 | 475 | [mergetool "splice"] 476 | cmd = "vim -f $BASE $LOCAL $REMOTE $MERGED -c 'SpliceInit'" 477 | trustExitCode = true 478 | 479 | Bindings: 480 | 481 | * `-g` - switch to grid view 482 | * `-l` - switch to loupe view 483 | * `-c` - switch to compare view 484 | * `-p` - switch to path view 485 | 486 | * `-o` - select the original file 487 | * `-1` - select file one 488 | * `-2` - select file two 489 | * `-r` - select the results file 490 | 491 | * `-n` - next unresolved conflict 492 | * `-N` - prev unresolved conflict 493 | 494 | * `-` - cycle layout 495 | * `-s` - toggle scrolllocking 496 | * `-d` - cycle diff combinations 497 | * `-D` - turn off all diffs 498 | 499 | * `-CC` - exits vim with error code (like :cquit). this will indicate to git that merge resolution failed 500 | * `-q` - exits vim with success; this will indicate to git that merge succeeded 501 | 502 | * `:h splice` - you should probably read it ;) 503 | 504 | * [vim-endwise](http://github.com/tpope/vim-endwise) ([top](#top)) 505 | 506 | Wisely add "end" in ruby, endfunction/endif/more in vim script, etc 507 | 508 | * [delimitMate](http://github.com/Raimondi/delimitMate) ([top](#top)) 509 | 510 | auto-completion for quotes, parens, brackets, etc. in insert mode. 511 | 512 | * [Gundo](https://github.com/sjl/gundo.vim) ([top](#top)) 513 | 514 | Homepage is [here](http://sjl.bitbucket.org/gundo.vim/) 515 | 516 | Graphs your vim undo tree in a side window. 517 | 518 | * `,u` - toggle undo window 519 | * `:h gundo.txt` - more help 520 | 521 | * [vim-dispatch](https://github.com/tpope/vim-dispatch) ([top](#top)) 522 | 523 | Asynchronous build and test dispatcher from Tpope. 524 | 525 | This plugin allows to run sync/async builds and other shell commands in 526 | background, with progress support. 527 | 528 | try `:Dispatch` from inside a Rails rspec file. `:h dispatch` for more 529 | info. 530 | 531 | * [unite.vim][unite] ([top](#top)) 532 | 533 | Search and display information from arbitrary sources like files, buffers, 534 | recently used files or registers. 535 | 536 | This plugins is to powerful to present here, read the [documentation][unite]. 537 | 538 | Just to give you the taste of it, try: 539 | 540 | `:Unite -no-start-insert -auto-preview colorscheme` 541 | 542 | Then try to navigate up and down and see what happens ;) 543 | 544 | [unite]: https://github.com/Shougo/unite.vim 545 | 546 | * [Vim Git Gutter](https://github.com/airblade/vim-gitgutter) ([top](#top)) 547 | A Vim plugin which shows a git diff in the 'gutter' (sign column). 548 | It shows whether each line has been added, modified, and where lines have been removed. 549 | 550 | ![screenshot](https://raw.github.com/airblade/vim-gitgutter/master/screenshot.png) 551 | 552 | In the screenshot above you can see: 553 | 554 | * Line 15 has been modified. 555 | * Lines 21-24 are new. 556 | * A line or lines were removed between lines 25 and 26. 557 | 558 | Commands: 559 | 560 | * `:GitGutterDisable` 561 | * `:GitGutterEnable` 562 | * `:GitGutterToggle` 563 | * `:GitGutterSignsEnable` 564 | * `:GitGutterSignsDisable` 565 | * `:GitGutterSignsToggle` 566 | * `:GitGutterLineHighlightsEnable` 567 | * `:GitGutterLineHighlightsDisable` 568 | * `:GitGutterLineHighlightsToggle` 569 | 570 | Bindings: 571 | 572 | * `]c` - jump to next hunk 573 | * `[c` - jump to previous hunk 574 | * `,hs` - stage hunk 575 | * `,hr` - revert hunk 576 | 577 | There are quite some customization options. see help. 578 | 579 | * [vim-i18n](https://github.com/stefanoverna/vim-i18n) ([top](#top)) 580 | 581 | Extracts i18n strings from source files into .yml file. 582 | 583 | * `,z` - extract selected string 584 | 585 | * [Switch](https://github.com/AndrewRadev/switch.vim) ([top](#top)) 586 | 587 | A plugin to switch segments of text with predefined replacements 588 | 589 | it will switch `"foo"` to `'foo'` to `:foo`. or `{:foo => bar}` to `{foo: bar}`, 590 | etc. See `:h switch` for more. 591 | 592 | * [Switch](https://github.com/mattn/emmet-vim) ([top](#top)) 593 | 594 | [emmet.io](http://emmet.io) like html/css workflow plugin. 595 | 596 | * [editorconfig-vim](https://github.com/editorconfig/editorconfig-vim) ([top](#top)) 597 | 598 | [.editorconfig](http://editorconfig.org) file support. 599 | 600 | [top](#top) 601 | 602 | 603 | #### Ruby/Rails support: 604 | 605 | * [vim-rails](http://github.com/tpope/vim-rails) ([top](#top)) 606 | 607 | Ruby on Rails: easy file navigation, enhanced syntax highlighting, and more 608 | 609 | * `:AV` - open "alternate" file in a new vertical split 610 | * `:AS` - open "alternate" file in a new horizontal split 611 | * `:RV` - open "related" file in a new vertical split 612 | * `:RS` - open "related" file in a new horizontal split 613 | * `:Rextract` - extract partial (select text for extraction first) 614 | * `:Rinvert` - takes a self.up migration and writes a self.down. 615 | * `gf` - remapped to take context into account. recognizes models 616 | associations, partials etc. 617 | * `:h rails` for much more info ;) 618 | 619 | * [vim-bundler](https://github.com/tpope/vim-bundler) ([top](#top)) 620 | 621 | Lightweight support for Ruby's Bundler 622 | 623 | * `gf` when standing over a gem name in a Gemfile will go to gem's directory 624 | * `:Bopen NAME` does bundle open NAME - opens gem NAME's lib diretory in the current window. 625 | * `:Bundle` - runs bundler 626 | 627 | * [vim-rake](https://github.com/tpope/vim-rake) ([top](#top)) 628 | 629 | TBD 630 | 631 | * [vim-textobj-rubyblock](https://github.com/nelstrom/vim-textobj-rubyblock) ([top](#top)) 632 | 633 | A custom text object for selecting ruby blocks. 634 | 635 | In other words it teaches vim to understand what is ruby block, just like vim already understands what is word, paragraph, sentence etc. 636 | 637 | It works with begin/end, if/else/end etc. 638 | 639 | * `var` - select ruby block around the cursor including begin/end 640 | * `vir` - select insides of a ruby block around the cursor not including begin/end 641 | * `dar` - delete ruby block around the cursor 642 | * etc... 643 | 644 | Some 'trickier' usage patterns. 645 | 646 | * `varar` - select the ruby block that is around the ruby block that is around the cursor. including begin/end 647 | * `vararir` - select insides of the ruby block that is around the ruby block that is around the cursor. not including begin/end 648 | * ... 649 | 650 | * [vim-ruby-refactoring](https://github.com/ecomba/vim-ruby-refactoring) ([top](#top)) 651 | 652 | Refactoring tool for Ruby in vim! 653 | 654 | * `,rap` :RAddParameter - Add Parameter(s) to a method 655 | * `,rcpc` :RConvertPostConditional - Convert Post Conditional 656 | * `,rel` :RExtractLet - Extract to Let (Rspec) 657 | * `,rec` :RExtractConstant - Extract Constant (visual selection) 658 | * `,relv` :RExtractLocalVariable - Extract Local Variable (visual selection) 659 | * `,rit` :RInlineTemp - Inline Temp. replace temp parameter by direct function call 660 | * `,rrlv` :RRenameLocalVariable - Rename Local Variable (visual selection/variable under the cursor 661 | * `,rriv` :RRenameInstanceVariable - Rename Instance Variable (visual selection) 662 | * `,rem` :RExtractMethod - Extract Method (visual selection) 663 | 664 | * [blockle.vim](https://github.com/vim-scripts/blockle.vim) ([top](#top)) 665 | 666 | Toggle ruby blocks style, e.g `{}` to `do .. end` 667 | 668 | * `,B` - toggle block style 669 | 670 | > NOTE: thre is an unfortunate interaction with delimitMate, the opening 671 | > brase gets completed. i.e. you get `{} ... }` 672 | 673 | * [apidock.vim](https://github.com/alexandrov/apidock.vim) ([top](#top)) 674 | 675 | Vim plugin that searches http://apidock.com Ruby, Rails, and RSpec docs from within Vim. 676 | 677 | * `RR` - Search the Rails docs for the word under the cursor. 678 | * `RB` - Search the Ruby docs for the word under the cursor. 679 | * `RS` - Search the RSpec docs for the word under the cursor. 680 | 681 | * [vim-rspec](https://github.com/josemarluedke/vim-rspec) ([top](#top)) 682 | 683 | Lightweight Rspec runner for Vim. 684 | 685 | Commands are self explanatory: 686 | 687 | * `:call RunCurrentSpecFile()` 688 | * `:call RunNearestSpec()` 689 | * `:call RunLastSpec()` 690 | 691 | Bindings: 692 | 693 | * `,r` - `RunNearestSpec` 694 | 695 | [top](#top) 696 | 697 | 698 | #### Org mode and support plugins 699 | 700 | Vim now has support for Emacs' [Org mode](http://orgmode.org/) provided by the 701 | [VimOrganizer](#VimOrganizer) plugin. 702 | 703 | Below you will also find a couple of plugins that support it, but can be also 704 | used intependently. 705 | 706 | * [calendar.vim](https://github.com/vim-scripts/calendar.vim--Matsumoto) ([top](#top)) 707 | 708 | Calendar support w/o calling external programs. 709 | 710 | * Commands: 711 | * `:Calendar` - open calendar 712 | * `:Calendar 2012 8` - open calendar for 2012-08 713 | * `:CalendarH` - open horizontal calendar 714 | * Bindings: 715 | * `,cal` - `:Calendar` 716 | * `,caL` - `:CalendarH` 717 | 718 | * [NrrwRgn](https://github.com/chrisbra/NrrwRgn) ([top](#top)) 719 | 720 | A Narrow Region Plugin (similar to Emacs) 721 | 722 | Allows to open selected text in a separate buffer for editing preserving 723 | the rest of the file around it. 724 | 725 | * Commands 726 | * `[range]:NR` - open selection or range in a buffer. write the buffer when done 727 | * `:h NrrwRgn` - read the help ;) 728 | 729 | * [utl.vim](https://github.com/vim-scripts/utl.vim) ([top](#top)) 730 | 731 | Universal Text Linking plugin allow to open urls from text files. 732 | 733 | `:h utl_usr` to read the help. 734 | 735 | Bindings: 736 | 737 | * `,o` - types `:Utl`. you still need to press enter to `o`pen url. This way 738 | it allows to type other commands if needed. 739 | 740 | * [VimOrganizer](https://github.com/hsitz/VimOrganizer) ([top](#top)) 741 | 742 | VimOrganizer is partly a clone of Emacs' Org-mode, and partly a front end 743 | to Org-mode itself. Do Org in Vim. 744 | 745 | Some bindings: 746 | 747 | * `tab` - cycle visibility of single headline/subtree. 748 | * `,1` - show level 1 only 749 | * `,2` - show level 1 only 750 | * ... 751 | * In normal mode 752 | * `Shift-Enter` - cycle TODO state 753 | * `Enter` - add item of same level 754 | * insert mode 755 | * `Shift-Enter` - add item of same level 756 | * Both modes 757 | * `Ctrl-Enter` - add item of lover level 758 | * `Shift-Ctrl-Enter` - add item of higher level 759 | * `,dd` - add DEADLINE 760 | * `,ds` - add SCHEDULED 761 | * `,dc` - add CLOSED 762 | * `,dt` - add a timestamp 763 | 764 | Datetime prompt works mostly like the one in emacs org mode. See docs [here](http://orgmode.org/manual/The-date_002ftime-prompt.html#The-date_002ftime-prompt) 765 | 766 | Its too big to give much userful information here. open any `.org` file to start using it. read the help: 767 | 768 | :h VimOrganizer 769 | 770 | You can find cheat sheet [here](https://github.com/hsitz/VimOrganizer/blob/master/VimOrganizerCheatsheet.org) 771 | 772 | Working with TODO help is [here](http://orgmode.org/manual/TODO-Items.html) 773 | 774 | Org mode site is [here](http://orgmode.org/] 775 | 776 | [top](#top) 777 | 778 | 779 | #### Color themes 780 | 781 | * [vim-colors-solarized](http://github.com/altercation/vim-colors-solarized) ([top](#top)) 782 | 783 | precision colorscheme for the vim text editor 784 | 785 | * [vim-vividchalk](http://github.com/tpope/vim-vividchalk) ([top](#top)) 786 | 787 | A colorscheme strangely reminiscent of Vibrant Ink for a certain OS X editor 788 | 789 | 790 | [top](#top) 791 | 792 | 793 | #### Syntax plugins 794 | 795 | * [vim-tmux](http://tmux.sourceforge.net/) 796 | 797 | syntax suupport (extracted from tmux-1.1) 798 | 799 | * [Puppet-Syntax-Highlighting](https://github.com/vim-scripts/Puppet-Syntax-Highlighting) 800 | 801 | Syntax Highlighting for Puppet 802 | 803 | * [JSON.vim](https://github.com/vim-scripts/JSON.vim) 804 | 805 | synntax highlighting file for JSON 806 | 807 | * [vim-cucumber](http://github.com/tpope/vim-cucumber) 808 | 809 | syntax, indent, etc. for [Cucumber](http://github.com/aslakhellesoy/cucumber) 810 | 811 | * [vim-haml](http://github.com/tpope/vim-haml) 812 | 813 | [HAML](http://haml-lang.com/) syntax etc. 814 | 815 | * [vim-markdown](http://github.com/plasticboy/vim-markdown) 816 | 817 | syntax for [Markdown](http://daringfireball.net/projects/markdown/) 818 | 819 | * [vim-coffee-script](http://github.com/kchmck/vim-coffee-script) 820 | 821 | syntax for [Coffee script](http://jashkenas.github.com/coffee-script/) 822 | 823 | * [jade.vim](https://github.com/vim-scripts/jade.vim) 824 | 825 | syntax for [Jade](http://jade-lang.com/) 826 | 827 | * [vim-slim](https://github.com/slim-template/vim-slim) 828 | 829 | [Slim](http://slim-lang.com/) syntax support. 830 | 831 | * stylus 832 | 833 | TBD 834 | 835 | * [vim-gocode](https://github.com/Blackrush/vim-gocode) 836 | 837 | Golang syntax support 838 | 839 | * [Dockerfile.vim](https://github.com/ekalinin/Dockerfile.vim) 840 | 841 | Syntax for [Docker](http://www.docker.io) build files. 842 | 843 | * [vim-less](https://github.com/groenewege/vim-less) 844 | 845 | Syntax for [LESS](http://lesscss.org/). 846 | 847 | * [vim-mustache-handlebars](https://github.com/mustache/vim-mustache-handlebars) 848 | 849 | Syntax for [mustache](http://mustache.github.io) and 850 | [handlebars](http://handlebarsjs.com) templates. 851 | 852 | * Clojure syntax support by the following plugins: 853 | 854 | [vim-clojure-static](http://github.com/guns/vim-clojure-static) 855 | [vim-fireplace](http://github.com/tpope/vim-fireplace) 856 | [rainbow_parentheses](http://github.com/kien/rainbow_parentheses.vim) 857 | 858 | rainbow_parentheses can be useful to other languages as well ;) 859 | 860 | * [Rust](http://www.rust-lang.org) support. 861 | 862 | using files from [rust repository](https://github.com/rust-lang/rust) 863 | 864 | 865 | [top](#top) 866 | 867 | 868 | #### "Support" and "minor" plugins 869 | 870 | * [vim-textobj-user](https://github.com/kana/vim-textobj-user) 871 | 872 | Support for user-defined text objects 873 | 874 | * [vim-repeat](http://github.com/tpope/vim-repeat) 875 | 876 | Use the repeat command "." with supported plugins 877 | 878 | * [vim-space](http://github.com/scrooloose/vim-space) 879 | 880 | Smart Space key for Vim 881 | 882 | press SPACE to repeat last motion command 883 | 884 | * [vim-gist](http://github.com/mattn/gist-vim) 885 | 886 | create gists on github 887 | 888 | - `:Gist` - gist the buffer 889 | - `:'<,'>Gist` - gist selection 890 | - `:Gist -p` - private gist 891 | - :h Gist.vim 892 | 893 | 894 | [top](#top) 895 | 896 | 897 | ### Misc Bindings 898 | 899 | The following is a list of commands and key bindings that I personally find interesting 900 | stored for easy refreshing my memory of them. there is no much 'system' to it, just 901 | randomly chosen bits of vim goodness. 902 | 903 | * `]p` paste with autoindent. 904 | * `ga` print ascii value of character under the cursor 905 | * `g#` like "#", but without using "\<" and "\>" 906 | * `g<` display previous command output 907 | * `zt` scroll cursor line to top 908 | * `zz` scroll cursor line to center 909 | * `zb` scroll cursor line to bottom 910 | * `CTRL-W x` exchange current window with n-th window (or next if no count given) 911 | * `gv` reselect last selection 912 | * `gt` next tab 913 | * `gT` prev tab 914 | * `ci` change inside delimiters 915 | * `di` delete inside delimiters 916 | * `@@` execute last macro 917 | * `"xyy` copy line into `x` register (replace x with any other) 918 | * `x` while in insert mote will paste content of register x (replace x with any other) 919 | * `"xp` paste from register x 920 | * `:reg` Display the contents of all numbered and named registers. 921 | 922 | 923 | [top](#top) 924 | 925 | 926 | #### Russian Translit Layout support 927 | 928 | There is ~/.vim/bindings-ru-translit.vim file. 929 | 930 | OSX has a nice russian translit keyboard layout which I use when I need to 931 | write any russian text. The problem is that once I go to the normal mode 932 | nothing works. This is an attempt to make vim at least partially useful when 933 | the kerboard is in russioan translit mode and not in the default US mode. The 934 | idea is to remap the russian characters to the english characters that 935 | correspond to the same keyboard key. And a couple of userful multy-key 936 | combinations. 937 | 938 | Similar can be done for other keyboard layouts, your pull requests are 939 | welcome ;). 940 | 941 | To use this feature: just include the file from your ~/.local.vim: 942 | 943 | source ~/.vim/bindings-ru-translit.vim 944 | 945 | [top](#top) 946 | 947 | 948 | #### writer.vim 949 | 950 | My attempt to make vim look like iWriter ;) 951 | You can read about the details on [our blog][blog_writer]. 952 | 953 | In short, just do `:so ~/.vim/writer.vim` when you are going to do some plain 954 | text writing. 955 | 956 | [blog_writer]: http://astrails.com/blog/2013/8/12/writing-markdown-with-style-in-vim 957 | 958 | [top](#top) 959 | 960 | #### Copyright 961 | 962 | © 2012 [Vitaly Kushner](mailto:vitaly@astrails.com) 963 | -------------------------------------------------------------------------------- /after.vim: -------------------------------------------------------------------------------- 1 | " This file is loaded from after/plugin/after.vim 2 | " which means it loads AFTER the rest of the plugins 3 | 4 | NeoBundleCheck 5 | NeoBundleDocs 6 | 7 | source ~/.vim/bindings.vim 8 | source ~/.vim/plugins-override.vim 9 | 10 | if filereadable(expand("~/.local-after.vim")) 11 | echo "~/.local-after.vim is deprecated, please move it to ~/.vimrc.after" 12 | source ~/.local-after.vim 13 | endif 14 | 15 | if filereadable(expand("~/.vimrc.after")) 16 | source ~/.vimrc.after 17 | endif 18 | 19 | if has('gui_running') 20 | if filereadable(expand("~/.local-gui.vim")) 21 | echo "~/.local-gui.vim is deprecated, please move it to ~/.gvimrc.after" 22 | source ~/.local-gui.vim 23 | endif 24 | 25 | if filereadable(expand("~/.gvimrc.after")) 26 | source ~/.gvimrc.after 27 | endif 28 | end 29 | -------------------------------------------------------------------------------- /after/plugin/after.vim: -------------------------------------------------------------------------------- 1 | " after/plugin/after.vim can get called multiple times when new bundles are 2 | " installed. we want to only call our scripts once 3 | if (exists("g:after_vim_loaded") && g:after_vim_loaded) || &cp 4 | finish 5 | endif 6 | let g:after_vim_loaded = 1 7 | source ~/.vim/after.vim 8 | -------------------------------------------------------------------------------- /before.vim: -------------------------------------------------------------------------------- 1 | " this file is loaded BEFORE plugins 2 | if filereadable(expand("~/.local-before.vim")) 3 | echo "~/.local-before.vim is deprecated, please move it to ~/.vimrc.before" 4 | source ~/.local-before.vim 5 | endif 6 | 7 | if filereadable(expand("~/.vimrc.before")) 8 | source ~/.vimrc.before 9 | endif 10 | 11 | if has('gui_running') 12 | if filereadable(expand("~/.gvimrc.before")) 13 | source ~/.gvimrc.before 14 | endif 15 | endif 16 | -------------------------------------------------------------------------------- /bindings.vim: -------------------------------------------------------------------------------- 1 | " Don't use Ex mode, use Q for formatting 2 | map Q gq 3 | 4 | "make Y consistent with C and D 5 | nnoremap Y y$ 6 | 7 | " toggle highlight trailing whitespace 8 | nmap s :set nolist! 9 | 10 | " Ctrl-N to disable search match highlight 11 | nmap :silent noh 12 | 13 | " Ctrol-E to switch between 2 last buffers 14 | nmap :b# 15 | 16 | " ,e to fast finding files. just type beginning of a name and hit TAB 17 | nmap e :e **/ 18 | 19 | " Make shift-insert work like in Xterm 20 | map 21 | map! 22 | 23 | " ,n to get the next location (compilation errors, grep etc) 24 | nmap n :cn 25 | nmap N :cp 26 | 27 | " ,d to diffupdate 28 | nmap d :diffupdate 29 | nmap dp :diffput 30 | nmap dg :diffget 31 | 32 | " driving me insane this thing 33 | command Q q 34 | command Qa qa 35 | command QA qa 36 | command -nargs=* -complete=file W w 37 | command -nargs=* -complete=file E e 38 | 39 | " center display after searching 40 | nnoremap n nzz 41 | nnoremap N Nzz 42 | nnoremap * *zz 43 | nnoremap # #zz 44 | nnoremap g* g*zz 45 | nnoremap g# g#z 46 | 47 | """"""""""" awesome stuff from vimbits.com 48 | 49 | " keep selection after in/outdent 50 | vnoremap < >gv 52 | 53 | " better navigation of wrapped lines 54 | nnoremap j gj 55 | nnoremap k gk 56 | 57 | " easier increment/decrement 58 | nnoremap + 59 | nnoremap - 60 | 61 | " remove trailing spaces 62 | nnoremap W :%s/\s\+$//:let @/='' 63 | 64 | " vim-tmux-navigator 65 | " for custom bindings uncomment 'tmux_navigator_no_mappings line in plugins.vim 66 | "nnoremap :TmuxNavigateLeft 67 | "nnoremap :TmuxNavigateDown 68 | "nnoremap :TmuxNavigateUp 69 | "nnoremap :TmuxNavigateRight 70 | "nnoremap :TmuxNavigatePrevious 71 | 72 | " fast expand current file's directory in command mode 73 | cnoremap %% =expand('%:h').'/' 74 | -------------------------------------------------------------------------------- /bundles.vim: -------------------------------------------------------------------------------- 1 | set nocompatible 2 | filetype off 3 | 4 | if has('vim_starting') 5 | set runtimepath+=~/.vim/bundle/neobundle.vim/ 6 | endif 7 | 8 | call neobundle#begin(expand('~/.vim/bundle/')) 9 | 10 | " plugin management 11 | NeoBundleFetch 'Shougo/neobundle.vim' 12 | 13 | " file tree 14 | NeoBundle 'scrooloose/nerdtree' 15 | " file tree and tabs interaction 16 | NeoBundle 'jistr/vim-nerdtree-tabs' 17 | " commenting 18 | NeoBundle 'scrooloose/nerdcommenter' 19 | " fuzzy file open 20 | NeoBundle 'kien/ctrlp.vim' 21 | " popup completion menu 22 | NeoBundle 'AutoComplPop' 23 | " tags list navigation 24 | NeoBundle 'taglist.vim' 25 | " yank history 26 | NeoBundle 'YankRing.vim' 27 | " git integration 28 | NeoBundle 'tpope/vim-fugitive' 29 | " syntax checking on save 30 | NeoBundle 'scrooloose/syntastic' 31 | " TextMate-style snippets 32 | NeoBundle 'msanders/snipmate.vim' 33 | " manipulation of surraunding parens, quotes, etc. 34 | NeoBundle 'tpope/vim-surround' 35 | " vertical alignment tool 36 | NeoBundle 'tsaleh/vim-align' 37 | " 'ag' searching integration 38 | NeoBundle 'rking/ag.vim' 39 | " text object based on indent level (ai, ii) 40 | NeoBundle 'austintaylor/vim-indentobject' 41 | " global search & replace 42 | NeoBundle 'greplace.vim' 43 | " better looking statusline 44 | NeoBundle 'vim-airline/vim-airline' 45 | NeoBundle 'vim-airline/vim-airline-themes' 46 | " plugin for resolving three-way merge conflicts 47 | NeoBundle 'sjl/splice.vim' 48 | " plugin for visually displaying indent levels 49 | NeoBundle 'Indent-Guides' 50 | " end certain structures automatically, e.g. begin/end etc. 51 | NeoBundle 'tpope/vim-endwise' 52 | " automatic closing of quotes, parenthesis, brackets, etc. 53 | NeoBundle 'Raimondi/delimitMate' 54 | " calendar, duh! 55 | NeoBundle 'calendar.vim--Matsumoto' 56 | " A Narrow Region Plugin (similar to Emacs) 57 | "NeoBundle 'chrisbra/NrrwRgn' 58 | " url based hyperlinks for text files 59 | NeoBundle 'utl.vim' 60 | " A clone of Emacs' Org-mode for Vim 61 | NeoBundle 'hsitz/VimOrganizer' 62 | " visual undo tree 63 | NeoBundle 'sjl/gundo.vim' 64 | " switch segments of text with predefined replacements. e.g. '' -> "" 65 | NeoBundle 'AndrewRadev/switch.vim' 66 | " async external commands with output in vim 67 | NeoBundle 'tpope/vim-dispatch' 68 | " git diff in the gutter (sign column) and stages/reverts hunks 69 | NeoBundle 'airblade/vim-gitgutter' 70 | " hi-speed html coding 71 | NeoBundle 'mattn/emmet-vim' 72 | " editorconfig.org support 73 | NeoBundle 'editorconfig/editorconfig-vim' 74 | " tmux + vim = love 75 | NeoBundle 'christoomey/vim-tmux-navigator' 76 | 77 | " Ruby/Rails 78 | 79 | " rails support 80 | NeoBundle 'tpope/vim-rails' 81 | " bundler integration (e.g. :Bopen) 82 | NeoBundle 'tpope/vim-bundler' 83 | " rake integration 84 | NeoBundle 'tpope/vim-rake' 85 | " A custom text object for selecting ruby blocks (ar/ir) 86 | NeoBundle 'nelstrom/vim-textobj-rubyblock' 87 | " ruby refactoring 88 | NeoBundle 'ecomba/vim-ruby-refactoring' 89 | " apidock.com docs integration 90 | NeoBundle 'apidock.vim' 91 | " toggle ruby blocks style 92 | NeoBundle 'vim-scripts/blockle.vim' 93 | " lightweight Rspec runner for Vim 94 | NeoBundle 'josemarluedke/vim-rspec' 95 | " i18n extraction plugin 96 | NeoBundle 'stefanoverna/vim-i18n' 97 | 98 | " color themes 99 | NeoBundle 'altercation/vim-colors-solarized' 100 | NeoBundle 'tpope/vim-vividchalk' 101 | NeoBundle 'chriskempson/tomorrow-theme', {'rtp': 'vim/'} 102 | 103 | " syntax support 104 | NeoBundle 'vim-ruby/vim-ruby' 105 | NeoBundle 'tsaleh/vim-tmux' 106 | NeoBundle 'Puppet-Syntax-Highlighting' 107 | NeoBundle 'JSON.vim' 108 | NeoBundle 'tpope/vim-cucumber' 109 | NeoBundle 'tpope/vim-haml' 110 | NeoBundle 'tpope/vim-markdown' 111 | NeoBundle 'kchmck/vim-coffee-script' 112 | NeoBundle 'vitaly/vim-syntastic-coffee' 113 | NeoBundle 'vim-scripts/jade.vim' 114 | NeoBundle 'wavded/vim-stylus' 115 | NeoBundle 'slim-template/vim-slim' 116 | NeoBundle 'elixir-lang/vim-elixir' 117 | NeoBundle 'Blackrush/vim-gocode' 118 | NeoBundle 'ekalinin/Dockerfile.vim' 119 | NeoBundle 'groenewege/vim-less' 120 | NeoBundle 'mustache/vim-mustache-handlebars' 121 | NeoBundle 'mtscout6/vim-cjsx' 122 | NeoBundle 'vitaly/vim-literate-coffeescript' 123 | NeoBundle 'rust-lang/rust', {'rtp': 'src/etc/vim/'} 124 | NeoBundle 'pangloss/vim-javascript' 125 | NeoBundle 'mxw/vim-jsx' 126 | 127 | " clojure 128 | "NeoBundle 'VimClojure' 129 | NeoBundle 'guns/vim-clojure-static' 130 | NeoBundle 'tpope/vim-fireplace' 131 | NeoBundle 'kien/rainbow_parentheses.vim' 132 | 133 | " Support and minor 134 | 135 | " Support for user-defined text objects 136 | NeoBundle 'kana/vim-textobj-user' 137 | " replacement for the repeat mapping (.) to support plugins 138 | NeoBundle 'tpope/vim-repeat' 139 | " hide .gitignore-d files from vim 140 | NeoBundle 'vitaly/vim-gitignore' 141 | " repeat motion with 142 | NeoBundle 'scrooloose/vim-space' 143 | " Github's gist support 144 | NeoBundle 'mattn/gist-vim' 145 | " web APIs support 146 | NeoBundle 'mattn/webapi-vim' 147 | 148 | "NeoBundle 'ShowMarks' 149 | "NeoBundle 'tpope/vim-unimpaired' 150 | "NeoBundle 'reinh/vim-makegreen' 151 | 152 | NeoBundle 'Shougo/vimproc.vim', { 153 | \ 'build' : { 154 | \ 'windows' : 'tools\\update-dll-mingw', 155 | \ 'cygwin' : 'make -f make_cygwin.mak', 156 | \ 'mac' : 'make -f make_mac.mak', 157 | \ 'linux' : 'make', 158 | \ 'unix' : 'gmake', 159 | \ }, 160 | \ } 161 | NeoBundle 'Shougo/unite.vim' 162 | NeoBundle 'Shougo/unite-outline' 163 | NeoBundle 'ujihisa/unite-colorscheme' 164 | 165 | if filereadable(expand("~/.vimrc.bundles")) 166 | source ~/.vimrc.bundles 167 | endif 168 | 169 | call neobundle#end() 170 | 171 | filetype plugin indent on 172 | 173 | -------------------------------------------------------------------------------- /colors/buttercream.vim: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/astrails/dotvim/226132e280ac13273c89a76e47ee5b2a08bfb720/colors/buttercream.vim -------------------------------------------------------------------------------- /colors/colorzone.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Ricky Wu 3 | " Last Change: 2009 Jun 16 4 | " Version: 0.1 5 | 6 | " This color scheme uses a light grey background. 7 | " Based on "tango-morning" and "wargreycolorscheme" color scheme 8 | " Tango color palette : http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines#Color_Palette 9 | " The Terminal colors and GUI colors are diffrent defined. 10 | " Optimized for PLI and vim syntax 11 | 12 | " First remove all existing highlighting. 13 | set background=light 14 | if version > 580 15 | " no guarantees for version 5.8 and below, but this makes it stop 16 | " complaining 17 | hi clear 18 | if exists("syntax_on") 19 | syntax reset 20 | endif 21 | endif 22 | let colors_name = "colorzone" 23 | 24 | "High Light For Normal 25 | hi Normal guifg=#2e3436 guibg=#eeeeec 26 | 27 | " Boolean constants: true FALSE ... 28 | hi Boolean ctermfg=red guifg=red 29 | 30 | " Character constants: 'A' 'b' ... 31 | hi Character ctermfg=magenta guifg=magenta 32 | 33 | " The condition-keywords: if switch endif ... 34 | hi Conditional ctermfg=darkcyan guifg=#4e9a06 35 | 36 | hi IncSearch ctermfg=yellow ctermbg=green gui=reverse 37 | 38 | hi ModeMsg ctermfg=red guifg=red 39 | 40 | " Any other keywords: native assert ... 41 | hi Keyword ctermfg=darkcyan guifg=#4e9a06 42 | 43 | hi StatusLine ctermbg=lightgrey ctermfg=green guibg=#2e3436 guifg=grey90 gui=none 44 | 45 | hi StatusLineNC ctermbg=darkgrey ctermfg=green guibg=#2e3436 guifg=darkgrey gui=none 46 | 47 | hi VertSplit cterm=none ctermfg=darkgray gui=reverse 48 | 49 | hi Visual cterm=reverse gui=none guibg=#6b8e23 guifg=white 50 | 51 | hi VisualNOS cterm=underline gui=underline 52 | 53 | hi Cursor guibg=khaki guibg=#0080f0 guifg=white 54 | 55 | " [IM mode] The characters under the cursor 56 | hi CursorIM ctermbg=none ctermfg=none 57 | 58 | " Any preprocessors like '#define' in C/C++ language 59 | hi Macro ctermfg=darkmagenta guifg=darkmagenta 60 | 61 | " The keywords recongnized as name space: public internal ... 62 | hi NameSpace ctermfg=darkgreen guifg=darkgreen 63 | 64 | " Any condition-preprocessors: #if #elseif ... 65 | hi PreCondit ctermfg=cyan guifg=#4169e1 66 | 67 | " The repeat-keywords: for each in ... 68 | hi Repeat ctermfg=cyan guifg=#4e9a06 69 | 70 | hi lCursor guibg=#0080f0 guifg=white 71 | 72 | hi Directory ctermfg=darkcyan guifg=#3465a4 73 | 74 | hi LineNr ctermfg=brown guifg=#8f5902 75 | 76 | hi MatchParen ctermfg=brown guibg=#204a87 guifg=#eeeeec 77 | 78 | hi MoreMsg ctermfg=darkgreen guifg=#4e9a06 79 | 80 | hi NonText ctermfg=black guifg=#2e3436 guibg=#eeeeec 81 | 82 | hi PmenuSel ctermfg=green ctermbg=none guibg=#ffa500 guifg=black 83 | 84 | "lightskyblue 85 | "hi Pmenu ctermfg=blue ctermbg=none guibg=#87ceeb guifg=black 86 | "olivedrab 87 | hi Pmenu ctermfg=blue ctermbg=none guibg=#6b8e23 guifg=white 88 | 89 | hi PmenuSbar ctermbg=none guibg=#c0c0c0 guifg=white 90 | 91 | hi PmenuThumb ctermfg=darkcyan guibg=#c0c0c0 guifg=white 92 | 93 | hi Question ctermfg=green guifg=#4e9a06 94 | 95 | hi Search ctermfg=white ctermbg=LightRed guibg=#ff4500 guifg=white 96 | "hi Search ctermfg=white ctermbg=LightRed guibg=#ff69b4 guifg=white 97 | 98 | hi SpecialKey ctermfg=darkcyan guifg=#3465a4 99 | 100 | hi Title ctermfg=green guifg=#4e9a06 101 | 102 | hi WarningMsg ctermfg=yellow guifg=#cc0000 103 | 104 | hi WildMenu ctermfg=black ctermbg=darkcyan guibg=#edd400 guifg=#888a85 105 | 106 | hi Folded ctermfg=grey ctermbg=none guibg=#d3d7cf guifg=#204a87 107 | 108 | hi FoldColumn ctermfg=grey ctermbg=none guibg=#888a85 guifg=#204a87 109 | 110 | hi DiffAdd ctermfg=green ctermbg=darkgray guibg=#204a87 guifg=#eeeeec 111 | 112 | hi DiffChange ctermfg=yellow ctermbg=darkgrey guibg=#e9b96e 113 | 114 | hi DiffDelete ctermfg=black ctermbg=darkgrey guifg=#3465a4 guibg=#d3d7cf 115 | 116 | hi DiffText ctermfg=blue ctermbg=darkgrey guibg=#fce94f 117 | 118 | hi CursorLine ctermfg=none guibg=#555753 119 | 120 | " The column that the cursor is in 121 | hi CursorColumn ctermfg=none ctermbg=none guibg=#555753 122 | 123 | " The word that does not recognized by the spellchecker 124 | hi SpellBad ctermfg=darkred guifg=darkred 125 | 126 | " The word should starts with a capital 127 | hi SpellCap ctermfg=green guifg=green 128 | 129 | " The word is recognized by the spellchecker and used in another region 130 | hi SpellLocal ctermfg=brown guifg=brown 131 | 132 | " The word is recognized by the spellchecker and hardly ever used 133 | hi SpellRare ctermfg=yellow guifg=yellow 134 | 135 | " The name of functions methods and classes ... 136 | hi Function ctermfg=blue guifg=blue 137 | 138 | " Any preprocessors like '#define' in C/C++ language 139 | hi Define ctermfg=blue guifg=blue 140 | 141 | " Any debugging statement 142 | hi Debug ctermfg=darkred guifg=darkred 143 | 144 | " Colors for syntax highlighting 145 | hi Comment ctermfg=lightgrey guifg=#888a87 146 | 147 | " Any constants 148 | hi Constant ctermfg=red guifg=#ce5c00 149 | 150 | hi Identifier ctermfg=Yellow gui=none guifg=#000000 151 | 152 | hi Statement ctermfg=Lightgreen gui=none guifg=#4e9a06 153 | 154 | " The special characters within a constant 155 | hi SpecialChar ctermfg=red guifg=red 156 | 157 | " The special things within the comment 158 | hi SpecialComment ctermfg=darkgray guifg=darkgray 159 | 160 | hi PreProc ctermfg=LightCyan guifg=#dc143c 161 | 162 | hi Type ctermfg=green gui=none guifg=#4e9a06 163 | 164 | hi Special ctermfg=darkmagenta guifg=#ce5c00 guibg=#eeeeec 165 | 166 | hi Underlined cterm=underline ctermfg=blue guifg=#204a87 167 | 168 | hi Ignore ctermfg=grey ctermbg=darkgrey guifg=#555753 169 | 170 | hi Error ctermfg=darkred ctermbg=darkgray guibg=#cc0000 guifg=#eeeeec 171 | 172 | " Groups used in the 'highlight' and 'guicursor' options default value. 173 | hi ErrorMsg ctermfg=darkred ctermbg=darkgray guibg=#cc0000 guifg=#eeeeec 174 | 175 | hi Todo ctermfg=yellow ctermbg=none guibg=#fce94f guifg=#204a87 176 | 177 | " The preprocessors for indicating the included sources 178 | hi Include ctermfg=red guifg=#ff7f50 179 | 180 | " The exception-keywords: throws try finally ... 181 | hi Exception ctermfg=darkmagenta guifg=darkmagenta 182 | 183 | " The floating point constants: 6.67e-11 184 | hi Float ctermfg=red guifg=red 185 | 186 | hi Label ctermfg=yellow guifg=#b8860b 187 | 188 | hi Delimiter ctermfg=yellow guifg=#4e9a06 189 | 190 | hi Number ctermfg=red guifg=#ff00ff 191 | 192 | hi Operator ctermfg=red guifg=#ff0000 193 | 194 | hi Builtin ctermfg=Lightblue guifg=#1e90ff 195 | 196 | hi String ctermfg=white guifg=#ff4500 197 | 198 | hi SQL_Statement ctermfg=LightMagenta guifg=#9400d3 199 | 200 | hi CICS_Statement ctermfg=LightMagenta guifg=#4e9a06 201 | 202 | " [Table line] Not active table page label 203 | hi TabLine ctermfg=red guifg=red 204 | 205 | " [Table line] Where there are no labels 206 | hi TabLineFill ctermfg=gray ctermbg=blue guifg=gray guibg=blue 207 | 208 | " [Table line] Active table page label 209 | hi TabLineFillSel ctermfg=blue guifg=blue 210 | 211 | " Any tags which can use on 212 | hi Tag ctermfg=darkmagenta guifg=darkmagenta 213 | 214 | " vim: sw=2 215 | -------------------------------------------------------------------------------- /find-ruby.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ '/opt/local/bin/vim' = `which vim` -a -e /opt/local/bin/ruby ]; then 4 | echo /opt/local/bin/ruby 5 | elif [ -e '/usr/bin/ruby' ]; then 6 | echo /usr/bin/ruby 7 | else 8 | which ruby 9 | fi 10 | -------------------------------------------------------------------------------- /ftplugin/bash.vim: -------------------------------------------------------------------------------- 1 | set sw=2 2 | set ts=2 3 | set et 4 | -------------------------------------------------------------------------------- /ftplugin/coffee.vim: -------------------------------------------------------------------------------- 1 | set sw=2 2 | set ts=2 3 | set et -------------------------------------------------------------------------------- /ftplugin/erlang.vim: -------------------------------------------------------------------------------- 1 | set sw=2 2 | set ts=2 3 | set et 4 | -------------------------------------------------------------------------------- /ftplugin/haml.vim: -------------------------------------------------------------------------------- 1 | set sw=2 2 | set ts=2 3 | set et 4 | set fdi=/ 5 | -------------------------------------------------------------------------------- /ftplugin/json.vim: -------------------------------------------------------------------------------- 1 | set sw=2 2 | set ts=2 3 | set et 4 | -------------------------------------------------------------------------------- /ftplugin/markdown.vim: -------------------------------------------------------------------------------- 1 | set tw=79 2 | set et 3 | set ts=2 4 | set sw=2 5 | -------------------------------------------------------------------------------- /ftplugin/pool.vim: -------------------------------------------------------------------------------- 1 | set syntax=ruby 2 | set sw=2 3 | set ts=2 4 | set et 5 | 6 | -------------------------------------------------------------------------------- /ftplugin/ruby.vim: -------------------------------------------------------------------------------- 1 | set sw=2 2 | set ts=2 3 | set et 4 | set iskeyword+=!,?,= 5 | function! s:InsertInterpolation() 6 | let before = getline('.')[col('^'):col('.')] 7 | let after = getline('.')[col('.'):col('$')] 8 | " check that we're in double-quotes string 9 | if before =~# '"' && after =~# '"' 10 | execute "normal! a{}\h" 11 | endif 12 | endfunction 13 | inoremap # #:call InsertInterpolation()a 14 | 15 | " Surround with # 16 | if exists("g:loaded_surround") 17 | let b:surround_{char2nr('#')} = "#{\r}" 18 | endif 19 | -------------------------------------------------------------------------------- /ftplugin/sh.vim: -------------------------------------------------------------------------------- 1 | set sw=2 2 | set ts=2 3 | set et 4 | -------------------------------------------------------------------------------- /global.vim: -------------------------------------------------------------------------------- 1 | " be 'modern' 2 | set nocompatible 3 | syntax on 4 | filetype plugin indent on 5 | 6 | " prevent vim from adding that stupid empty line at the end of every file 7 | set noeol 8 | set binary 9 | 10 | " utf-8/unicode support 11 | " requires Vim to be compiled with Multibyte support, you can check that by 12 | " running `vim --version` and checking for +multi_byte. 13 | if has('multi_byte') 14 | scriptencoding utf-8 15 | set encoding=utf-8 16 | end 17 | 18 | " presentation settings 19 | set number " precede each line with its line number 20 | set numberwidth=3 " number of culumns for line numbers 21 | set textwidth=0 " Do not wrap words (insert) 22 | set nowrap " Do not wrap words (view) 23 | set showcmd " Show (partial) command in status line. 24 | set showmatch " Show matching brackets. 25 | set ruler " line and column number of the cursor position 26 | set wildmenu " enhanced command completion 27 | set visualbell " use visual bell instead of beeping 28 | set laststatus=2 " always show the status line 29 | "set listchars=tab:▷⋅,trail:·,eol:$ 30 | set listchars=tab:▷⋅,trail:· 31 | set list 32 | 33 | " highlight spell errors 34 | hi SpellErrors guibg=red guifg=black ctermbg=red ctermfg=black 35 | 36 | " behavior 37 | " ignore these files when completing names and in 38 | " explorer 39 | set wildignore=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif 40 | set shell=/bin/bash " use bash for shell commands 41 | set autowriteall " Automatically save before commands like :next and :make 42 | set hidden " enable multiple modified buffers 43 | set history=1000 44 | set autoread " automatically read file that has been changed on disk and doesn't have changes in vim 45 | set backspace=indent,eol,start 46 | set guioptions-=T " disable toolbar" 47 | set completeopt=menuone,preview 48 | let bash_is_sh=1 " syntax shell files as bash scripts 49 | set cinoptions=:0,(s,u0,U1,g0,t0 " some indentation options ':h cinoptions' for details 50 | set modelines=5 " number of lines to check for vim: directives at the start/end of file 51 | "set fixdel " fix terminal code for delete (if delete is broken but backspace works) 52 | set autoindent " automatically indent new line 53 | 54 | set ts=4 " number of spaces in a tab 55 | set sw=4 " number of spaces for indent 56 | set et " expand tabs into spaces 57 | 58 | set ttimeoutlen=50 " fast Esc to normal mode 59 | 60 | " mouse settings 61 | if has("mouse") 62 | set mouse=a 63 | endif 64 | set mousehide " Hide mouse pointer on insert mode." 65 | 66 | " search settings 67 | set incsearch " Incremental search 68 | set hlsearch " Highlight search match 69 | set ignorecase " Do case insensitive matching 70 | set smartcase " do not ignore if search pattern has CAPS 71 | 72 | " omni completion settings 73 | set ofu=syntaxcomplete#Complete 74 | let g:rubycomplete_buffer_loading = 0 75 | let g:rubycomplete_classes_in_global = 1 76 | 77 | " directory settings 78 | call system('mkdir -vp ~/.backup/undo/ > /dev/null 2>&1') 79 | set backupdir=~/.backup,. " list of directories for the backup file 80 | set directory=~/.backup,~/tmp,. " list of directory names for the swap file 81 | set nobackup " do not write backup files 82 | set backupskip+=~/tmp/*,/private/tmp/* " skip backups on OSX temp dir, for crontab -e to properly work 83 | set noswapfile " do not write .swp files 84 | set undofile 85 | set undodir=~/.backup/undo/,~/tmp,. 86 | 87 | " folding 88 | set foldcolumn=0 " columns for folding 89 | set foldmethod=indent 90 | set foldlevel=9 91 | set nofoldenable "dont fold by default " 92 | 93 | " extended '%' mapping for if/then/else/end etc 94 | runtime macros/matchit.vim 95 | 96 | let mapleader = "," 97 | let maplocalleader = "\\" 98 | -------------------------------------------------------------------------------- /gvimrc: -------------------------------------------------------------------------------- 1 | " gui settings 2 | -------------------------------------------------------------------------------- /macros.vim: -------------------------------------------------------------------------------- 1 | " This file contains some mactos that I find useful. 2 | " I recommend editing yoru macros in a vim buffer. to load a macro to a 3 | " register you can 'yank' to it. for example if you have a line with the macro 4 | " and cursor is at the beginning of it "ay$ will load the macro into register 5 | " 'a', so that you will be able to execute it with @a 6 | 7 | " 's' enclose selection in double * (bold in markdown) 8 | let @s="S*gvS*" 9 | 10 | " 'q' format paragraph 11 | let @q="V}kQ" 12 | -------------------------------------------------------------------------------- /plugins-override.vim: -------------------------------------------------------------------------------- 1 | " apidoc.vim 2 | if has("mac") 3 | let g:browser = "open " 4 | endif 5 | -------------------------------------------------------------------------------- /plugins.vim: -------------------------------------------------------------------------------- 1 | " showmarks 2 | let g:showmarks_enable = 0 " disabled by default by populardemand ;) 3 | hi! link ShowMarksHLl LineNr 4 | hi! link ShowMarksHLu LineNr 5 | hi! link ShowMarksHLo LineNr 6 | hi! link ShowMarksHLm LineNr 7 | 8 | " syntastic 9 | let g:syntastic_enable_signs=1 10 | let g:syntastic_auto_loc_list=2 11 | let g:syntastic_check_on_wq=0 12 | let g:syntastic_error_symbol='✗' 13 | let g:syntastic_warning_symbol='⚠' 14 | 15 | 16 | " delimitMate 17 | let g:delimitMate_expand_space = 1 " Turns on/off the expansion of 18 | let g:delimitMate_expand_cr = 1 " Turns on/off the expansion of 19 | 20 | " nerdtree 21 | " Ctrl-P to Display the file browser tree 22 | nmap :NERDTreeTabsToggle 23 | " ,p to show current file in the tree 24 | nmap p :NERDTreeFind 25 | 26 | " nerdcommenter 27 | " ,/ to invert comment on the current line/selection 28 | nmap / :call NERDComment(0, "invert") 29 | vmap / :call NERDComment(0, "invert") 30 | 31 | " ,t to show tags window 32 | let Tlist_Show_Menu=1 33 | nmap t :TlistToggle 34 | 35 | " sessionman 36 | nmap S :SessionList 37 | nmap SS :SessionSave 38 | nmap SA :SessionSaveAs 39 | 40 | let g:Conque_Read_Timeout = 50 " timeout for waiting for command output. 41 | let g:Conque_TERM = 'xterm' 42 | " ,sh shell window 43 | nmap sh :ConqueSplit bash 44 | " ,r run command 45 | nmap R :ConqueSplit 46 | 47 | " yankring 48 | let g:yankring_replace_n_pkey = '[' 49 | let g:yankring_replace_n_nkey = ']' 50 | " ,y to show the yankring 51 | nmap y :YRShow 52 | " put the yankring_history file in ~/.backup 53 | let g:yankring_history_dir = '~/.backup' 54 | 55 | " rails 56 | " completing Rails hangs a lot 57 | "let g:rubycomplete_rails = 1 58 | 59 | " command-t 60 | "nmap , :CommandT 61 | "nmap . :CommandTFlush:CommandT 62 | "let g:CommandTMatchWindowAtTop=1 63 | 64 | let g:ctrlp_map = ',' 65 | let g:ctrlp_cmd = 'CtrlP' 66 | 67 | nmap . :CtrlPClearCache:CtrlP 68 | nmap l :CtrlPLine 69 | nmap b :CtrlPBuff 70 | nmap m :CtrlPBufTag 71 | nmap M :CtrlPBufTagAll 72 | 73 | let g:ctrlp_clear_cache_on_exit = 1 74 | " ctrlp leaves stale caches behind if there is another vim process running 75 | " which didn't use ctrlp. so we clear all caches on each new vim invocation 76 | cal ctrlp#clra() 77 | 78 | let g:ctrlp_max_height = 40 79 | 80 | " show on top 81 | "let g:ctrlp_match_window_bottom = 0 82 | "let g:ctrlp_match_window_reversed = 0 83 | 84 | " jump to buffer in the same tab if already open 85 | let g:ctrlp_switch_buffer = 1 86 | 87 | " if in git repo - use git file listing command, should be faster 88 | " using this option overrides standard CtrlP ignore list based on vim wildignore 89 | " so use 'grep -v ...' to exclude common image and font files from the search 90 | let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files --exclude-standard -cod | grep -viE "\.(png|gif|jpg|gz|woff|eot|tiff|ttf|otf)$"'] 91 | 92 | " open multiple files with to mark and to open. v - opening in 93 | " vertical splits; j - jump to first open buffer; r - open first in current buffer 94 | let g:ctrlp_open_multiple_files = 'vjr' 95 | 96 | let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'mixed', 'line'] 97 | 98 | " Fugitive 99 | " ,g for Ggrep 100 | nmap g :silent Ggrep 101 | 102 | " ,f for global git serach for word under the cursor (with highlight) 103 | nmap f :let @/="\\<\\>":set hls:silent Ggrep -w "":ccl:cw 104 | 105 | " same in visual mode 106 | :vmap f y:let @/=escape(@", '\\[]$^*.'):set hls:silent Ggrep -F "=escape(@", '\\"#')":ccl:cw 107 | " Ag 108 | " ,a for Ag 109 | nmap k :Ag 110 | 111 | " vim-indentobject 112 | " add Markdown to the list of indentation based languages 113 | let g:indentobject_meaningful_indentation = ["haml", "sass", "python", "yaml", "markdown"] 114 | 115 | " indent-guides 116 | let g:indent_guides_start_level = 2 117 | let g:indent_guides_enable_on_vim_startup = 1 118 | let g:indent_guides_guide_size = 1 119 | let g:indent_guides_color_change_percent = 5 120 | 121 | " VimClojure 122 | let g:vimclojure#ParenRainbow = 1 123 | let g:vimclojure#DynamicHighlighting = 1 124 | 125 | " Utl.vim 126 | if has("mac") 127 | let g:utl_cfg_hdl_scm_http_system = "!open '%u'" 128 | end 129 | nmap o :Utl 130 | 131 | " VimOrganizer 132 | au! BufRead,BufWrite,BufWritePost,BufNewFile *.org 133 | au BufEnter *.org call org#SetOrgFileType() 134 | 135 | " Gundo 136 | nmap u :GundoToggle 137 | let g:gundo_close_on_revert = 1 138 | 139 | " Switch 140 | " making some of the switches defined for ruby work in HAML files 141 | autocmd FileType haml let b:switch_definitions = 142 | \ [ 143 | \ g:switch_builtins.ruby_hash_style, 144 | \ g:switch_builtins.ruby_string, 145 | \ g:switch_builtins.true_false, 146 | \ g:switch_builtins.true_false, 147 | \ ] 148 | 149 | let g:blockle_mapping = 'B' 150 | 151 | " vim-dispatch 152 | autocmd FileType ruby let b:dispatch = 'rspec %' 153 | 154 | let g:unite_source_history_yank_enable = 1 155 | let g:unite_enable_start_insert = 1 156 | let g:unite_source_file_mru_long_limit = 100 157 | let g:unite_source_directory_mru_long_limit = 100 158 | call unite#filters#matcher_default#use(['matcher_fuzzy']) 159 | 160 | " vim-rspec 161 | map r :call RunNearestSpec() 162 | 163 | " vim-airline 164 | let g:airline_powerline_fonts=1 165 | let g:airline_theme='light' " dark simple badwolf solarized solarized2 166 | set noshowmode 167 | 168 | " uncomment to define your own bindings for tmux-vim-navigator 169 | "let g:tmux_navigator_no_mappings = 1 170 | -------------------------------------------------------------------------------- /ru-translit-bindings.vim: -------------------------------------------------------------------------------- 1 | nmap ыы yy 2 | nmap зт zt 3 | nmap зз zz 4 | nmap зб zb 5 | nmap г; g; 6 | nmap гг gg 7 | 8 | nmap я q 9 | nmap ш w 10 | nmap е e 11 | nmap р r 12 | nmap т t 13 | nmap ы y 14 | nmap у u 15 | nmap и i 16 | nmap о o 17 | nmap п p 18 | nmap ю [ 19 | nmap ж ] 20 | nmap э \ 21 | 22 | nmap Я Q 23 | nmap Ш W 24 | nmap Е E 25 | nmap Р R 26 | nmap Т T 27 | nmap Ы Y 28 | nmap У U 29 | nmap И I 30 | nmap О O 31 | nmap П P 32 | nmap Ю { 33 | nmap Ж } 34 | "nmap Э | 35 | 36 | nmap а a 37 | nmap с s 38 | nmap д d 39 | nmap ф f 40 | nmap г g 41 | nmap ч h 42 | nmap й j 43 | nmap к k 44 | nmap л l 45 | 46 | nmap А A 47 | nmap С S 48 | nmap Д D 49 | nmap Ф F 50 | nmap Г G 51 | nmap Ч H 52 | nmap Й J 53 | nmap К K 54 | nmap Л L 55 | 56 | nmap з z 57 | nmap х x 58 | nmap ц c 59 | nmap в v 60 | nmap б b 61 | nmap н n 62 | nmap м m 63 | 64 | nmap З Z 65 | nmap Х X 66 | nmap Ц C 67 | nmap В V 68 | nmap Б B 69 | nmap Н N 70 | nmap М M 71 | 72 | -------------------------------------------------------------------------------- /snippets/eruby.snippets: -------------------------------------------------------------------------------- 1 | snippet = <%= .. %> 2 | <%= ${1} %> -------------------------------------------------------------------------------- /snippets/rspec.snippets: -------------------------------------------------------------------------------- 1 | #rspec 2 | snippet it 3 | it "${1:spec_name}" do 4 | ${2} 5 | end 6 | snippet itp 7 | it "${1:spec_name}" 8 | ${2} 9 | snippet desc 10 | describe ${1:class_name} do 11 | ${2} 12 | end 13 | snippet cont 14 | context "${1:message}" do 15 | ${2} 16 | end 17 | snippet bef 18 | before :${1:each} do 19 | ${2} 20 | end 21 | snippet aft 22 | after :${1:each} do 23 | ${2} 24 | end -------------------------------------------------------------------------------- /snippets/ruby-rails/mcol.snippet: -------------------------------------------------------------------------------- 1 | add_column :${1:table}, :${2:column}, :${3:type} 2 | remove_column :$1, :$2 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/mct.snippet: -------------------------------------------------------------------------------- 1 | create_table :${1:table_name}, :force => ${2:true} do |t| 2 | t.${3:string}, :${4:column} 3 | ${5} 4 | end 5 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcb.snippet: -------------------------------------------------------------------------------- 1 | t.boolean :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcbi.snippet: -------------------------------------------------------------------------------- 1 | t.binary :${1:title}, :limit => ${2:1}.${3:megabytes} 2 | ${4} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcd.snippet: -------------------------------------------------------------------------------- 1 | t.decimal ${1:title}, :precision => ${2:10}, :scale => ${3:2} 2 | ${4} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcda.snippet: -------------------------------------------------------------------------------- 1 | t.date :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcdt.snippet: -------------------------------------------------------------------------------- 1 | t.datetime :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcf.snippet: -------------------------------------------------------------------------------- 1 | t.float :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tch.snippet: -------------------------------------------------------------------------------- 1 | t.change :${1:name}, :${2:string}, :limit => ${3:40} 2 | ${4} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tci.snippet: -------------------------------------------------------------------------------- 1 | t.integer :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcl.snippet: -------------------------------------------------------------------------------- 1 | t.integer :lock_version, :null => false, :default => 0 2 | ${1} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcr.snippet: -------------------------------------------------------------------------------- 1 | t.references :${1:association}, :polymorphic => true 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcs.snippet: -------------------------------------------------------------------------------- 1 | t.string :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tct.snippet: -------------------------------------------------------------------------------- 1 | t.text :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcti.snippet: -------------------------------------------------------------------------------- 1 | t.time :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tcts.snippet: -------------------------------------------------------------------------------- 1 | t.timestamp :${1:title} 2 | ${2} 3 | -------------------------------------------------------------------------------- /snippets/ruby-rails/tctss.snippet: -------------------------------------------------------------------------------- 1 | t.timestamps 2 | ${1} 3 | -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | " content of this file is loaded BEFORE all the plugins 2 | source ~/.vim/bundles.vim " vundle plugins list 3 | source ~/.vim/global.vim " general global configuration 4 | source ~/.vim/plugins.vim " configuration for plugins that needs to be set BEFORE plugins are loaded 5 | source ~/.vim/macros.vim " some macros 6 | if has('gui_running') 7 | source ~/.vim/gvimrc " gui specific settings 8 | end 9 | 10 | source ~/.vim/before.vim " local BEFORE configs 11 | 12 | " after.vim is loaded from ./after/plugin/after.vim 13 | " which should place it AFTER all the other plugins in the loading order 14 | " bindings.vim and local.vim are loaded from after.vim 15 | -------------------------------------------------------------------------------- /writer.vim: -------------------------------------------------------------------------------- 1 | set background=light 2 | set nonu 3 | set laststatus=0 4 | colorscheme default 5 | hi FoldColumn guibg=white 6 | set foldcolumn=12 7 | set linespace=8 8 | set guifont=Source\ Code\ Pro\ Light:h20 9 | set tw=80 10 | hi Normal guibg=gray95 11 | hi NonText guifg=gray95 12 | hi FoldColumn guibg=gray95 13 | hi CursorLine guibg=gray90 14 | hi Title gui=bold guifg=gray25 15 | hi MarkdownHeadingDelimiter gui=bold guifg=gray25 16 | hi htmlSpecialChar guifg=black 17 | hi markdownBold gui=bold guifg=gray25 18 | hi markdownItalic guifg=gray25 gui=underline 19 | hi markdownUrl guifg=#2fb3a6 20 | hi markdownAutomaticLink guifg=#2fb3a6 21 | hi markdownLinkText guifg=#317849 22 | hi markdownUrlTitle guifg=#317849 23 | hi markdownBlockquote guifg=#317849 gui=bold 24 | hi markdownId guifg=#2fb3a6 25 | hi markdownIdDeclaration guifg=#317849 gui=bold 26 | hi markdownListMarker guifg=#317849 27 | highlight Cursor guibg=#15abdd 28 | GitGutterDisable 29 | --------------------------------------------------------------------------------