From 8a735e44534d3fe9a3ad5fe8584cfef123541d57 Mon Sep 17 00:00:00 2001 From: Ralph Date: Mon, 1 Apr 2024 00:18:54 -0700 Subject: [PATCH] small syntax things --- lua/plugins/editor.lua | 17 +++++++++-------- lua/plugins/ui.lua | 2 -- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 8202ee6..0a683cf 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -1,5 +1,4 @@ -- if true then return {} end - return { { "nvim-tree/nvim-tree.lua", @@ -11,14 +10,16 @@ return { { "E", "fE", desc = "Explorer NvimTree (cwd)", remap = true }, }, deactivate = function() require("nvim-tree.api").tree.close() end, -- or function() vim.cmd([[NvimTreeClose]]) end + init = function() + if vim.fn.argc(-1) == 1 then + local stat = vim.uv.fs_stat(vim.fn.argv(0)) + if stat and stat.type == "directory" then + require("nvim-tree") + end + end + end, config = function() - require("nvim-tree").setup({ - -- actions = { - -- open_file = { - -- resize_window = false, - -- }, - -- }, - }) + require("nvim-tree").setup() end, }, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 601262e..85b3ce9 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -1,9 +1,7 @@ -- if true then return {} end - return { -- bufferline "akinsho/bufferline.nvim", - dependencies = { "nvim-tree/nvim-tree.lua" }, opts = { options = { offsets = {