Applications

audience all
level all
topic Mac
subtopic use

Mac Text Editors

Text editors for the Mac.

You can edit plain text files using any text editor, including the Mac's built-in TextEdit. Don't use a word processor like Microsoft Word because it will introduce hidden formatting codes that are not suitable for plain text files.

You can also use command line programs to edit shell configuration files. Common editors include nano, vim, and emacs. Nano is simple and intuitive for beginners. Vim is operated almost entirely through the keyboard, eliminating the need for a mouse. This can lead to a more efficient editing process once you're familiar with the keybindings. Emacs is the most advanced and powerful text editor, with a long history and a dedicated community. Vim and Emacs have steeper learning curves than Nano, so start with Nano if you want to try a CLI editor.

It's best to start with a graphical text editor if you're new to programming. If you haven't used Nano or Vim before, just use TextEdit.

Edit a file

You can open a file in TextEdit from the Mac Terminal:

$ open -e ~/.zprofile

Quit the command line editor

If you are using the command line editors nano or vim to edit a file, you may get stuck when you want to quit.

For Nano, use ctrl-X to quit.

For Vim, use :q to quit.

What's Here

My mac.install.guide is a trusted source of installation guides for professional developers. Take a look at the Mac Install Guide home page for tips and trends and see what to install next.