Make time between each tree refresh configurable (#599)
This commit is contained in:
parent
4cc2abe3e2
commit
5bca2006cc
@ -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_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_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_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 = {
|
let g:nvim_tree_window_picker_exclude = {
|
||||||
\ 'filetype': [
|
\ 'filetype': [
|
||||||
\ 'packer',
|
\ 'packer',
|
||||||
@ -161,17 +162,21 @@ highlight NvimTreeFolderIcon guibg=blue
|
|||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
You can disable default mappings with
|
You can disable default mappings with
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
" let g:nvim_tree_disable_keybindings=1
|
" 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.
|
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
|
You can use only your mappings with
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
let g:nvim_tree_disable_default_keybindings = 1
|
let g:nvim_tree_disable_default_keybindings = 1
|
||||||
```
|
```
|
||||||
|
|
||||||
You can define your own keymaps with this syntax:
|
You can define your own keymaps with this syntax:
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
lua <<EOF
|
lua <<EOF
|
||||||
vim.g.nvim_tree_bindings = {
|
vim.g.nvim_tree_bindings = {
|
||||||
@ -180,7 +185,9 @@ lua <<EOF
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
- `key` can be either a string or a table of strings
|
- `key` can be either a string or a table of strings
|
||||||
- `mode` is `n` by default if you don't specify it
|
- `mode` is `n` by default if you don't specify it
|
||||||
- `cb` is the command that will be called when the keymap is triggered
|
- `cb` is the command that will be called when the keymap is triggered
|
||||||
@ -227,6 +234,7 @@ lua <<EOF
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
You can toggle the help UI by pressing `g?`.
|
You can toggle the help UI by pressing `g?`.
|
||||||
|
|
||||||
## Note
|
## Note
|
||||||
|
|||||||
@ -200,7 +200,7 @@ function M.refresh_tree(disable_clock)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not disable_clock then
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user