72

Another option is to use duti (https://github.com/moretension/duti). Run brew install duti, save a filetype like this as: duti -s com.sublimetext.3 public.plain-text all The changes should be applied immediately, so you don't have to restart like when editing com.apple.LaunchServices.plist. To also change the default application for executable scripts ...


61

To set Sublime Text as the default handler for public.plain-text: Mavericks (10.9) and earlier defaults write com.apple.LaunchServices \ LSHandlers -array-add \ '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}' Yosemite (10.10) and later Use com.apple.LaunchServices/com.apple.launchservices.secure. defaults write com....


40

I tried grg's solution in the past and I believe it worked. However, on Yosemite and El Capitan, I ran into problems. DonnaLea's comment in that solution clued me in on creating a solution. I added the folder path before com.apple.launchservices additionally the file had a slightly different name com.apple.launchservices.secure. You can see the file/...


30

Right click on a .txt file in Finder. Choose "Get Info". Expand "Open with:" and choose your preferred text editor in the drop-down. Push the "Change All..." button below the drop-down and then confirm in the dialog that pops up with "Continue". This works on Yosemite (OS X 10.10).


29

For plaintext tabs, you don't need to replace the entire TextEdit app to change it. I looked at the source code and it provides the simpler answer: Open the Terminal and type defaults write com.apple.TextEdit "TabWidth" '4' Where '4' is the number of spaces a tab should be.


24

The solutions proposed here work perfectly for Sublime, but I wanted to do this for Visual Studio Code. The only difference is that you have to find the "application bundle identifier" for whatever text editor you use. I ran this command: /usr/libexec/PlistBuddy -c 'Print CFBundleIdentifier' /Applications/Visual\ Studio\ Code.app/Contents/Info.plist link ...


21

By opening atom and going via Atom > Install Shell Commands you will get atom and apm commands.


21

Go to Edit → Substitutions and disable Smart Dashes. You can disable this globally in System Preferences: Keyboard → Text. Disable ‘Use smart quotes and dashes’. To only disable the dash substitution globally whilst leaving smart quotes enabled by adding the substitution to System Preferences: Keyboard → Text. Add a new entry set to -- for both ‘replace’ ...


14

Hey I just came across this question because today I just started to use Stickies as a To-Do list for things I need to finish over the day and I also wanted to have that feature that you strikethrough items or text you are done with… I think an easy workaround for this is that you have lets say 3 items, then you go to mark your first item with the ...


13

This has stymied me for quite some time, and today I found the way to enable this for open documents. At the very top of the Document in BBEdit in the left hand corner, you will find the path of the file you are currently editing immediately preceded by a small gear icon. Click the gear icon and place a check in the box next to "Auto-expand Tabs".


11

Most people I know set the paste shortcut to invoke paste and match style. Here is the command to change: You can paste with style when you really want it, but for me 95% of the time I don’t want the style and only the raw text. Open System Preferences Select Keyboard Go to the Shortcuts tab Select App Shortcuts Select the + button Type Paste and Match ...


9

Mou Mou is my favourite Markdown editor for editing GitHub files and other documentation. Its live preview is priceless for editing in this way, especially using the specifically-designed GitHub theme that mimics the end result as shown on GitHub's preview and wiki pages. The app also lets you export to HTML along with the CSS so that you can upload the ...


9

Table Tool Free and Open Source (MIT License). Table Tool opens CSV files. It auto-detects character encoding and record separator (comma/semicolon/tab), and supports basic editing operations (like add row, delete row, add column delete column etc). Table Tool can convert files to a different format. Table Tool is also available on the Mac App Store.


9

I use these two text editors and I think both are pretty good: Sublime Text: Although it's not "free", it lets you use it for trial indefinitely. It just keeps asking you to buy it every 10-15 time you save a document. Atom: Which is a text editor developed by GitHub and very similar to Sublime Text, except that it's free. Totally. Since it's new in ...


7

Per Apple's Support Article: To save the file, press Control-O. At the filename prompt, press Enter. To exit, press Control-X.


7

As shown in this answer on SuperUser, you can set this behaviour by changing the open_files_in_new_window setting in Sublime Text to false. (Note that it's recommended that you override the setting in the Settings - User file rather than changing it in Settings - Default.)


6

LibreOffice LibreOffice does quite a good job now and is compatible even with OS X 10.9


6

Numbers Disclaimer: Free on new Macs Apple Numbers also opens and saves to CSV. Just had to add to the list. Numbers: Save as CSV after editing: Note that you can choose text encoding as well when exporting if needed for other systems.


6

If you search for a comfortable way with more "linux feel" add something like the following to your ~/.profile: alias textmate='open -a TextMate' or alias textedit='open -a TextEdit' depending on your editors.


6

Depending on the source of the file, you may wish to investigate its contents in other ways than just opening it (double clicking). For this, you should use the command line. Some suggested starting points (where "whatever.xml" is the name of the file): file whatever.xml This will tell you what type the file is. Not by file extension, but by actual ...


5

DB Browser for SQLite Not an obvious candidate but very powerful (and free). Steps Create an empty Database Import Table form CSV file With various import options Edit, search, plot the data Export your edits as (new) CSV file


5

Stickies! The OS X version of this app that's been on Macs since System 7.5 has the ability to float, and become semitransparent. Technically it's a rich-text notetaking app rather than a plaintext editor, but it might satisfy your use case. Another option (quite the polar opposite of Stickies) would be to use an editor within Terminal, and use ...


5

I centralize all my default apps management with Magic Launch. You can configure it to open all txt with Sublime Text as default without command line (beside, you can change it easily from System Preferences). One more exceptional useful Magic Launch’s feature is you can set rules based on filename, folders location, which I use intensively to choose ...


5

NoteAway is a free* menu bar oriented notes app that seems ideal for your situation. * with pro in app purchase


5

Any texteditor & textutil Still intrigued by your problem I found the following solution. There is a Terminal app called textutil and it allows to convert richtext to plane text. Edit and save your 'Rich' text anyway you want to (like in TextEdit). Use the commandline textutil to convert your rich text to normal text textutil richtext.rtf -convert txt ...


5

Not with paragraph styles, no. You can do this with a single cell table which can be inlined and have a left border style different to the others.


5

I don't think that's possible. OS's usually needs register how to handle each file first. But it's not all lost: here is a situation that Automator can handle easily. Here I'll show you, how to create a item menu in the right click context menu, that you can easily select to open your file, better than Open With option. Steps: Create a new Service with ...


5

As I understand, you have a Python script in BBEdit. You choose to test the code using the "Run in Terminal" option from the '#!' menu. Now a Terminal window opens, runs the script and exits. Now here is the culprit. BBEdit does not only run your script, but also adds an exit. There is no option in BBEdit to remove this exit command. But BBEdit is highly ...


5

Since you did ask "What other options for command-line text editors are built into macOS?" and ed was not mention in your OP, let me offer it as an addition to the list. The manual page for ed states: The ed utility is a line-oriented text editor. It is used to create, display, modify and otherwise manipulate text files.


Only top voted, non community-wiki answers of a minimum length are eligible