Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin for opening file browser from prompt #1039

Closed
wants to merge 1 commit into from

Conversation

lonnon
Copy link

@lonnon lonnon commented Mar 28, 2012

  • Contains functions for invoking various OS-specific utilities that open a directory in the system's file browser.
  • Also suitable for popping open URLs and files in whatever the system thinks is appropriate.
  • Supports Windows, Cygwin on Windows, OS X, Gnome, KDE, and possibly others via XDG.

* Contains functions for invoking various OS-specific utilities that
  open a directory in the system's file browser.
* Also suitable for popping open URLs and files in whatever the system
  thinks is appropriate.
* Supports Windows, Cygwin on Windows, OS X, Gnome, KDE, and possibly
  others via XDG.
@mcornella
Copy link
Member

This needs to separate the logic into different platforms, rather than just falling into the next command if the first is not found. In Linux, for example, there is a package that adds a start command that starts services, not like the start in Windows.
Also, as far as I know, xdg-open is always going to work in Linux without spitting out any errors in the console, while gnome-open will most likely open nautilus and probably spit some error or debug message.

In my system, I have alias o=xdg-open to open whatever file with the default application, and alias o.=xdg-open . to open the current directory.

@mcornella
Copy link
Member

@lonnon any updates?

@halilim
Copy link
Contributor

halilim commented Aug 18, 2014

A simple version of this (with just open and xdg-open) is already used in four of the plugins: https://github.com/robbyrussell/oh-my-zsh/search?utf8=%E2%9C%93&q=xdg-open&type=Code (and with the exact same code, now talk about DRY!).

Also note that you can open files using this if you specify a file with the default editor configured for the type of the specified file.

And if we are going to follow @mcornella's suggestion for detecting platform, you may want to use $OSTYPE instead of uname: #2744

@mcornella mcornella removed the Status: testers needed Pull Requests that are waiting for testers to merge label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin Platform: Linux Issue or PR for a Linux system Platform: macOS Issue or PR for macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants