From fb8735e96cecf004fbefb086ce85371d003c5129 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 11 Sep 2022 11:41:12 +1000 Subject: [PATCH] doc: eager netrw disabling --- README.md | 10 +++++++++- doc/nvim-tree-lua.txt | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a462cf20..bce316fa 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,10 @@ Setup should be run in a lua file or in a lua heredoc [:help lua-heredoc](https: ```lua -- examples for your init.lua +-- disable netrw at the very start of your init.lua (strongly advised) +vim.g.loaded = 1 +vim.g.loaded_netrwPlugin = 1 + -- empty setup using defaults require("nvim-tree").setup() @@ -121,10 +125,14 @@ nvim-tree comes with number of mappings; for default mappings please see [:help ## Troubleshooting -### Diagnostic Logging +## Diagnostic Logging You may enable diagnostic logging to `$XDG_CACHE_HOME/nvim/nvim-tree.log`. See [:help nvim-tree.log](doc/nvim-tree-lua.txt) +## netrw Keeps Popping Up + +Eagerly disable netrw. See [:help nvim-tree.disable_netrw](doc/nvim-tree-lua.txt) + ## Performance Issues 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. diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index 0c1b714f..be998c6d 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -65,6 +65,10 @@ Setup should be run in a lua file or in a |lua-heredoc| if using in a vim file. -- examples for your init.lua + -- disable netrw at the very start of your init.lua (strongly advised) + vim.g.loaded = 1 + vim.g.loaded_netrwPlugin = 1 + -- empty setup using defaults require("nvim-tree").setup() @@ -371,6 +375,12 @@ Here is a list of the options available in the setup call: Completely disable netrw Type: `boolean`, Default: `false` +It is strongly advised to eagerly disable netrw, due to race conditions at vim +startup. +Set the following at the very beginning of your `init.lua` / `init.vim`: > + vim.g.loaded = 1 + vim.g.loaded_netrwPlugin = 1 +< *nvim-tree.hijack_netrw* Hijack netrw windows (overridden if |disable_netrw| is `true`) Type: `boolean`, Default: `true`