50

Set Sublime Text as the default handler for public.plain-text defaults write com.apple.LaunchServices LSHandlers -array-add \ '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}' This answer is for Mavericks and earlier. For Yosemite and later, use com.apple.LaunchServices/com.apple.launchservices.secure. defaults write com....


48

No, :w is a /usr/bin/vi command. Use the combination control+x to exit. You will be prompted to save the file if you have made unsaved changes. Nano is intended to be a bit friendlier / simpler to new users than vi/vim or emacs which both cater to more power users that have spent time learning how to use them effectively. To get started in nano - look for ...


44

Another option is to use duti (http://duti.org / 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 ...


39

I tried grgarside'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 ...


27

I'm using HexFiend to work with a 60 GB text file and it works great (apparently it can handle files as large as 118 GB).


25

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.


22

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).


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’ ...


15

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 ...


13

For Lion: It is in ~/Library/Containers/com.apple.TextEdit/Data/Library/Autosave\ Information/, e.g. Unsaved TextEdit Document.rtf. Note that ~/Library is not visible by default in Finder in Lion, but you can access it by pasting the path in Finder (without the backslash in "Autosave Information"; the formatting above is for cd-ing in Terminal.app), or ...


13

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 ...


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 ...


8

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 ...


8

Google Docs I just used Google Docs for exactly this purpose but all I needed to do was extract a column of email addresses from a CSV file. Note: Google Docs has file size limits, so this is not a silver bullet. A great bullet, but those limitations are critical when applied.


8

Shortcuts created in System Preferences will only work globally with applications that have matching Strikethrough options in their menu. This is not a feature that all rich text editors provide, thus the inconsistencies you experienced. Nevertheless, TextExpander does support rich text formatting. When creating a new snippet click the "Content" header ...


8

Found the theme files in this directory: ~/Library/Application Support/Sublime Text 2/Packages/Color Scheme - Default/(name_of_theme) You can see which theme you are using by going to (from within Sublime Text 2) Sublime Text 2 menu>Preferences>Colour Scheme and see which one is ticked. Open the theme file and find the key that says: <key>...


8

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

Sublime Text 2 I couldn't have said it better: Sublime Text has grown to become my favorite GUI code editor. It feels like a spiritual successor to TextMate (even allowing support for some TextMate bundles like snippets and themes), and has many original+natural features like fully independent text cursors, a very nice search feature, and a rapidly-...


7

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.


7

Have a look at Sublime Text. It basically is what I would expect TextMate2 to be. http://www.sublimetext.com/


7

Is this http://www.hogbaysoftware.com/products/quickcursor what you're thinking of? QuickCursor brings your favorite text editor* to any app with a global keyboard shortcut. Unlike manually copying and pasting between apps, QuickCursor automates the entire process to save you time. To use Sublime Text 2 with QuickCursor, add it's bundle ID (com....


7

It's the default application for plain text (public.plain-text) files. You can change it from Finder's information panels or with duti. You can also edit ~/Library/Preferences/com.apple.launchservices.plist, but it requires restarting to apply the changes. defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-...


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

A fine program like TextWrangler can edit binary .plist files without first converting them using Terminal. Simply open the file like you would any other (i.e. drag-and-drop on the program icon, or the File open dialog, or Open With in the Finder or...)


6

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".


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

Answers to questions like this are likely to be subjective. I tend to disagree that Emacs.app does not integrate well in MacOS. I'm currently using regular Emacs.app from emacsformacosx.com (not Aquamacs) and a few lines in ~/.emacs can easily use familiar shortcuts, e.g. try (setq mac-option-modifier nil) (setq mac-right-option-modifier 'meta) (setq mac-...


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