Tmux and Vim: Copy and Paste on macOS Sierra

As a developer, more than anything, you copy and paste things. Making copy and paste work in properly with Vim and Tmux is, unfortunately, not trivial. There’s a lot of information to be found on the internet about setting up copy and paste with Tmux. There’s also lots of information on how to setup Vim. But then you run Vim 8. On macOS Sierra. And things break down quickly.

Search and Replace in multiple files with Vim

I recently learned a nice VimTrickā„¢ when pairing with Arjan. We upgrade an app to Rails 3.2.6 and got the following deprecation message: DEPRECATION WARNING: :confirm option is deprecated and will be removed from Rails 4.0. Use ':data => { :confirm => 'Text' }' instead. Well, nothing difficult about that, but we have quite a few :confirm in this app. Firstly we checked where we used them (note we use ruby 1.

From 11.34s to 0.625s for opening a .rb file in Vim

Would you believe me if I told you that opening a simple Ruby file on my 2011 MacBook Pro takes 11.34 seconds? To test this, I’ve used this command: $ vim --startuptime log-before.txt app/models/user.rb This command will time everything that Vim does until the file is ready for you to edit down to the millisecond. This is a great way to find out what’s slowing things down. I’ll highlight the most interesting parts of log-before.

Using multiple clipboards in Vim

On of the first things you learn when using Vim activly is that when you delete something using x or dd that content is actually cut and put on a clipboard. Later you can retrieve that content using the p or P commanands. One thing that makes Vim more awesome than let’s say, uhm TextMate, is that it actually has more than one clipboard! Yeah! In fact, in Vim terminology those clipboards are called registers.