dots/hosts/voidspear/config/nvim/init.lua
2025-09-07 19:23:02 +03:00

99 lines
2.7 KiB
Lua

-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{ "catppuccin/nvim", name = "catppuccin" },
{ "williamboman/mason.nvim", opts = {} },
{ "williamboman/mason-lspconfig.nvim", opts = {} },
"neovim/nvim-lspconfig",
"mfussenegger/nvim-dap",
{ "jay-babu/mason-nvim-dap.nvim", opts = {} },
{"nvim-treesitter/nvim-treesitter", lazy = false, branch = "main", build = ":TSUpdate", opts = {}},
{ "nvim-tree/nvim-tree.lua", opts = {} },
"nvim-tree/nvim-web-devicons",
"romgrk/barbar.nvim",
{ "nvim-lualine/lualine.nvim", opts = {} },
{ "windwp/nvim-autopairs", opts = {} },
"neovim/nvim-lspconfig",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/nvim-cmp",
"hrsh7th/vim-vsnip",
"voldikss/vim-floaterm",
{
'IogaMaster/neocord',
event = "VeryLazy",
opts = {}
}
})
vim.o.tabstop = 2
vim.o.shiftwidth = 2
vim.o.expandtab = true
vim.o.smarttab = true
vim.o.cursorline = true
vim.o.laststatus = 3
vim.o.background = "dark"
vim.o.termguicolors = true
vim.o.number = true
vim.o.relativenumber = true
vim.cmd.colorscheme "catppuccin-mocha"
vim.o.guifont = "CaskaydiaCove Nerd Font:h11"
vim.diagnostic.config({
virtual_text = true, -- Show inline error messages
signs = true, -- Show signs in the gutter
underline = true, -- Underline errors
update_in_insert = false,
severity_sort = true,
})
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' },
}, {
{ name = 'buffer' },
})
})
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("mason-lspconfig").setup({
function (server_name)
require("lspconfig")[server_name].setup({
capabilities = capabilities
})
end,
})