Export EDITORnano export VISUALEDITOR.
How to set default text editor mac. Configure your Mac to open all txt files with SublimeText by default Follow these steps as posted by David Resnick in a prior answer Right click on a txt file in Finder. Click Mail in the menu bar at the top of the screen. Convert rich text documents to other formats.
To switch to your editor of choice say nano you will need to add the following lines to your zshrc file if your default shell is zsh or bash_profile if your default shell is bash. In the top bar at the very top of you mac screen click FILE and then GET INFO. In this example I am setting my rb ruby files to open with my most favorite and be.
Theres no space around the equals sign this is important and the command can be anything. Otherwise use one of the command-line editors. The editor name is string base so watch out for typos.
Quick video on how to set file extensions to open with a given program. If you want to use a graphical text editor use TextEdit in Launchpad. Then it will be used as the default editor for any text-based file that doesnt yet have an application preference for its extension.
You can launch the default text editor by using NSWorkspace for any txt file once you know the path usually you launch Text Editor to edit txt file NSWorkspace sharedWorkspace openFiletxtFilePath. It could be Firefox it doesnt care. The additional entries in the context menus are specified in the registry.
To change the default text editor across the board use the aforementioned method ie Get Info Open with editor of choice Change All ontxt files. Expand Open with and choose your preferred text editor in the drop-down. If youre on a Mac you can configure Git to use the built-in text edit editor instead.