Non Text Files
Sublime Text plugin to open files with external apps and prevent preview of binary files
Details
Installs
- Total 13K
- Win 7K
- Mac 3K
- Linux 3K
Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 5 | 5 | 1 | 1 | 3 | 1 | 0 | 0 | 0 | 0 | 1 | 2 | 1 | 1 | 0 | 6 | 2 | 0 | 3 | 0 | 0 | 1 | 2 | 2 | 3 | 8 | 5 | 4 | 2 | 5 | 2 | 3 | 0 | 6 | 3 | 2 | 3 | 4 | 0 | 3 | 2 | 2 | 3 | 5 | 3 | 3 |
Mac | 1 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 3 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 | 2 | 1 | 2 | 0 | 0 |
Linux | 0 | 3 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 2 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 3 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
Non-Text-Files Sublime Text plugin
Sometimes it would be more useful if Sublime Text launched the default application for certain file types instead of displaying it in the editor. For example, if you open a PDF from the Sublime Text sidebar, the incomprehensible stream of compressed data is most often not what you intended to view. Instead you would like to view the document using your default viewer, be it Acrobat or Evince or any other.
This plugin offers settings and commands to control when Sublime should open certain files with external applications.
There is an option to turn off previews for binary files and options to open files with their default external applications.
If you like this plugin and would like to support its development please consider donating through a paypal donation.
Changelog
v1.3
- “Open Externally” should now handle right click on sidebar correctly (fixes #2)
v1.2
- multiple matching patterns do not trigger open multiple times
- double click behaviour is now more stable and predictable
- preview closing is more reliable
Installation
Install Sublime Text
Install the plugin either:
- with Package Control: see https://sublime.wbond.net/docs/usage, or
- manually: by cloning this repository in your Sublime Text Package directory
Customise the
open_externally_patterns
setting in your preferences (Preferences > Settings - User
)
Features and settings
Prevent Binary File Preview
When the setting prevent_bin_preview
is set to true
(default), clicking on a file matching any of the binary_file_patterns
would not open the file.
Double click will open it normally: this is useful when using plugins like HexViewer or Zip Browser.
The prevent_bin_preview
settings can be set globally in the User/Preferences.sublime-settings
file or locally to a project.
Open files with external applications
Sometimes it would be more useful if Sublime Text launched the default application for certain file types instead of displaying it in the editor.
This plugin allows you to do that via a special option: the files matching any of the open_externally_patterns
will be opened with the default application as configured in your OS instead of using Sublime. You can set it globally in the User/Preferences.sublime-settings
file or locally to a project.
This setting follows the same syntax of the binary_file_patterns
setting: it is just a list of glob patterns. An example:
"open_externally_patterns": [
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.zip",
"*.pdf"
]
The plugin also offers a window command open_externally
that opens a file with the default application. It takes two optional arguments:
path
is the path of the file to be opened; if empty the file of the current view will be opened;then_close
if true will close the view after opening the file.
You can bind this command to a shortcut by adding the following to your keymap:
{
"keys": ["super+enter"], "command": "open_externally",
"args": {"then_close": false}
}