2011-08-27
By Ivo Dancet
Tags:

Vim

Optimizing Vim: tab style

Optimizing Vim: tab style

As mentioned in a previous post of mine, I use Vim nowadays just like all the cool guys! And just like in that previous post, I would like to share a trick.

I mostly work with two screens. During (Rails) development my MacBook Pro screen is mostly dedicated to fullscreen iTerm with split screens for running Cucumber, rSpec and a tail on test.log. The other screen is used by Vim. In longer sessions my Vim tends to end up with multiple tabs of split screens.

I really like the Mac-styled tabs Vim shows in window mode, but I like the standard Vim tabs more for fullscreen work. So what I needed was a way to make command-enter do the fullscreen toggle and change the tab-style automatically. Making this work didn't prove to be really easy.

Some problems I encountered to make this work (which I found scattered all over the Internet):

  • The help file mentions a fuleave and fuenter (fullscreen-leave and fullscreen-enter) hook, but these are not implemented yet.
  • You need to write this in gvimrc.local and not in vimrc.local as the latter is read by Vim too early.
  • You cannot map the shortcuts used by MacVim itself unless you unmap them first which is done with a special command.

So this way, fullscreen looks like this:

vim style tab

And window mode like this:

vim mac style tabs

blog comments powered by Disqus
About
This blog is written by Wouter Vancraeynest and Ivo Dancet and is about what we come across while working at our company by2.be, located in Bruges, Belgium. This can be anything related - though sometimes only remotely - to programming, testing, marketing, Ruby, Apple and other things we do and love ...
Recent posts
Optimizing Vim: tab style
haml-js and jammit
VimRoom
Hudson for a Rails3 project
Looking up Rails(3) routes
Horror story, part II
All tags
Jammit - SaaS - Rails - WriteRoom - Haml - rSpec - Vim - Ruby on Rails - rcov - Cucumber - humans - continuous integration - Hudson - Rails3 - testing - rSquery - haml-js - Bundler - rvm - backbone.js - Selenium
rSquery
Some time ago we made rSquery to be able to easily use jQuery matchers in Selenium projects. You may want to check it out on github. By now this project is not in active development anymore but older projects can still profit from it. (We still use it)