This commit is contained in:
Mann Patel
2026-02-23 23:13:41 -07:00
commit 9296562b0d
16 changed files with 1086 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
return {
snippets = { preset = "luasnip" },
cmdline = { enabled = true },
appearance = { nerd_font_variant = "normal" },
fuzzy = { implementation = "prefer_rust" },
sources = { default = { "lsp", "snippets", "buffer", "path" } },
keymap = {
preset = "default",
["<CR>"] = { "accept", "fallback" },
["<C-b>"] = { "scroll_documentation_up", "fallback" },
["<C-f"] = { "scroll_documentation_down", "fallback" },
},
completion = {
ghost_text = { enabled = true },
documentation = {
auto_show = true,
auto_show_delay_ms = 200,
window = { border = "single" },
},
},
}

View File

@@ -0,0 +1,8 @@
return {
options = {
themable = true,
offsets = {
{ filetype = "NvimTree", highlight = "NvimTreeNormal" },
},
},
}

View File

@@ -0,0 +1,6 @@
return {
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
},
}

View File

@@ -0,0 +1,44 @@
-- Use LspAttach autocommand to only map the following keys
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
local opts = { buffer = ev.buf }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set("n", "<space>wl", function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts)
end,
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem = {
documentationFormat = { "markdown", "plaintext" },
snippetSupport = true,
preselectSupport = true,
insertReplaceSupport = true,
labelDetailsSupport = true,
deprecatedSupport = true,
commitCharactersSupport = true,
tagSupport = { valueSet = { 1 } },
resolveSupport = {
properties = {
"documentation",
"detail",
"additionalTextEdits",
},
},
}
vim.lsp.config("*", { capabilities = capabilities })
local servers = { "html", "cssls" , 'lua_ls' }
vim.lsp.enable(servers)

View File

@@ -0,0 +1,8 @@
return {
defaults = {
sorting_strategy = "ascending",
layout_config = {
horizontal = { prompt_position = "top" },
},
},
}

View File

@@ -0,0 +1,3 @@
return {
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },
}