diff --git a/firefox/cookie_cache b/firefox/cookie_cache index 409fc31..9cb77b5 100644 Binary files a/firefox/cookie_cache and b/firefox/cookie_cache differ diff --git a/nvim/lua/nvim-tree-config.lua b/nvim/lua/nvim-tree-config.lua index 4674fb4..2850924 100644 --- a/nvim/lua/nvim-tree-config.lua +++ b/nvim/lua/nvim-tree-config.lua @@ -2,12 +2,21 @@ vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 require("nvim-tree").setup() -require'nvim-tree'.toggle(false,true) ---local function open_nvim_tree() +local function open_nvim_tree(data) - ---- open the tree - --require("nvim-tree.api").tree.open() ---end + -- buffer is a real file on the disk + local real_file = vim.fn.filereadable(data.file) == 1 ---vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) + -- buffer is a [No Name] + local no_name = data.file == "" and vim.bo[data.buf].buftype == "" + + if not real_file and not no_name then + return + end + + -- open the tree, find the file but don't focus it + require("nvim-tree.api").tree.toggle({ focus = false, find_file = true, }) +end + +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })