소스 검색

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

tafryn 4 년 전
부모
커밋
c0a653a0cf
1개의 변경된 파일7개의 추가작업 그리고 5개의 파일을 삭제
  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()