diff --git a/nvim/.config/nvim/lua/user/nvim-tree.lua b/nvim/.config/nvim/lua/user/nvim-tree.lua index 330f312..03cd0bb 100644 --- a/nvim/.config/nvim/lua/user/nvim-tree.lua +++ b/nvim/.config/nvim/lua/user/nvim-tree.lua @@ -1,18 +1,18 @@ -- following options are the default -- each of these are documented in `:help nvim-tree.OPTION_NAME` -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end -local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config") -if not config_status_ok then - return -end +local nvimtree = require("nvim-tree") -local tree_cb = nvim_tree_config.nvim_tree_callback +nvimtree.setup { + on_attach = function(bufnr) + local api = require("nvim-tree.api") -nvim_tree.setup { + local function opts(desc) + return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true } + end + api.config.mappings.default_on_attach(bufnr) + vim.keymap.set("n", "", api.node.open.edit, opts("Open")) + end, renderer = { icons = { webdev_colors = true, @@ -86,18 +86,10 @@ nvim_tree.setup { }, view = { width = 30, - hide_root_folder = false, side = "left", - mappings = { - custom_only = false, - list = { - { key = { "l", "", "o" }, cb = tree_cb "edit" }, - { key = "h", cb = tree_cb "close_node" }, - { key = "v", cb = tree_cb "vsplit" }, - }, + float = { + quit_on_focus_loss = true, }, - number = false, - relativenumber = false, }, trash = { cmd = "trash",