Mac Set Default Editor For File Type

Active5 years, 2 months ago

Some time ago I set up Sublime text 2 as my default editor for GIT in the command line terminal. I would now like to change it to LightTable, but am having some trouble. I have set both the VISUAL and EDITOR environment variables to LightTable and that does the trick for most extensions. But even though I set the .gitconfig file editor variable to LightTable as well, using several variations of this command:

and this one:

Linux Set Default Editor

It’s much easier to tell your Mac to simply make its default editor whatever you’d like. We use TextWrangler. Make life easy, and set your Mac so that every time you open a particular type of file, it opens in your program of choice. Now that you can see all file extensions in the Finder or Windows Explorer, you can select an example file and change its associated program for all files carrying that extension. In Windows, right-click any file containing an extension that’s confusing InDesign’s Edit Original (e.g., if it opens.jpg files in the wrong program, right-click. Rather than change the default application for the file type, which is often not what the user wants, or manually launch the non-default app and open the file by hand, Windows includes a useful. Even if your Mac is assigned a different IP address by its router, 127.0.0.1 defaults to the local machine thanks to the default settings in that hose file. Once you're done, hold down the control and O keys to save the file, then control and X to exit. SourceTree uses the default 'Open With' application like Explorer. As far as I know other than changing the default application used by each file extension you cannot change the behavior of the menu item in SourceTree.

it is continuing to open .md files with sublime text 2. Other file extensions are also opening with TextEdit or other applications. Is there an easy way to reign in the chaos and set my default opening applications based on extension? I have read the man page for open and it mentions LaunchServices, but I can't find that on my hard-drive. I'm using bash with Unix(Darwin) on a mac running OSX. Thanks in advance!

kurofunekurofune

1 Answer

The problem is that /Applications/LightTable.app isn't an executable, it's an application bundle. You can double-click on application bundles from the Finder, but you can't run them from the terminal. See for yourself

You will have to specify the full executable path, something like LightTable.app/Contents/MacOS/LightTable. I don't know exactly what it is.

Dietrich EppDietrich Epp
161k29 gold badges267 silver badges354 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged macosgitbashenvironment-variableslighttable or ask your own question.

OpenOffice.org (OOo) is a free office and business productivity suite that is a good alternative to costly Microsoft Office suite. Not only is OpenOffice.org is free to download, use and distribute, it’s also an open-source project, multiplatform, multilingual and compatible with all other major office suites, including Microsoft Office 2003, XP, 2000 and 97, with support for Office 2007 slated in upcoming release of OpenOffice. The problem is the other way round is not true, as Microsoft Office does not support OpenOffice.org file formats by default.

OpenOffice.org support most Microsoft Office file formats, and can open and import Microsoft Office files such as Word documents, Excel workbooks and PowerPoint presentations. But Microsoft Office Word, Excel and PowerPoint do not support and cannot open OpenOffice file formats by default, thus making sharing of documents and files across platform difficult, especially if you want to send a file to a Microsoft Office user, or you have a mix of Microsoft Office users in your organization. So, for sharing or viewing and editing of documents with Microsoft Office programs, the files must be saved in a Microsoft Office format or in .rtf.

Set Default By File

By default, OpenOffice.org will save in native file formats and extensions, i.e. Writer documents in .sxw (document) or .stw (template), Calc spreadsheets in .sxc (document) or .stc (template) and Impress presentations in .sxi (document) or .sti (template). So if you always want to save the files in Microsoft Office compatible formats such as Word .doc or .dot, Excel .xls or PowerPoint .ppt, you can configure OpenOffice.org to set or change the default file format for the document file type so that it will always save in Microsoft Office format, without the need to select the file format every time when saving a file.

To change or set default file saving or “save as” format for new files in OpenOffice.org:

  1. Launch any OpenOffice.org application such as OpenOffice Writer.
  2. Click on Tools and then Options.
  3. Expand the Load/Save section in the left pane by clicking the + (plus sign).
  4. Click on General under the Load/Save section.
  5. In the area labeled as “Default file format” or “Default file format or ODF settings” near the bottom of the dialog window, select the type of document you want, for example, Text document for Writer files, Spreadsheet for Calc, or Presentation for Impress, in the Document type drop-down list.
  6. To the right dropdown list labeled as Always save as, change or select the format as Microsoft Word 97/2000/XP.
  7. Repeat the above 2 steps for other documents such as spreadsheets or presentations that you want to save in Microsoft Office file format, and select the appropriate default save as format for them.
  8. Click OK to save the settings.
  9. From now on, whenever you want to save a document, the default format will be .doc, .xls or .ppt and other Microsoft Office file formats and extensions.
TypeHow

You can also make the change to default format for saving files in OpenOffice.org by modifying setup-calc.xcu, setup-writer.xcu and setup-impress.xcu files located in C:Program FilesOpenOffice.org 2.0shareregistrymodulesorgopenofficeSetup folder. This method or workaround is useful when you want to set the default save format for multiple users and computers, where you can create a simple batch file or Unix script to copy the modified .xcu files to the Open Office installation directory and replace the existing one.

For OOo Writer:

Edit the following lines to the following value in setup-writer.xcu (this same default filter line appears twice in this file):

Mac Set Default Editor For File Type

For OO Calc:

Set Defaults For File Types

Edit the following line to looks like below in setup-calc.xcu:

For OOo Impress:

Assign Defaults For File Types

Edit the following line to the following value in setup-impress.xcu:

Set Default Application For File Types

Note: In Unix or Linux, the files may start with the capital S.