├── README.md ├── part1 ├── plugins.md ├── vim-gym.md ├── vimrc.md └── vimtutor.md └── part2 └── vimgolf.md /README.md: -------------------------------------------------------------------------------- 1 | # VIM - Vi IMproved 2 | 3 | _Not sure you want to dive in?_ [Check this out][worth-the-effort] 4 | 5 | [worth-the-effort]: http://stackoverflow.com/questions/597077/is-learning-vim-worth-the-effort 6 | 7 | ## Getting started: :snail: :turtle: 8 | 9 | + Hit the ground running: [`vimtutor`][vimtutor] 10 | + Get swol, swol out of control at the [VimGym][vim-gym] 11 | + [Upgrade][upgrade-vim] Vim to 7.4 12 | + Trick out your config: [`.vimrc`][vimrc] 13 | 14 | [vim-gym]: ./part1/vim-gym.md 15 | [vimtutor]: ./part1/vimtutor.md 16 | [vimrc]: ./part1/vimrc.md 17 | [upgrade-vim]: http://prioritized.net/blog/upgrading-vim-on-os-x/ 18 | 19 | ## Going further: :racehorse: :horse: :rabbit: :horse_racing: 20 | 21 | + [The Vim Learning Curve is a Myth][the-vim-learning-curve-is-a-myth] 22 | + [Vim is a Language][vim-is-a-lang] 23 | + Play [Vim Adventures][vim-adventures] 24 | + Every stroke counts :golf: [Vimgolf][vimgolf] 25 | 26 | [vimgolf]: ./part2/vimgolf.md 27 | [vim-adventures]: http://vim-adventures.com/ 28 | [vim-is-a-lang]: http://benmccormick.org/2014/07/02/learning-vim-in-2014-vim-as-language/ 29 | [the-vim-learning-curve-is-a-myth]: http://robots.thoughtbot.com/the-vim-learning-curve-is-a-myth 30 | 31 | ## Plugins 32 | 33 | Add these one at a time as you need them, if you add them all at once 34 | you'll forget what you have and how to use it. (One per week is a good 35 | max). Start with ctrlp.vim. 36 | 37 | + [Getting Started][plugins] 38 | + [Plugin 'gmarik/vundle'][vundle] -> plugin manager 39 | + [Plugin 'kien/ctrlp.vim'][ctrlp] -> fuzzy find files (like Cmd-T) 40 | + [Plugin 'scrooloose/syntastic'][syntastic] -> syntax checking 41 | + [Plugin 'w1zeman1p/vim-snippets'][vim-snippets] -> add snippets using tab 42 | + [Plugin 'w1zeman1p/vim-snipmate'][vim-snipmate] -> use textmate snippets 43 | + [Plugin 'tpope/vim-rails'][vim-rails] -> navigate rails like a boss 44 | + [Plugin 'scrooloose/nerdtree'][nerdtree] -> directory structure 45 | + [Plugin 'vim-scripts/tComment'][tcomment] -> comment code quickly 46 | + [Plugin 'maksimr/vim-jsbeautify'][jsbeautify] -> map shortcuts to autoformat javascript 47 | 48 | [plugins]: ./part1/plugins.md 49 | [vundle]: https://github.com/gmarik/Vundle.vim 50 | [ctrlp]: https://github.com/kien/ctrlp.vim 51 | [syntastic]: https://github.com/scrooloose/syntastic 52 | [vim-snippets]: https://github.com/w1zeman1p/vim-snippets 53 | [vim-snipmate]: https://github.com/w1zeman1p/vim-snipmate 54 | [vim-rails]: https://github.com/tpope/vim-rails 55 | [nerdtree]: https://github.com/scrooloose/nerdtree 56 | [tcomment]: https://github.com/vim-scripts/tComment 57 | [jsbeautify]: https://github.com/maksimr/vim-jsbeautify 58 | 59 | ## Integrate 60 | 61 | + [:movie_camera: Ben Orenstein video][vim-talk] 62 | + [:movie_camera: vimcasts][vimcasts] 63 | + Read [tbaggery.com][tbaggery] 64 | + Follow [@tpope][tpope] 65 | + Follow [@vimgolf][at-vimgolf] 66 | 67 | [vim-talk]: https://www.youtube.com/watch?v=SkdrYWhh-8s 68 | [tpope]: https://twitter.com/tpope 69 | [tbaggery]: http://tbaggery.com/ 70 | [at-vimgolf]: https://twitter.com/vimgolf 71 | [vimcasts]: http://vimcasts.org/episodes/ 72 | 73 | ## Cheatsheets 74 | 75 | 77 | 79 | -------------------------------------------------------------------------------- /part1/plugins.md: -------------------------------------------------------------------------------- 1 | ## Plugins 2 | 3 | As you craft your vim environment, one of the most powerful features 4 | will be taking advantage of existing plugins. There are a couple plugin 5 | management systems that exist (pathogen and [vundle][vundle] are the most 6 | common). I've tried both pathogen and [vundle][vundle] and you **must** use 7 | [vundle][vundle]. 8 | 9 | Using vundle makes adding and installing plugins to use with vim much 10 | like adding gems to a `Gemfile`. 11 | 12 | Follow [these instructions][vundle-quick-start] and get vundle installed 13 | and running with your `.vimrc`. 14 | 15 | [vundle]: https://github.com/gmarik/Vundle.vim 16 | [vundle-quick-start]: https://github.com/gmarik/Vundle.vim#quick-start 17 | -------------------------------------------------------------------------------- /part1/vim-gym.md: -------------------------------------------------------------------------------- 1 | # VimGym 2 | 3 | _Time to get stronger and faster!_ 4 | 5 | **Mild suggestion**: Uninstall your existing text editor. 6 | 7 | **Super strong suggestion**: Edit everything with vim. Code, emails, blog posts, 8 | tweets, commit messages, todo lists, love letters, baby name lists, 9 | plans to take over the world should all be edited with vim. Go All In! 10 | 11 | ## Slow is Smooth, Smooth is FAST! 12 | 13 | Open `System Preferences` > `Keyboard` > `Keyboard` tab. 14 | 15 | + Set `Key Repeat` to `Slow` 16 | + Set `Delay Until Repeat` to `Long` 17 | 18 | ## WHO USES CAPSLOCK ANYWAYS?!? 19 | 20 | Open System Preferences > Keyboard > Keyboard tab. 21 | 22 | Click `Modifier Keys...` 23 | 24 | + Set `Caps Lock Key` to `Control` 25 | 26 | ## Stop using arrow keys 27 | 28 | ```vim 29 | " stop using arrow keys 30 | imap WATTTT! 31 | imap WATTTT! 32 | imap WATTTT! 33 | imap WATTT! 34 | ``` 35 | 36 | ## No more mouse 37 | 38 | + Navigate chrome with [vimium][vimium] 39 | 40 | [vimium]: https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en 41 | 42 | ## No Pain, No Gain 43 | 44 | 46 | -------------------------------------------------------------------------------- /part1/vimrc.md: -------------------------------------------------------------------------------- 1 | # `.vimrc` 2 | 3 | Vim is extremely configurable. Now that you're especially interested in 4 | productivity, you'll want to configure your editor with everything you 5 | need to [shred][shred] as fast as possible with vim. 6 | 7 | **Do not!** just copy lines from another vimrc into yours without 8 | knowing what that is doing. [**Now is a good time to blowaway your 9 | existing `.vimrc` and start from 10 | scratch.**](http://www.benorenstein.com/blog/your-first-vimrc-should-be-nearly-empty/) 11 | 12 | [**Go read about plugins**][plugins] 13 | 14 | Then read through [A good vimrc][a-good-vimrc] learn about some good 15 | settings to consider for your `.vimrc`. 16 | 17 | [a-good-vimrc]: http://dougblack.io/words/a-good-vimrc.html 18 | [shred]: http://www.urbandictionary.com/define.php?term=shred 19 | [plugins]: ./part1/plugins.md 20 | -------------------------------------------------------------------------------- /part1/vimtutor.md: -------------------------------------------------------------------------------- 1 | # vimtutor 2 | 3 | Vimtutor is a command line tool that opens vim with a file that you can 4 | edit interactively. Run through this tutorial, by the end you should be 5 | _capable_ of editing text using vim. 6 | 7 | Open your mac terminal and type `vimtutor`. **Est. 30 min** 8 | 9 | [Learn Vim Progressively][learn-vim-progressively]. 10 | 11 | [learn-vim-progressively]: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ 12 | -------------------------------------------------------------------------------- /part2/vimgolf.md: -------------------------------------------------------------------------------- 1 | # :golf: [VimGolf][vimgolf] 2 | 3 | How to get started: 4 | 5 | ```sh 6 | $ gem install vimgolf 7 | $ vimgolf setup 8 | $ vimgolf put [challengeid] 9 | ``` 10 | 11 | ## Suggested Challenges 12 | 13 | These challenges include common edits you'll make as a web developer. 14 | 15 | + [remove dupes from 16 | array](http://vimgolf.com/challenges/4ed3d247a745c1000100002a) 17 | + [Ruby 1.9 18 | hashes](http://vimgolf.com/challenges/4d1e29fda93ce03311000066) 19 | + [Ruby 1.9 20 | compat](http://vimgolf.com/challenges/4d1b4ac3c58eaa2a8a0005c2) 21 | + [Python to 22 | Ruby](http://vimgolf.com/challenges/5078889ceedfc90002000047) 23 | + [Reformat long 24 | lines](http://vimgolf.com/challenges/4d28637c4bcd032f1c00003d) 25 | + [Refactor arguments into object 26 | argument](http://vimgolf.com/challenges/511991607729fb0002000003) 27 | + [paste indent correction - 28 | JS](http://vimgolf.com/challenges/51a115429bada1000200001b) 29 | + [replacing each line of a block 30 | selection](http://vimgolf.com/challenges/4f438739f5a8d70001000019) 31 | 32 | [vimgolf]: http://vimgolf.com/ 33 | --------------------------------------------------------------------------------