KeyBindings: add refresh

This commit is contained in:
Santos Gallegos 2020-08-02 11:05:05 -05:00
parent 464ce21feb
commit bafee954ac
4 changed files with 31 additions and 27 deletions

View File

@ -41,7 +41,7 @@ refresh the tree
The command will change the cursor in the tree for the current bufname.
It will also open the leafs of the tree leading to the file in the buffer
It will also open the leafs of the tree leading to the file in the buffer
(if you opened a file with something else than the LuaTree, like `fzf` or
`:split`)
@ -156,6 +156,7 @@ INFORMATIONS *nvim-tree-info*
- '<C-t>' will open the file in a new tab
- '<Tab>' will open the file as a preview (keeps the cursor in the tree)
- 'I' will toggle visibility of folders hidden via |g:lua_tree_ignore|
- 'R' will refresh the tree
- 'gx' opens the file with the `open` command on macos and `xdg-open`
on linux.
@ -222,36 +223,36 @@ You should have 'termguicolors' enabled, otherwise, colors will not be
applied.
LuaTreeSymlink
LuaTreeFolderName
LuaTreeFolderIcon
LuaTreeExecFile
LuaTreeSpecialFile
LuaTreeImageFile
LuaTreeMarkdownFile
LuaTreeFolderName
LuaTreeFolderIcon
LuaTreeExecFile
LuaTreeSpecialFile
LuaTreeImageFile
LuaTreeMarkdownFile
LuaTreeIndentMarker
LuaTreeLicenseIcon
LuaTreeYamlIcon
LuaTreeTomlIcon
LuaTreeGitignoreIcon
LuaTreeJsonIcon
LuaTreeLicenseIcon
LuaTreeYamlIcon
LuaTreeTomlIcon
LuaTreeGitignoreIcon
LuaTreeJsonIcon
LuaTreeLuaIcon
LuaTreePythonIcon
LuaTreeShellIcon
LuaTreeJavascriptIcon
LuaTreeCIcon
LuaTreeReactIcon
LuaTreeHtmlIcon
LuaTreeRustIcon
LuaTreeVimIcon
LuaTreeTypescriptIcon
LuaTreeLuaIcon
LuaTreePythonIcon
LuaTreeShellIcon
LuaTreeJavascriptIcon
LuaTreeCIcon
LuaTreeReactIcon
LuaTreeHtmlIcon
LuaTreeRustIcon
LuaTreeVimIcon
LuaTreeTypescriptIcon
LuaTreeGitDirty
LuaTreeGitStaged
LuaTreeGitMerge
LuaTreeGitRenamed
LuaTreeGitNew
LuaTreeGitDirty
LuaTreeGitStaged
LuaTreeGitMerge
LuaTreeGitRenamed
LuaTreeGitNew
There are also links to normal bindings to style the tree itself.

View File

@ -51,6 +51,7 @@ function M.get_bindings()
edit_tab = keybindings.edit_tab or '<C-t>',
preview = keybindings.preview or '<Tab>',
toggle_ignored = keybindings.toggle_ignored or 'I',
refresh = keybindings.refresh or 'R',
cd = keybindings.cd or '<C-]>',
create = keybindings.create or 'a',
remove = keybindings.remove or 'd',

View File

@ -212,6 +212,7 @@ local function set_mappings()
[bindings.edit_split] = 'on_keypress("split")';
[bindings.edit_tab] = 'on_keypress("tabnew")';
[bindings.toggle_ignored] = 'on_keypress("toggle_ignored")';
[bindings.refresh] = 'on_keypress("refresh")';
[bindings.create] = 'on_keypress("create")';
[bindings.remove] = 'on_keypress("remove")';
[bindings.rename] = 'on_keypress("rename")';

View File

@ -46,6 +46,7 @@ local keypress_funcs = {
cut = fs.cut,
paste = fs.paste,
toggle_ignored = lib.toggle_ignored,
refresh = lib.refresh_tree,
prev_git_item = gen_go_to('prev_git_item'),
next_git_item = gen_go_to('next_git_item'),
preview = function(node)