2022-08-15 13:25:38 +02:00
|
|
|
local version_required = 'nvim-0.7.0'
|
|
|
|
-- 0.7.0 features we need:
|
|
|
|
-- - autocommands in Lua
|
|
|
|
-- - bind key mappings directly to Lua functions
|
|
|
|
if vim.fn.has(version_required) == 0 then
|
|
|
|
print("💥 need " .. version_required .. ", config files will NOT be read!")
|
|
|
|
return nil
|
2022-08-13 19:10:19 +02:00
|
|
|
end
|
|
|
|
|
2022-08-11 16:22:36 +02:00
|
|
|
require('my/plugins')
|
2022-08-15 01:29:31 +02:00
|
|
|
require('my.functions')
|
2022-08-11 16:22:36 +02:00
|
|
|
require('my/settings')
|
|
|
|
require('my/keymaps')
|
2022-08-13 19:12:11 +02:00
|
|
|
require('my/filetypes')
|
2022-08-11 16:22:36 +02:00
|
|
|
require('my/completion')
|
2022-08-13 12:30:13 +02:00
|
|
|
require('my/lsp')
|
2022-08-13 17:04:51 +02:00
|
|
|
require('my/tools')
|
2022-08-11 16:22:36 +02:00
|
|
|
require('my/coding')
|
2022-08-12 03:33:18 +02:00
|
|
|
require('my/net')
|
2022-08-08 13:57:38 +02:00
|
|
|
|
2022-08-15 04:06:26 +02:00
|
|
|
-- reload config file after writing
|
|
|
|
vim.api.nvim_create_augroup('config_init', { clear = true })
|
|
|
|
vim.api.nvim_create_autocmd(
|
|
|
|
{ 'BufWritePost' },
|
|
|
|
{
|
|
|
|
group = 'config_init',
|
2022-08-15 20:59:18 +02:00
|
|
|
pattern = {
|
|
|
|
vim.fn.stdpath('config') .. '/lua/my/*.lua',
|
|
|
|
vim.fn.stdpath('config') .. '/init.lua'
|
|
|
|
},
|
2022-08-15 04:06:26 +02:00
|
|
|
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
|
|
|
|
})
|