From b74ef23a27dc4efc1cf76f14eb5ecced963d694d Mon Sep 17 00:00:00 2001 From: Uthman Mohamed <83053931+uthmanmoh@users.noreply.github.com> Date: Sat, 23 Mar 2024 03:15:04 -0400 Subject: [PATCH] feat(neo-tree): add mapping "O" to open with system default (#2758) * feat(neo-tree): add mapping "O" to open with system default * feat(neo-tree): add OS checks for system default open commands * Use `vim.ui.open` if exists * update OS checks * Just use vim.ui.open or throw error if doesn't exist * Make "O" undefined mapping if vim.ui.open isn't available * fix: use lazy's util.open instead --------- Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com> Co-authored-by: saeedahsan Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/editor.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 6a934d9f..622d7b3f 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -67,6 +67,12 @@ return { end, desc = "copy path to clipboard", }, + ["O"] = { + function(state) + require("lazy.util").open(state.tree:get_node().path, { system = true }) + end, + desc = "open with system application", + }, }, }, default_component_configs = {