Skip to content

Commit fb8735e

Browse files
committed
doc: eager netrw disabling
1 parent 3e49d9b commit fb8735e

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ Setup should be run in a lua file or in a lua heredoc [:help lua-heredoc](https:
5757
```lua
5858
-- examples for your init.lua
5959

60+
-- disable netrw at the very start of your init.lua (strongly advised)
61+
vim.g.loaded = 1
62+
vim.g.loaded_netrwPlugin = 1
63+
6064
-- empty setup using defaults
6165
require("nvim-tree").setup()
6266

@@ -121,10 +125,14 @@ nvim-tree comes with number of mappings; for default mappings please see [:help
121125

122126
## Troubleshooting
123127

124-
### Diagnostic Logging
128+
## Diagnostic Logging
125129

126130
You may enable diagnostic logging to `$XDG_CACHE_HOME/nvim/nvim-tree.log`. See [:help nvim-tree.log](doc/nvim-tree-lua.txt)
127131

132+
## netrw Keeps Popping Up
133+
134+
Eagerly disable netrw. See [:help nvim-tree.disable_netrw](doc/nvim-tree-lua.txt)
135+
128136
## Performance Issues
129137

130138
If you are experiencing performance issues with nvim-tree.lua, you can enable profiling in the logs. It is advisable to enable git logging at the same time, as that can be a source of performance problems.

doc/nvim-tree-lua.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ Setup should be run in a lua file or in a |lua-heredoc| if using in a vim file.
6565

6666
-- examples for your init.lua
6767

68+
-- disable netrw at the very start of your init.lua (strongly advised)
69+
vim.g.loaded = 1
70+
vim.g.loaded_netrwPlugin = 1
71+
6872
-- empty setup using defaults
6973
require("nvim-tree").setup()
7074

@@ -371,6 +375,12 @@ Here is a list of the options available in the setup call:
371375
Completely disable netrw
372376
Type: `boolean`, Default: `false`
373377

378+
It is strongly advised to eagerly disable netrw, due to race conditions at vim
379+
startup.
380+
Set the following at the very beginning of your `init.lua` / `init.vim`: >
381+
vim.g.loaded = 1
382+
vim.g.loaded_netrwPlugin = 1
383+
<
374384
*nvim-tree.hijack_netrw*
375385
Hijack netrw windows (overridden if |disable_netrw| is `true`)
376386
Type: `boolean`, Default: `true`

0 commit comments

Comments
 (0)