feat: add copy filename action (#391)
This commit is contained in:
parent
d3a365c950
commit
bbc0e67eeb
2 changed files with 14 additions and 0 deletions
|
|
@ -456,6 +456,9 @@ change_sort *actions.change_sor
|
|||
close *actions.close*
|
||||
Close oil and restore original buffer
|
||||
|
||||
copy_entry_filename *actions.copy_entry_filename*
|
||||
Yank the filename of the entry under the cursor to a register
|
||||
|
||||
copy_entry_path *actions.copy_entry_path*
|
||||
Yank the filepath of the entry under the cursor to a register
|
||||
|
||||
|
|
|
|||
|
|
@ -268,6 +268,17 @@ M.copy_entry_path = {
|
|||
end,
|
||||
}
|
||||
|
||||
M.copy_entry_filename = {
|
||||
desc = "Yank the filename of the entry under the cursor to a register",
|
||||
callback = function()
|
||||
local entry = oil.get_cursor_entry()
|
||||
if not entry then
|
||||
return
|
||||
end
|
||||
vim.fn.setreg(vim.v.register, entry.name)
|
||||
end,
|
||||
}
|
||||
|
||||
M.open_cmdline_dir = {
|
||||
desc = "Open vim cmdline with current directory as an argument",
|
||||
callback = function()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue