Friday, January 08, 2010
This MAC, you know. I like it, but sometimes I get very frustrated. For example, I click on a text file, and the editor that comes up is TextEdit, not my favorite. Editors are not a big deal for me ... I'm more interested in what is being edited. Nonetheless, when pressed, I prefer vi just because I have used it for years and years.

But with the MAC  it is very difficult to get vi to be the default text editor. There are ways, of course. Check out http://www.macosxhints.com/article.php?story=20080305012955463

But you can't get vi to be the default editor by right clicking on the file in Finder and choosing Open With. Vi is just not there. If you do a which vi, the path returned is /usr/bin/vi. If I look in Finder in Developer/usr/bin, I see no vi. Or vim for that matter.

I can get vi (and vim) to appear in Finder. To do that, I become root and make a symbolic link in / to /usr .. like ln -s /usr tedusr. Then in Finder I click on Macintosh HD and open up my link. I can then drag bin to the sidebar. If I open up bin, I then see vi and vim, and if I click on vi, vi starts up (actually vim starts up because vi is a link to vim).

But now if I right click on a text file and choose Open With and navigate to vi (using the bin in my sidebar), I see vi but it is shaded and I cannot select it.

So what am I doing? I now mostly choose TextMate.app as the editor for text files. This is a commercial editor that is well worth the investment, but sometimes you just want vi. vi is still available from the command line. I can just open a terminal window and navigate to where my text file is and type vi filename. Just like the old days.


Mac
1/8/2010 4:53:08 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  |  Trackback
Related Posts:
CDT, gcc, and Snow Leopard

Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):