Cleaning up
This commit is contained in:
@@ -14,11 +14,30 @@ return {
|
||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||
},
|
||||
|
||||
build = function()
|
||||
if vim.fn.executable 'fd' == 0 then
|
||||
local install_cmd
|
||||
if vim.fn.has 'mac' == 1 then
|
||||
install_cmd = 'brew install fd'
|
||||
elseif vim.fn.has 'unix' == 1 then
|
||||
if vim.fn.filereadable '/etc/arch-release' == 1 then
|
||||
install_cmd = 'sudo pacman -S --noconfirm fd'
|
||||
else
|
||||
install_cmd = 'sudo apt-get install -y fd-find'
|
||||
end
|
||||
else
|
||||
vim.notify("Please install 'fd' manually for neo-tree.", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
vim.fn.system(install_cmd)
|
||||
end
|
||||
end,
|
||||
|
||||
opts = function(_, opts)
|
||||
local function on_move(data)
|
||||
Snacks.rename.on_rename_file(data.source, data.destination)
|
||||
end
|
||||
local events = require("neo-tree.events")
|
||||
local events = require 'neo-tree.events'
|
||||
opts.event_handlers = opts.event_handlers or {}
|
||||
vim.list_extend(opts.event_handlers, {
|
||||
{ event = events.FILE_MOVED, handler = on_move },
|
||||
|
||||
Reference in New Issue
Block a user