Tag Archives: mac

How I’m Using Textedit beyond VI and VIM to edit files from the Mac os terminal

There’s a joke about the Unix editor vi, that goes something like: I’ve been using vi for so long, because I can’t figure out how to get out of it. Vim, in my opinion isn’t any better. I can appreciate the power these editors have, and they’re really fast for those who are comfortable on them, but I think of documents more fluidly than only 1 line at a time. I can use nano if I have to, but I feel most comfortable in an interface at least as developed as something like notepad or Textedit. Enter another way to cheat in the Mac OS terminal.

Before actually doing this, it’s a good idea to change a few settings in Textedit or bad things might happen.

Bring up the preference in Textedit either through the menus or just press Command-comma.
In the new document tab, select the plain text radio button, also make sure that the check spelling as you type, the check grammar with spelling and the correct spelling automatically check boxes are unchecked. You also want the smart quotes and smart dashes options to be unchecked.

On the open and save tab: you may want the display html text as code instead of formatted text checked. You definitely want the add .txt extension to plain text files unchecked, or things will stop working.

Now that we have that all out of the way…


alias ted=’open -e $1′

Something so easy you can have it working immediately in a brand new squeaky clean install before you even have your most favorite apps up and running. There are awesome editors out there that can also work with files from the command-line that do way more than Textedit could ever dream of, like TextMate and BBEdit, but this is still a nice fix to keep in the toolbox that requires nothing beyond what OS X provides out of the gate.


Command-line stopwatch

Back when I only had 1 iOS device I was wanting to calculate how fast voiceover was reading to me, but the only stopwatch I had was on my iPhone; I had a problem to solve. I probably could have found a GUI program that had a stopwatch as a function but I just wanted something really simple, and the command-line is my friend.


I knew about a timer command in 4DOS and Take Command 32 made by JP Soft  that I liked to use back in the day, and after some googling found unix linux and OS X had a similar time command, then I wondered how I could suspend the terminal session so time would be timing the pause, cat with no input was the answer.

time cat
and press enter.  The stopwatch will start, but you won’t get any ,  feedback, not even a prompt, but it will keep track for you intel control-c is pressed. Then you will get the timed result.  .

real 0m4.457s
user 0m0.002s
sys 0m0.004s

The top line beginning real is the elapsed time, that’s what you want.

The second line is , the time consumed by system overhead,

and the third line tells the time used to execute utility to the standard error stream. rarely will lines 2 and 3 matter but at least they’re there if you ever need them.