1
0
Fork 0
dotfiles/.config/nvim/init.lua

85 lines
3.0 KiB
Lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "lazyvim.plugins.extras.coding.copilot" },
{ import = "lazyvim.plugins.extras.coding.copilot-chat" },
{ import = "lazyvim.plugins.extras.coding.mini-surround" },
{ import = "lazyvim.plugins.extras.coding.neogen" },
{ import = "lazyvim.plugins.extras.dap.core" },
{ import = "lazyvim.plugins.extras.editor.leap" },
{ import = "lazyvim.plugins.extras.editor.inc-rename" },
{ import = "lazyvim.plugins.extras.test.core" },
{ import = "lazyvim.plugins.extras.ui.mini-indentscope" },
{ import = "lazyvim.plugins.extras.util.octo" },
{ import = "lazyvim.plugins.extras.lang.ansible" },
{ import = "lazyvim.plugins.extras.lang.docker" },
{ import = "lazyvim.plugins.extras.lang.git" },
{ import = "lazyvim.plugins.extras.lang.helm" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.markdown" },
{ import = "lazyvim.plugins.extras.lang.php" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.rust" },
{ import = "lazyvim.plugins.extras.lang.sql" },
{ import = "lazyvim.plugins.extras.lang.terraform" },
{ import = "lazyvim.plugins.extras.lang.toml" },
{ import = "lazyvim.plugins.extras.lang.yaml" },
{ import = "plugins" },
},
defaults = {
lazy = true,
version = false,
},
install = { colorscheme = { "tokyonight" } },
checker = { enabled = true },
performance = {
rtp = {
disabled_plugins = {
"gzip",
-- "matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
for _, autocmd in ipairs({
{ -- Automatically change line numeration
{ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" },
{ command = 'if &nu && mode() != "i" | set rnu | endif' },
},
{ -- Automatically change line numeration
{ "BufLeave", "FocusLost", "InsertEnter", "WinLeave" },
{ command = "if &nu | set nornu | endif" },
},
{ -- Trigger shortcuts script
"BufWritePost",
{ pattern = { "directories", "files" }, command = "silent!!shortcuts" },
},
{ -- Trigger xrdb
"BufWritePost",
{ pattern = { "xresources" }, command = "silent!!xrdb %" },
},
}) do
vim.api.nvim_create_autocmd(autocmd[1], autocmd[2])
end