one of the best editors to work with code, and it's free!
TextWrangler has been developed by Bare Bones as the all-purpose text and code editor for macOS. However, it was discontinued, but you can find similar features in other Bare Bones product – BBEdit.
Key Features
Editing: the user can write and edit the code in the program. You just have to type the keyword of the text that needs to be replaced. When it appears, you can edit it right away.
Programming: BBEdit has a function navigator for HTML/XHTML, Javascript, Unix shell scripts and many others. It also has optional language-sensitive switching of document settings and enables to put some colors to the text schemes.
File recovering: the program has the ability to recover and read damaged or corrupted file whatever its formats and recover it.
Server administrator's tool: BBEdit gives the possibility to open files on remote FTP and SFTP servers. Even if the user is not the administrator of the account, he can still open it and make changes. Saving that file is also possible.