Ubuntu to Mac – My experience with the new setup
by grdvnl
Recently I had an opportunity to get my hands dirty on a Mac based development environment. I have done most of my development on Ubuntu and getting to work on Mac was a mixed experience. As anyone would have guessed the overall UI experience has been great.
Here are some of the tools I was introduced to during my first week:
1. SQLPro : This is a nice GUI based MySQL client. I was never impressed with the command line MySql client. I hated it all the more once I started using Postgress and the accompanying client. If you have used Golden for Oracle it is on par with that tool.
2. iTerm2: This is the tmux equivalent and tuned towards the Mac UI experience. The key bindings are easy to learn and worth spending time getting used to the keyboard shortcuts.
3. Homebrew: This is the Ubuntu equivalent of apt-get. Other options include MacPorts and Fink. I am yet to familiarize myself with the differences between the options.
4. Alfred: This is a quick launch app which helps you launch applications using Cmd-Space shortcut. This is equivalent to Alt-F2 on Ubuntu.
5. PyCharm : This is not Mac specific, but this tool has been handy in helping me step through code and understand the implementation as I debug.
6. Emacs on Mac : The biggest challenge I had was trying to set up Emacs to reflect my set up on Ubuntu. ‘Monaco’ is the usual font used in most of Mac applications. But, the GUI version of Emacs just does not render Monaco-11 or Monaco-12 in anti-aliased mode.Turning on/off anti-aliasing did not help either. Doing anything in a font bigger than that was very painful. Finally, I settled into to using the non gui-version of Emacs-24. I just had to create an alias called emacs24 and make it point to the Emacs app with the non-Gui option. Here is the instruction you will need to follow, if you had the same experience.
a. Install the Emacs-24.x version.
b. Add this line to your bash_profile.
alias emacs=”/Applications/Emacs.app/Contents/MacOS/Emacs -nw”
c. And, happily run Emacs with the beautiful fonts rendered by iTerm2.
This option also helps you open Emacs within one of the sessions in iTerm2. That way you can remain working on the terminals without the need to switch windows.
There are some new Python tools I have started working in lately, and that will be the topic of my next post.
Happy Coding!
Don’t use Monaco. Menlo or DejaVu Sans Mono (almost the same, but with better Unicode support) are way better.
On Homebrew vs. Fink vs. MacPorts. I’ve never gotten MacPorts to work. I haven’t tried in a while, so maybe it works now. Fink is what I use. The main difference between it and Homebrew (and also between MacPorts and Homebrew) is that Fink and MacPorts install into non-standard locations (Fink installs to /sw and MacPorts to /opt). It’s no big deal if you know how to edit your PATH. I personally prefer it because if I screw things up, I can just dump /sw and start over (I can also exclude /sw from my Time Machine backup and save a bit of disk space on my backup drive). Homebrew installs to /usr, which some see as an advantage. Homebrew also doesn’t require sudo access (and in fact won’t allow it), whereas Fink and MacPorts require it.
All three of them compile from source, which means that sometimes a package won’t be installable because it can’t compile (and it also means that if you want a package installed, you have to wait for it to compile). I recommend installing XCode and the command line tools if you haven’t already. This will give you LLVM, which makes compiling way faster than gcc (you’ll know if you’re using LLVM if you see the colored warnings). Homebrew is also pretty popular, so it’s probably the best supported right now. It is also a little more distributed, so if there is no official package, you might be able to find an unofficial one. And it uses git and ruby (vs. rsync and perl for Fink) if that matters to you.
Alfred is OK. I personally prefer Quicksilver (and it’s open source!).
I have a ton of tips on using emacs in my blog posts about it. I personally have compiled emacs from source. If you do that, you can compile with nw and never have to worry about sending the -nw flag.
So you use emacs and pycharm? I guess you use emacs for editing and pycharm for debugging?
Aaron,
Thanks for your suggestions. Here are a few responses to your comment.
1. Yes, I have settled down with Menlo. But, still this is only good with -nw mode. But that works for me and I am happy with it.
How did you map Alt/Option key to Meta? So far I have been unsuccessful doing it.
2. That was good explanation on differences between Homebrew and other variants. By laziness, I have settled down with Homebrew and it has worked fine so far.
3. I will give Quicksilver a shot. I was not aware of it till I read your comment.
4. Yes, I have used most of your discussion on Emacs. In fact, as I started GSoC this year, your blog was my inspiration to try Emacs ‘one last time’ before I stop switching between Vim and Emacs. Looks like I will continue to use Emacs for sometime to come!
Yes, I use PyCharm more for debugging. I tried using it as an editor for sometime with Emacs binding. But, I felt it was a lot of distraction(with all its pop-ups and self-help tips). I was unable to think clearly as I was more and more expecting PyCharm to complete things for me. So, eventually I switched back to Emacs and I only use PyCharm when I am debugging something non-trivial.