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" },
}

135
lua/plugins/init.lua Normal file
View File

@@ -0,0 +1,135 @@
return {
{ lazy = true, "nvim-lua/plenary.nvim" },
{ "nvim-tree/nvim-web-devicons", opts = {} },
{ "echasnovski/mini.statusline", opts = {} },
{ "lewis6991/gitsigns.nvim", opts = {} },
"EdenEast/nightfox.nvim",
{
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {},
init = function()
-- Load nvim-tree early if Neovim starts without a file
if vim.fn.argc() == 0 then
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
require("nvim-tree.api").tree.open()
end,
})
end
end,
}, {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate | TSInstallAll",
opts = function()
return require "plugins.configs.treesitter"
end,
},
{
"akinsho/bufferline.nvim",
opts = require "plugins.configs.bufferline",
},
-- we use blink plugin only when in insert mode
-- so lets lazyload it at InsertEnter event
{
"saghen/blink.cmp",
version = "1.*",
event = "InsertEnter",
dependencies = {
"rafamadriz/friendly-snippets",
-- snippets engine
{
"L3MON4D3/LuaSnip",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
-- autopairs , autocompletes ()[] etc
{ "windwp/nvim-autopairs", opts = {} },
},
-- made opts a function cuz cmp config calls cmp module
-- and we lazyloaded cmp so we dont want that file to be read on startup!
opts = function()
return require "plugins.configs.blink"
end,
},
{
"williamboman/mason.nvim",
build = ":MasonUpdate",
cmd = { "Mason", "MasonInstall" },
opts = {},
},
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
end,
},
{
"stevearc/conform.nvim",
opts = require "plugins.configs.conform",
},
{
"nvimdev/indentmini.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
char="",
},
},
-- files finder etc
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
opts = require "plugins.configs.telescope",
},
{
"vague-theme/vague.nvim",
lazy = false, -- make sure we load this during startup if it is your main colorscheme
priority = 1000, -- make sure to load this before all the other plugins
config = function()
-- NOTE: you do not need to call setup if you don't want to.
require("vague").setup({
-- optional configuration here
})
vim.cmd("colorscheme vague")
end
},
{
"nanotech/jellybeans.vim",
lazy = false, -- load during startup
priority = 1000, -- make sure it loads before other UI plugins
},
{
"dgox16/oldworld.nvim",
lazy = false,
priority = 1000,
},
{
"rose-pine/neovim",
name = "rose-pine",
lazy = false, -- load on startup
priority = 1000, -- make sure it loads before other colorschemes
config = function()
require("rose-pine").setup({
dark_variant = "main", -- options: "main", "moon", "dawn"
bold_vert_split = false,
dim_nc_background = true,
disable_background = false,
})
vim.cmd("colorscheme rose-pine")
end,
},
}