initial commit

This commit is contained in:
2026-03-08 14:37:55 +00:00
commit 4da672cbc7
62 changed files with 3460 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
-- Autocompletion engine with LSP, snippet, buffer, and path sources.
-- Keymaps: Tab/S-Tab (navigate), Enter (confirm), Ctrl-Space (trigger), Esc (dismiss).
-- See README.md "Autocomplete" section for full usage details.
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp", -- LSP completion source
"hrsh7th/cmp-buffer", -- Buffer word completion source
"hrsh7th/cmp-path", -- Filesystem path completion source
"saadparwaiz1/cmp_luasnip", -- Snippet completion source (bridges LuaSnip)
"L3MON4D3/LuaSnip", -- Snippet engine
"onsails/lspkind-nvim", -- Completion menu icons
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<Tab>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
["<S-Tab>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
["<Esc>"] = cmp.mapping.abort(),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{
name = "buffer",
keyword_length = 2,
option = {
get_bufnrs = function()
local bufs = {}
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_loaded(buf) then
bufs[#bufs + 1] = buf
end
end
return bufs
end,
},
},
{ name = "path" },
}),
formatting = {
format = lspkind.cmp_format({
mode = "symbol_text",
menu = {
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
},
}),
},
window = {
documentation = cmp.config.window.bordered(),
},
})
end,
}

View File

@@ -0,0 +1,11 @@
return {
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
require("catppuccin").setup({
flavour = "mocha",
})
vim.cmd.colorscheme("catppuccin")
end,
}

View File

@@ -0,0 +1,33 @@
return {
"stevearc/conform.nvim",
event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = {
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
typescript = { "prettier" },
javascriptreact = { "prettier" },
typescriptreact = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
markdown = { "prettier" },
python = { "ruff_format" },
go = { "gofmt" },
},
format_on_save = {
timeout_ms = 500,
lsp_fallback = true,
},
},
keys = {
{
"<leader>f",
function()
require("conform").format({ async = true, lsp_fallback = true })
end,
mode = "",
desc = "Format buffer",
},
},
}

View File

@@ -0,0 +1,10 @@
return {
"folke/lazydev.nvim",
ft = "lua",
opts = {
library = {
-- Load luvit types when using `vim.uv`
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
}

View File

@@ -0,0 +1,16 @@
return {
"neovim/nvim-lspconfig",
config = function()
vim.diagnostic.config({
virtual_text = true,
signs = true,
update_in_insert = false,
underline = true,
severity_sort = true,
float = {
border = "rounded",
source = "always",
},
})
end,
}

View File

@@ -0,0 +1,11 @@
-- Snippet engine with pre-built VS Code-style snippets from friendly-snippets.
-- Snippets are lazy-loaded per filetype. Used by nvim-cmp as a completion source.
return {
"L3MON4D3/LuaSnip",
dependencies = {
"rafamadriz/friendly-snippets", -- Community-maintained snippet collection
},
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
}

View File

@@ -0,0 +1,20 @@
-- Bridges Mason and lspconfig: auto-installs and enables language servers.
-- Injects nvim-cmp capabilities globally so all LSP servers support enhanced completions.
return {
"williamboman/mason-lspconfig.nvim",
dependencies = {
"williamboman/mason.nvim",
"neovim/nvim-lspconfig",
"hrsh7th/cmp-nvim-lsp", -- Required for completion capabilities
},
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config("*", {
capabilities = capabilities,
})
require("mason-lspconfig").setup({
automatic_installation = true,
automatic_enable = true,
})
end,
}

View File

@@ -0,0 +1,13 @@
return {
"jay-babu/mason-null-ls.nvim",
dependencies = {
"williamboman/mason.nvim",
"nvimtools/none-ls.nvim",
},
config = function()
require("mason-null-ls").setup({
automatic_installation = true,
handlers = {},
})
end,
}

View File

@@ -0,0 +1,4 @@
return {
"williamboman/mason.nvim",
config = true,
}

View File

@@ -0,0 +1,10 @@
return {
"nvimtools/none-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {},
})
end,
}

View File

@@ -0,0 +1,66 @@
return {
"nickjvandyke/opencode.nvim",
version = "*", -- Latest stable release
dependencies = {
{
-- `snacks.nvim` integration is recommended, but optional
---@module "snacks" <- Loads `snacks.nvim` types for configuration intellisense
"folke/snacks.nvim",
optional = true,
opts = {
input = {}, -- Enhances `ask()`
picker = { -- Enhances `select()`
actions = {
opencode_send = function(...)
return require("opencode").snacks_picker_send(...)
end,
},
win = {
input = {
keys = {
["<a-a>"] = { "opencode_send", mode = { "n", "i" } },
},
},
},
},
},
},
},
config = function()
---@type opencode.Opts
vim.g.opencode_opts = {
-- Your configuration, if any; goto definition on the type or field for details
}
vim.o.autoread = true -- Required for `opts.events.reload`
-- Recommended/example keymaps
vim.keymap.set({ "n", "x" }, "<C-a>", function()
require("opencode").ask("@this: ", { submit = true })
end, { desc = "Ask opencode…" })
vim.keymap.set({ "n", "x" }, "<C-x>", function()
require("opencode").select()
end, { desc = "Execute opencode action…" })
vim.keymap.set({ "n", "t" }, "<C-.>", function()
require("opencode").toggle()
end, { desc = "Toggle opencode" })
vim.keymap.set({ "n", "x" }, "go", function()
return require("opencode").operator("@this ")
end, { desc = "Add range to opencode", expr = true })
vim.keymap.set("n", "goo", function()
return require("opencode").operator("@this ") .. "_"
end, { desc = "Add line to opencode", expr = true })
vim.keymap.set("n", "<S-C-u>", function()
require("opencode").command("session.half.page.up")
end, { desc = "Scroll opencode up" })
vim.keymap.set("n", "<S-C-d>", function()
require("opencode").command("session.half.page.down")
end, { desc = "Scroll opencode down" })
-- You may want these if you use the opinionated `<C-a>` and `<C-x>` keymaps above — otherwise consider `<leader>o…` (and remove terminal mode from the `toggle` keymap)
vim.keymap.set("n", "+", "<C-a>", { desc = "Increment under cursor", noremap = true })
vim.keymap.set("n", "-", "<C-x>", { desc = "Decrement under cursor", noremap = true })
end,
}

View File

@@ -0,0 +1,9 @@
return {
"nvim-telescope/telescope.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
-- optional but recommended
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
},
}

View File

@@ -0,0 +1,5 @@
return {
"nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate",
}