From 81d798fdaa5bf49737969e0f15af4a90621a0a61 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 10 Jan 2023 23:44:02 +0100 Subject: [PATCH] feat(neo-tree): load neo-tree when specifying a direcory on the cmdline --- lua/lazyvim/plugins/editor.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index cf960fbc..6fd9c242 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -20,11 +20,16 @@ return { }, init = function() vim.g.neo_tree_remove_legacy_commands = 1 + if vim.fn.argc() == 1 then + local stat = vim.loop.fs_stat(vim.fn.argv(0)) + if stat and stat.type == "directory" then + require("neo-tree") + end + end end, opts = { filesystem = { follow_current_file = true, - hijack_netrw_behavior = "open_current", }, }, },