From 5ac9938cc8a1aac5d1c3b694900e6f67553f4de3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 25 Jan 2023 14:54:14 +0100 Subject: [PATCH] fix(neo-tree): dont change cwd when opening neo-tree. Fixes #130 --- lua/lazyvim/plugins/editor.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index a98c189f..0280ec35 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -14,7 +14,13 @@ return { end, desc = "Explorer NeoTree (root dir)", }, - { "fE", "Neotree toggle", desc = "Explorer NeoTree (cwd)" }, + { + "fE", + function() + require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() }) + end, + desc = "Explorer NeoTree (cwd)", + }, { "e", "fe", desc = "Explorer NeoTree (root dir)", remap = true }, { "E", "fE", desc = "Explorer NeoTree (cwd)", remap = true }, }, @@ -32,6 +38,7 @@ return { end, opts = { filesystem = { + bind_to_cwd = false, follow_current_file = true, }, },