dotfiles/nvim/lua/config/autocmds.lua
mightypanders 33ca9669de lazyvim
2023-08-09 13:51:17 +02:00

14 lines
450 B
Lua

-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here
local function open_nvim_tree(data)
local directory = vim.fn.isdirectory(data.file) == 1
if not directory then
return
end
vim.cmd.cd(data.file)
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })