dotfiles/.config/nvim/init.lua

36 lines
1.0 KiB
Lua
Raw Normal View History

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
require('my/plugins')
require('my.functions')
require('my/settings')
require('my/keymaps')
require('my/filetypes')
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')
require('my/coding')
2022-08-12 03:33:18 +02:00
require('my/net')
2022-08-08 13:57:38 +02:00
-- reload config file after writing
vim.api.nvim_create_augroup('config_init', { clear = true })
2022-08-18 01:16:57 +02:00
vim.api.nvim_create_autocmd({ 'BufWritePost' }, {
group = 'config_init',
pattern = {
vim.fn.stdpath('config') .. '/lua/my/*.lua',
vim.fn.stdpath('config') .. '/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
2022-08-18 01:16:57 +02:00
end
})