Skip to content

Commit

Permalink
feat(nvim): add mapping for opening with system viewer in neo-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
uyha committed Nov 6, 2023
1 parent 919fa00 commit 32de3cc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nvim/lua/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,15 @@ return {
["<cr>"] = "open_with_window_picker",
["<C-x>"] = "split_with_window_picker",
["<C-v>"] = "vsplit_with_window_picker",
["o"] = "system_open",
},
},
commands = {
system_open = function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.jobstart({ "xdg-open", path }, { detach = true })
end,
},
},
}

0 comments on commit 32de3cc

Please sign in to comment.