diff --git a/src/plugin_directory_navigation.cpp b/src/plugin_directory_navigation.cpp index 3eec84d..ad98578 100644 --- a/src/plugin_directory_navigation.cpp +++ b/src/plugin_directory_navigation.cpp @@ -8,6 +8,16 @@ void CMD_OpenUpFolder() { Open(name); } RegisterCommand(CMD_OpenUpFolder, "ctrl-o", "Open current's file directory or up directory in other cases"); +void CMD_OpenSystemFileBrowser() { + Scratch scratch; + String string = GetPrimaryDirectory(); +#if OS_WINDOWS + Open(Format(scratch, "!!explorer %S", string)); +#else + Open(Format(scratch, "!!xdg-open %S & disown", string)); +#endif +} RegisterCommand(CMD_OpenSystemFileBrowser, "ctrl-alt-r", "Opens the directory of current file in the systems file browser"); + void InsertDirectoryNavigation(Buffer *buffer) { Assert(buffer->is_dir); Scratch scratch;