Sunday, May 27, 2012

Os X vim/git configuration

I spent a while today finally ironing out some small annoyances I've had for a while with my OsX development setup. I had some problem setting the EDITOR variable for git. Even though it was set to vim and which vim showed me /usr/local/bin/vim, whenever I would run git commit the standard OsX version of vim would open up. I ended up just setting EDITOR to the absolute path.

Next up was finally figuring out a way to get a simple way to press esc when using vim. Earlier I had resorted to using ctrl-[ but I was getting really fed up with it now. I found two nice additions to the Os X preferences called KeyRemap4MacBook and PCKeyboardHack. What I wanted to do was change my left control to be esc and change my caps lock to be left control. I have a Japanese Macbook Air where the keyboard looks like this: http://4.bp.blogspot.com/-a7eg4DXrq9Y/TfWtph3- ovI/AAAAAAAAKfs/c-IVbHNOGPg/s1600/Japanese-MacBook-Air-Keyboard-Layout.jpg I had some trouble initially since my mapping from caps lock to control would end up being translated to esc as well, because I had remapped control to that. In the end I managed to hack my way around the problem by adding a custom mapping for esc to control. And then map caps lock to esc instead... Confusing, no?

This is the curse of wanting to eliminate all the small annoyances you have while programming. Now back to trying to set up a portfolio page on github pages.