When I was but a teenager, a neighbor of mine once bought a brand-new Harley-Davidson motorcycle and had it torn apart, sitting on stands in his front yard two days later. My dad and I walked over to see what he was doing, as we were completely shocked by what he had done.
“What’s wrong with your bike?” my dad asked him.
“Nothing,” he said. “I just wanted to tinker a little bit with it.”
It’s a good thing Coda doesn’t cost as much as a Harley-Davidson motorcycle, because one of the first things I want to do with any new program is to “tinker a little bit with it” and set it up to my preferences.
Selecting Coda → Preferences from the menu brings up a window where you can tinker to your heart’s content. There are nine tabs to choose from, so let’s set up Coda the way we like it.
When editing files that can be previewed within Coda, such as an HTML file, you can split the viewing area. For example, your code could be in one split pane, and a preview of what you’re editing could be in another. This preference sets the default for whether the split is horizontal or vertical.
An added bonus is that you can quickly switch to the opposite of your default setting by holding down the Option key when splitting a direction in editor, followed by clicking the Split button in the path bar.
Don’t you just love it when you paste something from a word processing document only to have it to look all goofy when you load the page in a browser? We’ve all seen something like “â€” before. You can blame file encoding for that, causing things like your quotation marks and apostrophes to end up as “confused characters”.
Let’s take a file with ASCII text encoding. To display a letter in the English (Latin) alphabet, it might use a certain set of instructions that, when opened in a different text encoding, displays differently. This can occur when dealing with files across national boundaries, and if you’re ever in the position where you work with someone from another country, you should be aware of it. It would be a shame if all your A’s ended up looking like å or something.
You can select a default file encoding from this selection or customize the encodings list to have only what you prefer.
At some point, we’ll no doubt end up exchanging files with another developer who might be using a different system than a Mac. It’s a cruel world, but we have to live in it. Because of this, we’ll need to know some subtle nuances of other operating systems and how those systems use different ways for showing ends of a line in text files.
Choose from one of the three common line endings available for their respective operating systems:
Below the Default Line Endings selection are some additional options for your editor preferences:
In most cases, Coda will automatically match the correct syntax mode with the file extension, such as HTML for .html files or Ruby for .rb ones. However, it is possible to create a new file with no extension right off the bat, so be mindful of how to change it.
Coda is pretty smart, but there might be times where it doesn’t recognize a file extension and therefore doesn’t know which syntax mode to assign to the file. When this happens, you’ll need to do that here. Click the plus button at the bottom of the Custom Syntax Mode window. Then create the extension name and assign a syntax mode from the list of available options.
Additional modes can be downloaded as plug-ins from Panic’s website. After downloading a third-party plug-in, follow the instructions included. You can manually copy the .mode file using a Terminal window into ~/Library/Application\ Support/Coda\ 2/Modes/. Using the Finder, navigate to your user account’s Home folder, and then drop the file into Library → Application Support → Coda 2 → Modes.
Starting with Mac OS 10.7, the Home folder’s Library is hidden. To make it viewable in the finder, hold the Option key and select Go from the Finder menu. This will temporarily allow for easy access to the Library. For the daring, you can also open a Terminal window and type
chflags nohidden ~/Library/ to make it appear, and
chflags hidden ~/Library/ to hide it again if you wish.
Coda includes a collaborative editing mode that lets multiple people simultaneously edit the same file in real time over a network. We cover this more extensively in Chapter 5.
The info in the Sharing tab includes the personal information you’ll display to a collaborator, as well as the color for your edits.
Coda ships with four stylesheets. Birds of Paradise and Specials Board have darker backgrounds, while Coda Bright and Coda Classic are lighter. These act as a kind of base for customizing the colors of the text editor. Other customizations include highlighting the current line, syntax coloring, and the ability to change the document background, document text, line highlight, and invisible character colors.
Also included are text and background color options, as well as bold, italic, underline, and strikethrough settings.
You won’t be limited to these options, however. To the right of the stylesheet dropdown is a setting menu for importing and exporting the .sss file associated with the color scheme chosen. The .sss file extension is a Coda stylesheet, and you can use this file to create your own style or to back up your preferred colors.
Fortunately, if you really screw up, there’s a Revert All button to help you get back to the style sheet defaults.
Have Coda choose from the following while your code is under version control, particularily when working with a repository that others are also making changes to:
When you’re ready to deploy your website or application, Coda gives you four options to set as default for downloading and uploading files and folders if an item already exists:
You can limit uploads and downloads to a set number of kilobits per second, and set the maximum number of files for simultaneous transfer.
Here you can use passive mode for data transfers, although according to Coda’s Transfers tab, Sites “have their own passive setting which overrides this one.” Still, it is possible to transfer files outside of a Site in Coda, using its FTP. If you need this option, it’s available.
Also, you can choose to set an audible alert to let you know when a transfer has completed.
Lastly, there are ASCII File Extension options pre-loaded, or you can add (or delete) to your own preferences.
Coda’s Rules preferences will give you the ability to really fine tune your workflow. It allows you to hide certain files (overriding operating system defaults). Conversely, it allows you to hide certain things contrary to OS defaults. Lastly, it allows you to filter certain files from uploading (e.g., PSDs, BMPs, and so on). With File Rules and Permissions, Coda is at your disposal to play nicely with your preferred workflow.
Coding with a plain, white background just doesn’t feel right. I prefer instead to set up my environment with a more colorful aesthetic.
Click the checkboxes if you want each option to be “yes”:
Working with a proxy server? Coda has advanced options for integrating it into your work environment. Choose from Proxy Server Type, Proxy Server name, Proxy Port, Proxy User Name, Proxy Password, and an option to “Try to keep idle connections alive.” Advanced setting options are also available.