From befb47b82d6d644f59c22e401f4207fea75606a9 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 7 Oct 2021 14:28:28 +0300 Subject: chore(nvim): upgrade nvim-tree to the new config --- nvim/.config/nvim/lua/filetree.lua | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/filetree.lua b/nvim/.config/nvim/lua/filetree.lua index 43f7da3..28c61b8 100644 --- a/nvim/.config/nvim/lua/filetree.lua +++ b/nvim/.config/nvim/lua/filetree.lua @@ -1,13 +1,20 @@ local tree_cb = require'nvim-tree.config'.nvim_tree_callback -vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle', { noremap = true, silent = true }) - -vim.g.nvim_tree_auto_close = 1 -vim.g.nvim_tree_group_empty = 1 - -vim.g.nvim_tree_bindings = { - { key = "l", cb = tree_cb("edit") }, - { key = "h", cb = tree_cb("parent_node") and tree_cb("close_node") }, - { key = "cw", cb = tree_cb("rename") }, - { key = "o", cb = tree_cb("create") }, +require'nvim-tree'.setup { + auto_close = true, + open_on_tab = true, + open_on_setup = true, + hijack_cursor = true, + view = { + mappings = { + list = { + { key = "l", cb = tree_cb("edit") }, + { key = "h", cb = tree_cb("parent_node") and tree_cb("close_node") }, + { key = "cw", cb = tree_cb("rename") }, + { key = "o", cb = tree_cb("create") }, + } + } + } } + +vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle', { noremap = true, silent = true }) -- cgit v1.2.3