DashNix/nix/programs/nvim/lua/config/autocmds.lua

15 lines
328 B
Lua

-- nvimtree
local function open_nvim_tree(data)
local directory = vim.fn.isdirectory(data.file) == 1
if not directory then
return
end
-- change to the directory
vim.cmd.cd(data.file)
-- open the tree
require("nvim-tree.api").tree.open()
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })