Skip to content

Commit

Permalink
feat: action to copy path to entry under cursor (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jan 28, 2023
1 parent 47a9097 commit 6581d76
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/oil/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,18 @@ M.open_cmdline = {
end,
}

M.copy_entry_path = {
desc = "Copy the filepath of the entry under the cursor to the + register",
callback = function()
local entry = oil.get_cursor_entry()
local dir = oil.get_current_dir()
if not entry or not dir then
return
end
vim.fn.setreg("+", dir .. entry.name)
end,
}

M.open_cmdline_dir = {
desc = "Open vim cmdline with current directory as an argument",
callback = function()
Expand Down

0 comments on commit 6581d76

Please sign in to comment.