Skip to content

Make time between each tree refresh configurable #599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ let g:nvim_tree_icon_padding = ' ' "one space by default, used for rendering the
let g:nvim_tree_symlink_arrow = ' >> ' " defaults to ' ➛ '. used as a separator between symlinks' source and target.
let g:nvim_tree_update_cwd = 1 "0 by default, will update the tree cwd when changing nvim's directory (DirChanged event). Behaves strangely with autochdir set.
let g:nvim_tree_respect_buf_cwd = 1 "0 by default, will change cwd of nvim-tree to that of new buffer's when opening nvim-tree.
let g:nvim_tree_refresh_wait = 500 "1000 by default, control how often the tree can be refreshed, 1000 means the tree can be refresh once per 1000ms.
let g:nvim_tree_window_picker_exclude = {
\ 'filetype': [
\ 'packer',
Expand Down Expand Up @@ -161,17 +162,21 @@ highlight NvimTreeFolderIcon guibg=blue
### Setup

You can disable default mappings with

```vim
" let g:nvim_tree_disable_keybindings=1
```

But you won't be able to map any keys from the setup with nvim_tree_bindings. Use with caution.

You can use only your mappings with

```vim
let g:nvim_tree_disable_default_keybindings = 1
```

You can define your own keymaps with this syntax:

```vim
lua <<EOF
vim.g.nvim_tree_bindings = {
Expand All @@ -180,7 +185,9 @@ lua <<EOF
}
EOF
```

Notes:

- `key` can be either a string or a table of strings
- `mode` is `n` by default if you don't specify it
- `cb` is the command that will be called when the keymap is triggered
Expand Down Expand Up @@ -227,6 +234,7 @@ lua <<EOF
}
EOF
```

You can toggle the help UI by pressing `g?`.

## Note
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function M.refresh_tree(disable_clock)
end

if not disable_clock then
vim.defer_fn(function() refreshing = false end, 1000)
vim.defer_fn(function() refreshing = false end, vim.g.nvim_tree_refresh_wait or 1000)
end
end

Expand Down