refactor
This commit is contained in:
parent
8c9eed18e6
commit
b458b67238
83 changed files with 1115 additions and 5026 deletions
91
config/nvim/init.lua
Normal file
91
config/nvim/init.lua
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
-- 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" },
|
||||
"neovim/nvim-lspconfig",
|
||||
{"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()
|
||||
|
||||
vim.lsp.enable("rust_analyzer")
|
||||
vim.lsp.enable("pylsp")
|
||||
vim.lsp.enable("biome")
|
||||
vim.lsp.enable("eslint")
|
||||
vim.lsp.enable("ccls")
|
||||
Loading…
Add table
Add a link
Reference in a new issue