dotfiles/nvim/lua/config/autocmds.lua

14 lines
450 B
Lua
Raw Normal View History

2023-08-09 13:51:17 +02:00
-- 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 })