Friday, November 19, 2010

Mac Window Management

fvwm might be basic, but it has a pile of features I wish I could have on a Mac. One of the features I've been missing is window tiling. A disorganized stack of windows just isn't my thing. For a while I was just hiding everything except one window, which worked, but was a bit excessive on a 2560x1600 pixel monitor. Thankfully there is a better way.

There are two external pieces of software that can help with the Tiling
Problem(tm). The first one I tried is SizeUp($13). It divides the screen into four quadrants (they default to 50% of the screen, but this can be customized) and then has key bindings to resize and move a window to fit any half or quarter of the screen. It can also do full screen. It's a very simple interface, and was easy to pick up. I also didn't find any bugs while using it.


The second piece of software I tried was Divvy($15). It divides the screen into cells (up to 10x10). You can then use the mouse to custom select a subset of the cells, which will resize the window to that portion of the screen. You can also define as many custom keyboard shortcuts as you want to correspond to any cell selection. With this you can define as many (possibly overlapping) screen regions as you want to have things snap to. It does have a bit more of a learning curve, and there is a questionable UI choice. Mainly that if you change how many cells the screen is divided into there isn't anyway to update existing shortcuts to use that grid. Instead you have to delete and re-create them. In practice this isn't a big deal however.

After using both pieces of software in demo mode for around a week and a half I broke down and bought Divvy, mostly due to greater flexibility. Now if only I could find something better than command-tab for switching between windows I'd be a very happy person indeed.

Thanks to Caleb for suggesting Divvy.

Wednesday, November 10, 2010

Reusing screen sessions

Screen is the only way I can keep myself organized, especially given the limited window manager on a mac. In the past I've always only had one terminal running screen and let all other terminals just run straight. This resulted in some awkward workflows however when everything I wanted to get at was in one of the screen tabs. The solution? screen -xRRA

Let's break it down:
x: Attach to a not detached screen session

RR: Attempts to reconnect to the first detached screen session it can find. Otherwise it creates a new screen session.

A: Adjust screen to the size of this terminal instead of resizing the terminal

Ta-da! The same screen session's now in as many terminals as you want.

This tip thanks to Matthew Brewer

Monday, November 8, 2010

Case insensitive vim searching

I don't know how I didn't learn this trick years ago. It's dead simple, but something that comes up fairly often: case insensitive searching.

It's fairly well known that in vim '/' is case sensitive search. That's almost always what I want, but very occasionally I want a case insensitive search. Search can be set to ignore case for the life of the vim session by using :set ignorecase (:set ic) and likewise :set noignorecase turns off the feature. That's really obnoxious if you only want one insensitive search. Luckily there's a better solution! Putting \c at the end of your search query makes only that search case insensitive.