dotfiles/.config/nvim/init.lua
tastytea 4615f1f9c5
nvim: declare all plugins in one file
Having it in many files is logically nicer, but breaks on fresh
installs.
2022-08-15 04:06:26 +02:00

30 lines
843 B
Lua

if vim.fn.has('nvim-0.7.0') == 0 then
print("Old version detected. Some stuff will probably not work.")
end
require('my/plugins')
require('my.functions')
require('my/settings')
require('my/keymaps')
require('my/filetypes')
require('my/completion')
require('my/lsp')
require('my/tools')
require('my/coding')
require('my/net')
-- reload config file after writing
vim.api.nvim_create_augroup('config_init', { clear = true })
vim.api.nvim_create_autocmd(
{ 'BufWritePost' },
{
group = 'config_init',
pattern = { '*/nvim/lua/my/*.lua', '*/nvim/init.lua' },
callback = function()
-- exclude plugins.lua, because it is sourced in another autocmd
if not vim.api.nvim_buf_get_name(0):match('plugins.lua$') then
vim.cmd([[source <afile>]])
end
end
})