Skip to content

Commit fff623e

Browse files
authored
Merge pull request #44 from rickysaurav/master
Add option for disabling bindings
2 parents fbe5d6d + 080c866 commit fff623e

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ let g:lua_tree_bindings = {
4949
\ 'edit_tab': '<C-t>',
5050
\ 'preview': '<Tab>',
5151
\ 'cd': '<C-]>',
52+
}
53+
54+
" Disable default mappings by plugin
55+
" Bindings are enable by default, disabled on any non-zero value
56+
" let lua_tree_disable_keybindings=1
57+
5258
" default will show icon by default if no icon is provided
5359
" default shows no icon by default
5460
let g:lua_tree_icons = {

doc/nvim-tree-lua.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ Can be `0` or `1`. When `1`, will bind |BufEnter| to automatically
115115
close the tree if it's the last window.
116116
Default is 0
117117

118+
|g:lua_tree_disable_keybindings| *g:lua_tree_disable_keybindings*
119+
120+
Can be `0` or `1`. When `1`, will disable all keybindings by the plugin.
121+
|g:lua_tree_bindings| as well as default bindings will not take effect.
122+
Default is 0
123+
124+
118125
==============================================================================
119126
INFORMATIONS *nvim-tree-info*
120127

lua/lib/lib.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ function M.change_dir(foldername)
195195
end
196196

197197
local function set_mappings()
198+
if vim.g.lua_tree_disable_keybindings == 1 then
199+
return
200+
end
201+
198202
local buf = M.Tree.bufnr
199203
local bindings = config.get_bindings()
200204

0 commit comments

Comments
 (0)