Vim, the OSX clipboard and Tmux
Tyler Cipriani Posted

I’ve been an Ubuntu user for 4 years now. Since I started working at Upsync 3 months ago, I’ve found myself a very lonely desktop Linux user. Also, since this job is my first heavy-duty exposure to back-end web development, I’ve found myself a very confused desktop Linux user.

While there are many tools for working on a website backend available in Ubuntu, few are as shiny as those available in OSX (Charles Proxy, usable in Chrome. I want that. I want it hard.). Also, want to do any iOS work? (you know I do)—then you must have a mac.

On the flip side there is my natural inclination to be a bit of a contrarian and principles and such…

##…but it’s so shiny!

I’ve caved. I’m a sell-out. I’m not the cool hardcore ideologue I once believed myself to be. You know those hypothetical, which-side-of-history-would-you-be-on-type, questions? Well, I can now safely say that I would not have been in the French Resistance.

I’m typing this on the beautiful back-lit keyboard of a brand-new, core-i7-having, 8GB-RAM-possesing, 256GB-SSD-not-spinning monster that is a 13″ MacBook Air.

##I thought this was supposed to be easy

The first thing I did was get iTerm 2 up and running and then install Homebrew. After removing the dumb “Natural” scrolling and using PCKeyboard hack to remap some keys, I’m working exactly as I was before. I really can’t tell a difference. Which is a little anti-climactic for a computer that cost as much as my first car (oh, how I miss that purple Taurus!).

It was really easy to get everything set up as it was before, except…Vim…my clipboard…Tmux…they didn’t work together and that was CRIPPLING! Seriously, I depend on those things working together.

This post is written as a little reminder to myself of how I got it all up and running again.

##The process

  1. Install Homebrew:
    Instructions are available on Github but really all it boils down to is: ruby -e “$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)”

  2. Install MacVim:
    And make sure it overrides the system default Vim, which is pre-7.3 Vim and sucks (or it was last week when my MacBook got here) use: brew install macvim –override-system-vim

  3. Install Tmux:
    Easy peesy lemon squeezy: brew install tmux

  4. Thank the good, sweet lord for Paul Hinze:
    Install Paul’s reattach-to-user-namespace hack via homebrew: brew install reattach-to-user-namespace –wrap-pbcopy-and-pbpaste

  5. Append your ~/.tmux.conf file:
    With this lovely gem: set-option -g default-command “reattach-to-user-namespace -l zsh” or you can use bash, I guess, I don’t know because I use ZSH. That should be a step somewhere…chsh -s /bin/zsh. Done.

Now if only OSX Mountain Lion possessed the awesome power of moving windows between workspaces using keyboard shortcuts. Someday… someday.

Installing Vim from source on CentOS 6.3
Tyler Cipriani Posted

…or, I suppose, other Linux-es…Linuxi…Linux distributions.

Many of the Vim features on which I’ve come to depend simply aren’t available in Vim pre-7.3.3. That’s fine if I’m working on an OS that cares about having up-to-date software like Ubuntu or OSX; however, it ain’t so great if I’m working on a shared host that uses CentOS five point something dumb because the hosting-providers weren’t hugged as children (I’d guess).

edit—10/01/2013

For installing on Ubuntu and additional source install tips see this little post on the YouCompleteMe wiki

New OS, Old Repo

The only thing worse than working on an old OS, with an old version of Vim is working on a new OS with an old version of Vim. I recently disovered that the yum-installable Vim (vim-enhanced) version on CentOS 6.3 is v.7.2.411—WTF CentOS? What’s your deal, guy?

Some plugins that depend on version 7.3:

And, really, those are just the plugins that fail loudly for me. Like the ones that vomit, “Hey, WTF, guy?” to stdout every rootin’ tootin’ time I fire up Vim. There would likely be other functionality that I’d loose by not using Vim 7.3.3+.

I don’t have to take this kind of guff from CentOS. No. I think that, instead, I’m going to do something awesome.

Compiling Vim from source means you don’t have to get pushed around by crummy distro repos and you look like a 1970s-era Fred Williams-level badass…so…bonus points…

Retrieving Vim source

Vim keeps its source in a Mercurial repo on googlcode so you need to download it. To do that you should have Mercurial installed (which you can, somewhat ironically, install from via yum yum install mercurial). You should switch to the root user for this install and for your sanity so use su or sudo bash:

Configuration options

There are quite a few configuration options (which you can view by running ./configure –help in your newly created vim directory)—with respect to Vim installs I support going nuclear. Even at it’s most ginormous Vim will still be a small install relative to other IDEs—Vim is my primary editor and IDE, so I’m down to do it big. I’m also going to use the /usr prefix so that Vim is installed system-wide.

make && make install

Srsly, that’s it—

Congrats! You’re one bad mother Vim compiler.

So… which vim? /usr/bin/vim. Boom. Yeah, that’s right.

Feb 2013
S M T W T F S