Merge pull request #44 from rickysaurav/master

Add option for disabling bindings
This commit is contained in:
Kiyan Yazdani 2020-06-20 11:28:09 +02:00 committed by GitHub
commit fff623e020
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -49,6 +49,12 @@ let g:lua_tree_bindings = {
\ 'edit_tab': '<C-t>',
\ 'preview': '<Tab>',
\ 'cd': '<C-]>',
}
" Disable default mappings by plugin
" Bindings are enable by default, disabled on any non-zero value
" let lua_tree_disable_keybindings=1
" default will show icon by default if no icon is provided
" default shows no icon by default
let g:lua_tree_icons = {

View File

@ -115,6 +115,13 @@ Can be `0` or `1`. When `1`, will bind |BufEnter| to automatically
close the tree if it's the last window.
Default is 0
|g:lua_tree_disable_keybindings| *g:lua_tree_disable_keybindings*
Can be `0` or `1`. When `1`, will disable all keybindings by the plugin.
|g:lua_tree_bindings| as well as default bindings will not take effect.
Default is 0
==============================================================================
INFORMATIONS *nvim-tree-info*

View File

@ -195,6 +195,10 @@ function M.change_dir(foldername)
end
local function set_mappings()
if vim.g.lua_tree_disable_keybindings == 1 then
return
end
local buf = M.Tree.bufnr
local bindings = config.get_bindings()