Ver Fonte

Allow user's to define their own nvim-tree bindings (#1181)

tafryn há 4 anos atrás
pai
commit
c0a653a0cf
1 ficheiros alterados com 7 adições e 5 exclusões
  1. 7 5
      lua/core/nvimtree.lua

+ 7 - 5
lua/core/nvimtree.lua

@@ -59,11 +59,13 @@ M.setup = function()
 
   local tree_cb = nvim_tree_config.nvim_tree_callback
 
-  g.nvim_tree_bindings = {
-    { key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
-    { key = "h", cb = tree_cb "close_node" },
-    { key = "v", cb = tree_cb "vsplit" },
-  }
+  if not g.nvim_tree_bindings then
+    g.nvim_tree_bindings = {
+      { key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
+      { key = "h", cb = tree_cb "close_node" },
+      { key = "v", cb = tree_cb "vsplit" },
+    }
+  end
 end
 --
 M.focus_or_close = function()