Pluralsight blog Where devs, IT admins & creative pros go for news, tips, videos and more.
3,500+ tech & creative courses authored by experts - unlimited & online Get it now →
March 25, 2010

Am I the only one who uses a text editor to edit files?

By

Files should be navigable by file, class, or method name and show metadata useful for distinguishing between similar files (mockup).

Files should be navigable by file, class, or method name and show metadata useful for distinguishing between similar files (mockup).

If I had no experience with computers and were to guess which
group of people had the best software tools to do their job, I
would guess “computer programmers.”

And if I were to guess what task would have been extensively
optimized, I would guess “opening files.”

If you are a programmer, you know that I would be wrong.

Last summer, Dave Peck wrote about his hopes for a modern,
progressive, text editor.1 I’d like to focus on one missing feature
that’s absolutely possible today: powerful file navigation.

Keyboard

Perform any navigation task without touching the mouse.

Fuzzy Search

Find files by typing only a few letters.

Paths

Search includes folder names (relative to the project).

Metadata

File modification date and SCM status aid in file picking.

Beautiful

Terminal raster graphics don’t count! I want GUI beauty.

As every Vim user knows, most of one’s time spent in a text editor is
spent editing, not writing (this is why Normal mode in Vim is
the one you use for navigation and editing).

For most programming tasks, editing involves opening several files at
once and switching between them (e.g. HTML/JavaScript/CSS).

I’m talking about three tasks:

  • Open any file on the computer.
  • Open any file in the current project.
  • Activate a file that’s already open in another tab.

And yet most text editors offload these important tasks to the
operating system or implement half-hearted custom solutions. Even
worse, third-party plugins frequently implement file-jumping
functionality for different frameworks with unique, cryptic key
mappings (e.g. between implementation and test or controller and
view template).

This is a core task! Editors should approach it with the same
innovation and care they spend on basic text entry.

TextMate
Keyboard
Fuzzy
Beautiful

Command-T with fuzzy search was revolutionary and was one of the
main reasons I bought a copy of TextMate. But it breaks down for
projects with many files of the same name (such as Ruby on Rails).

There’s no way to filter by directory.

There’s no way to filter by directory.

Tabs are even worse. I frequently open more tabs than can fit on
my screen, which means that both usability and the extra tabs
get thrown out the window
. The tab menu can only be accessed
with the mouse and becomes a human-powered binary search of an
unsorted list.2

Xcode

Xcode’s Open Quickly command (Command-Shift-D) only works with
the exact file name starting with the first letter.

Xcode’s Open Quickly dialog

Xcode’s Open Quickly dialog

Many Cocoa developers store all their code files in the root
directory
of the project and rely on Xcode’s virtual directories
for organization, which is the only reason it’s even barely
usable
.

Emacs

Emacs is the closest to satisfying my requirements.

The ido-menu provides fuzzy search, including pathnames. Chris
Wanstrath’s textmate.el plugin3 wraps it in even more useful
functionality, such as autodiscovery of a project root based on
the existence of a .git directory.

Open buffers (similar to tabs) can be searched for by name (C-x b) or in a list (C-x C-b).

But the inline menu is an ugly paragraph.

A powerful search hidden behind a mess of text.

A powerful search hidden behind a mess of text.

“The only solution I can think of, so far,
Is to smash out the windows with a crowbar.” — Buck 65

Once you start thinking about making file navigation better, the
ideas flow freely. Could a dialog search on class or method
names
instead of just filenames? What about a free-form search for
times and classes such as “yesterday Bacon#save”?

This article started with pain, developed into an idea, and ended up as an unexpected prototype implemented in MacRuby. I’m using it daily and am fine-tuning the interaction, visuals, features, and performance.

The initial prototype performs a fuzzy search on paths and lists file modification dates.

The initial prototype performs a fuzzy search on paths and lists file modification dates.

You can contribute your own froth over the design and content of this article with the Neanderthals at Hacker News.

1 Dave Peck sends supplication to the text editor gods.

2 The RubyAMP bundle for TextMate shows a simple list of open windows, but without fuzzy search.

3 Chris Wanstrath’s textmate.el

About the Author

is VP of Open Source at Pluralsight. He previously founded PeepCode and is an all around entrepreneur, developer, designer, teacher and athlete. Follow him on Twitter at @topfunky.


Discussion