Using TextEdit to Edit Text

For some reason, I’ve become a bit anti-IDE, and I owe a lot of this mentality to the minimalistic nature of my brother and my strong desire to understand how and why things work.

In work environments, I had grown accustomed to using Microsoft’s Visual Studio (FrontPage in the early days) or Adobe’s Dreamweaver for development needs, but I never really used them to their advantage. As a long-time coder, I always went into “code-view” instead of using “design-view”.

Dreamweaver conveniently had a Sites manager for managing web site projects. It allows FTP credentials to be stored and has integrated tools for SVN.

I always hated compiling projects in Visual Studio and load tons of modules in order to do interesting things.

So, I started using TextEdit and if you’re a minimalistic coder like myself, well here are some tips to make it a suitable alternative to additional software installations.

Plain text Mode

Probably the most important thing when coding with TextEdit is to enable Plain text mode in TextEdit’s Preferences. While I’m here, I usually disable the spelling and grammar check, ruler, and “smart” stuff to get me into a traditional, basic editor, kind of like Notepad in Windows.

TextEdit Preferences

Working with Files

Because folder hierarchies have been in computing for a very long time, and since OS X has convenient tagging, Finder is just as functional for locating and logically grouping projects and files within projects. I like using the Column browser because it allows me to quickly navigate directories using just arrow keys, keeping my hands on the keyboard. The Tabs are also nice for working in multiple folders at the same time.

Finder Projects

But, most web file types (.js, .html, .css) are defaulted to opening in Safari. Since I use Virtual Hosts, and because my projects typically require Apache or a hostname for AJAX requests to the Same-Origin, it is inconvenient to have to context-click the file and choose Open With…, then select TextEdit. So, for the files that edit frequently, I change the Default Application from the Get Info properties window and change it for all files of this type, using Change All….

Default Application

Now, I can easily ⌘⇥ to Finder, then ⌃⇥ to the correct Finder Tab, then arrow around to the file and, finally, ⌘O to open the file in TextEdit and start working.

When I’m done editing, I can simply ⌘S to save the document and ⌘W to close the window. Or, if I want to keep multiple working files open at the same time, I can easily navigate through them using ⌘~ and ⌘⇧~.

Line Wrapping

Unfortunately, TextEdit still has a silly limitation that it does not allow horizontal text overflow, meaning lengthy lines of text will always wrap to the next line. Maybe, one day, my brother or I will be able to download the latest source code and recompile our own build that enables horizontal scrolling, but until then I find working in Zoom mode (aka pseudo-fullscreen) to be nearly as effective, while providing the benefit of distraction-free coding. I could change the Window Size parameters in TextEdit’s preferences, but I decided to add a keyboard shortcut, since the native Zoom function doesn’t have one.

Keyboard Shortcut

This can be done very easily in the System Preferences by going to the Keyboard Shortcuts area. Now, after opening a document I can hit the ⇧⌘M shortcut and the window goes full-screen. I chose ⇧⌘M because ⌘M is the native shortcut for minimizing, so I figured the shifted shortcut would make sense for maximizing, and because (⇧)⌘Z is already used for editing.

Bonus Tip: Navigating Controls with the Keyboard

Sometimes I get into situations where I am rarely moving my hands away from the keyboard. But, in OS X, whenever dialog boxes appear the only option that can be chosen with the keyboard is the primary action button, unlike in Windows where one can easily highlight different options using the Tab Key. Fortunately, there is an option in the Keyboard Preferences that can be enabled for just this purpose:

Keyboard Tab Controls