mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-29 20:14:36 +02:00
fix(neo-tree): better copy file name with Y
This commit is contained in:
parent
93342f15ba
commit
eccf3b5e68
1 changed files with 5 additions and 7 deletions
|
@ -57,17 +57,15 @@ return {
|
||||||
bind_to_cwd = false,
|
bind_to_cwd = false,
|
||||||
follow_current_file = { enabled = true },
|
follow_current_file = { enabled = true },
|
||||||
use_libuv_file_watcher = true,
|
use_libuv_file_watcher = true,
|
||||||
commands = {
|
|
||||||
copy_file_name = function(state)
|
|
||||||
local node = state.tree:get_node()
|
|
||||||
vim.fn.setreg("*", node.name, "c")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
["<space>"] = "none",
|
["<space>"] = "none",
|
||||||
["Y"] = "copy_file_name",
|
["Y"] = function(state)
|
||||||
|
local node = state.tree:get_node()
|
||||||
|
local path = node:get_id()
|
||||||
|
vim.fn.setreg("+", path, "c")
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default_component_configs = {
|
default_component_configs = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue