local g={"\110\118\105\109-\116\114\101\101\047\110\118\105\109-\116\114\101\101\046\108\117\097",version="\042",lazy=false;dependencies={"\110\118\105\109-\116\114\101\101\047\110\118\105\109-\119\101\098-\100\101\118\105\099\111\110\115"};keys={{"\060\108\101\097\100\101\114\062\101";"\060\099\109\100\062\078\118\105\109\084\114\101\101\084\111\103\103\108\101\060\099\114\062";desc="\084\111\103\103\108\101 \069\120\112\108\111\114\101\114"}};config=function()(require("\110\118\105\109-\116\114\101\101")).setup({sort_by="\099\097\115\101\095\115\101\110\115\105\116\105\118\101";view={width=30},renderer={group_empty=true};filters={dotfiles=true};on_attach=function(g)local z=require("\110\118\105\109-\116\114\101\101\046\097\112\105")local function P(z)return{desc="\110\118\105\109-\116\114\101\101\058 "..z,buffer=g;noremap=true,silent=true,nowait=true}end local function O(g)g=g or(require("\110\118\105\109-\116\114\101\101\046\108\105\098")).get_node_at_cursor()local z=g.absolute_path local P=vim.fn.input("\067\111\112\121 \116\111\058 ",z,"\102\105\108\101")local O=vim.fn.fnamemodify(P,"\058\104")vim.fn.system({"\109\107\100\105\114","-\112",O})vim.fn.system({"\099\112";z,P})end z.config.mappings.default_on_attach(g)vim.keymap.set("\110","\060\067-\116\062",z.tree.change_root_to_parent,P("\085\112"))vim.keymap.set("\110","\063",z.tree.toggle_help,P("\072\101\108\112"))vim.keymap.set("\110","\099",O,P("\067\111\112\121 \102\105\108\101"))end})end}return g
-- File browser tree view
local M = {
  'nvim-tree/nvim-tree.lua',
  version = '*',
  lazy = false,
  dependencies = {
    'nvim-tree/nvim-web-devicons',
    -- To install the font with the icons used by tree view:
    -- brew tap homebrew/cask-fonts
    -- brew install --cask font-fira-mono-nerd-font
  },
  keys = {
    { '<leader>e', '<cmd>NvimTreeToggle<cr>', desc = 'Toggle Explorer' },
  },
  config = function()
    require('nvim-tree').setup {
      sort_by = 'case_sensitive',
      view = {
        width = 30,
      },
      renderer = {
        group_empty = true,
      },
      filters = {
        dotfiles = true,
      },
      on_attach = function(bufnr)
        local api = require 'nvim-tree.api'

        local function opts(desc)
          return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
        end

        -- Helper function to copy file.
        -- The default copy action for the nvim-tree just copy the file content,
        -- and this custom action copy it to path directly.
        local function copy_file_to(node)
          node = node or require('nvim-tree.lib').get_node_at_cursor()
          local file_src = node.absolute_path
          -- The args of input are {prompt}, {default}, {completion}
          -- Read in the new file path using the existing file's path as the baseline.
          local file_out = vim.fn.input('Copy to: ', file_src, 'file')
          -- Create any parent dirs as required
          local dir = vim.fn.fnamemodify(file_out, ':h')
          vim.fn.system { 'mkdir', '-p', dir }
          -- Copy the file
          vim.fn.system { 'cp', file_src, file_out }
        end

        -- default mappings
        api.config.mappings.default_on_attach(bufnr)

        -- custom mappings
        vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts 'Up')
        vim.keymap.set('n', '?', api.tree.toggle_help, opts 'Help')
        vim.keymap.set('n', 'c', copy_file_to, opts 'Copy file')
      end,
    }
  end,
}

return M
