This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/vim-to-config-or-not-to-config
Favorite Vim Configurations
@christoomey, I still don’t use it because it’s terribly slow to run RSpec, but I have been fairly impressed by the vim-mode implementation in Github’s Atom editor. I haven’t had trouble moving around and editing text the couple times I gave it a try.
I’ll certainly agree that Vim emulation seems to be improving as the years go on. Recently I’ve been very impressed by wasavi which is a “Vi editor for any web page”.
None the less, I still find that all emulations fall short at some point and thus I stick with Vim. Modal editing is hard thing to nail when it’s not the primary feature.
Switching to vim took me months to learn it, and another few months to learn how to configure it well. Now, I can’t use any other editors. I would love to watch a live demo of how thoughtbot developers pair program with vim and tmux working on a project.
Please note that the link to Vim Dispatch from the Notes section of the video points elsewhere (actually goes to vim-rspec) so you’d maybe want to fix that.
Great video as always. I have a question regarding debugging. At the moment I’m using pry with a abbreviation command to put a break point and then as I’m using Vim-Conque for using an interactive shell then I can just go ahead and use the navigations commands in pry. The thing is that most of the time that script is a little bit buggy and normally I go to a terminal and do the debugging there. So I was wondering how do you setup vim to do such thing.
Thanks in advance,
Good to know, I have yet to switch to VIM at work, but only using it for my small projects and koans. I plan to completely switch during the holiday break. I feel like I can navigate single files well, just don’t know some of the key workflow shortcuts, like
command p was new for me when I watch this video.
I am unfortunately the
:e . people, but not anymore
Tim Pope’s vim-unimpaired and vim-vinegar are also really useful for jumping around files. You can use unimpaired’s
]f to jump to adjacent files in the same folder (useful if you’re trying to move sequentially through a folder.
vinegar maps the minus key to jump out to a file view of the folder of the file you’re currently looking at which can be useful if you’re source-diving and want to get the lay of the land.
Oh great I didn’t realise there were those [f and ]f mappings! Guess I should read the documentation.
I never found movement in vim overly difficult. I wonder if my initial comfort came from being a pc gamer (mostly shooters) where a lot of movement is done with the “wasd” keys on the keyboad?
The docs on Tim Pope’s plugins are generally very good. I had the keystroke guide from vim-unimpaired as a cheat sheet above my desk for three months. There are some other great ones like jumping through merge conflicts that I also love to use.
I am 2 weeks into now and find myself always adding new things to my .vimrc to improve my workflow. What are some other plugins people are using that they can’t live without?
@brianllamar, a few I’ve started using recently that I really like:
- bogado/file-line lets you append a line number to the end of a file to open directly to there. Nice if you run a spec or analysis tool and want to jump right to the problem.
jgdavey/vim-blockle easy toggling of Ruby
do endblocks, it moves from single-line to multiline really nicely. I have this mapped to a leader.
- gorodinskiy/vim-coloresque highlights CSS colors in your files so you can see them easily. Results may vary
- kristijanhusak/vim-multiple-cursors This plugin is a fork of a popular plugin that has not been maintained recently, it seems to work a bit better. Lets you select multiple places in ways that would be hard in visual mode and then edit them in place using normal/insert mode rather than the command line substitution
- othree/eregex.vim has a handle command and toggle to switch between using Vim-style and Ruby/Perl-style regular expressions for search in a way that doesn’t seem to break other plugins and macros. One of my things to work on is to do more substitution rather than editing more than one thing, and using Ruby-ish regex helps me just worry about learning one thing rather than struggling with Vim’s odd regex and thinking about how to phrase my substitution.
Hope this helps! Interested in what plugins other folks are using. I just did a winter cleaning and culled the plugins I had that weren’t getting much use.
I love dash.vim paired with dash app. I have it configured to look up documentation for the method under my cursor. It’s great for keeping me from context switching. Ultisnips is great for text expansion and I use vundle to install all my plugins.