2026 nvim config

This commit is contained in:
Will
2026-03-29 20:12:58 +01:00
commit 22e52c883a
17 changed files with 386 additions and 0 deletions

32
lua/plugins/cmp.lua Normal file
View File

@@ -0,0 +1,32 @@
-- lua/plugins/cmp.lua
return {
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp", -- provides require('cmp_nvim_lsp')
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
{ name = "buffer" },
}),
mapping = cmp.mapping.preset.insert({
["<C-Space>"] = cmp.mapping.complete(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
})
end,
},
}

6
lua/plugins/colors.lua Normal file
View File

@@ -0,0 +1,6 @@
return {
{ "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {} },
{ "catppuccin/nvim", name = "catppuccin", lazy = true },
{ "ellisonleao/gruvbox.nvim", lazy = true },
}

View File

@@ -0,0 +1,9 @@
return {
{
"LazyVim/LazyVim",
opts = {
colorscheme = "catppuccin-mocha", -- or "catppuccin-mocha", "gruvbox"
},
},
}

19
lua/plugins/harpoon.lua Normal file
View File

@@ -0,0 +1,19 @@
-- ~/.config/nvim/lua/plugins/harpoon.lua
return {
"ThePrimeagen/harpoon",
branch = "harpoon2", -- Use the latest Harpoon 2 branch for best support
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("harpoon"):setup({})
-- Map <leader>h to toggle the Harpoon quick menu
vim.keymap.set("n", "<leader>h", function()
require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())
end, { desc = "Harpoon quick menu" })
-- Optionally add a key to add the current file (or directory) to Harpoon
vim.keymap.set("n", "<leader>m", function()
require("harpoon"):list():add()
end, { desc = "Mark file (Harpoon)" })
end,
}

View File

@@ -0,0 +1,14 @@
return {
"nvim-lualine/lualine.nvim",
opts = function(_, opts)
opts.sections = opts.sections or {}
opts.sections.lualine_x = opts.sections.lualine_x or {}
table.insert(opts.sections.lualine_x, {
function()
return os.date("%H:%M:%S")
end,
icon = "",
})
end,
}

77
lua/plugins/mason.lua Normal file
View File

@@ -0,0 +1,77 @@
return {
{
"mason-org/mason.nvim",
build = ":MasonUpdate",
cmd = { "Mason", "MasonInstall", "MasonUninstall" },
opts = { ui = { border = "rounded" } },
},
{
"mason-org/mason-lspconfig.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"mason-org/mason.nvim",
"neovim/nvim-lspconfig",
"hrsh7th/cmp-nvim-lsp",
},
opts = {
ensure_installed = {
"pyright", -- Python
"ts_ls", -- TypeScript/JavaScript (was tsserver)
"lua_ls", -- Lua
"intelephense", -- PHP
"html", -- HTML
"cssls", -- CSS
"jsonls", -- JSON
"yamlls", -- YAML
"bashls", -- Bash
"dockerls", -- Docker
"gopls", -- Go
"rust_analyzer", -- Rust
"jdtls", -- Java
"clangd", -- C/C++
"omnisharp", -- C#
"vimls", -- Vim
"elixirls", -- Elixir
"kotlin_language_server",
"sqlls", -- SQL
"lemminx", -- XML
"marksman", -- Markdown
"svelte", -- Svelte
"tailwindcss", -- Tailwind CSS
"angularls", -- Angular
"vuels", -- Vue.js
"powershell_es", -- PowerShell
"fortls", -- Fortran
},
automatic_installation = true,
},
config = function(_, opts)
require("mason").setup({})
require("mason-lspconfig").setup(opts)
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Custom setup example for Lua
vim.lsp.config("lua_ls", {
capabilities = capabilities,
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
workspace = { checkThirdParty = false },
},
},
})
-- Generic setup for everything else
for _, server in ipairs(opts.ensure_installed or {}) do
if server ~= "lua_ls" then
vim.lsp.config(server, { capabilities = capabilities })
end
end
-- Enable all listed servers
vim.lsp.enable(opts.ensure_installed)
end,
}
}

55
lua/plugins/neo-tree.lua Normal file
View File

@@ -0,0 +1,55 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons",
},
lazy = false,
opts = {
close_if_last_window = true,
popup_border_style = "rounded",
enable_git_status = true,
-- Global window options
window = {
position = "left",
width = 35,
mappings = {
["o"] = "open",
["P"] = "toggle_preview",
["s"] = "open_split",
["v"] = "open_vsplit",
},
},
filesystem = {
follow_current_file = { enabled = true },
enable_fs_watch = true, -- v3 style watcher flag
-- All filtering options belong here
filtered_items = {
-- Set visible=true if you want hidden items to show but dimmed
visible = true,
hide_dotfiles = false,
hide_gitignored = false,
-- Optional: never hide these even if other filters apply
always_show = {},
-- Optional: keep these hidden regardless of visible=true
never_show = { ".git" },
-- Optional: add names/patterns to hide by default
hide_by_name = {},
hide_by_pattern = {},
},
-- Optional per-source window mappings section (inherits from root window)
-- window = {
-- mappings = {
-- ["/"] = "fuzzy_finder",
-- },
-- },
},
},
}

33
lua/plugins/ollama.lua Normal file
View File

@@ -0,0 +1,33 @@
return {
"nomnivore/ollama.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
-- Commands added by the plugin
cmd = { "Ollama", "OllamaModel", "OllamaServe", "OllamaServeStop" },
keys = {
-- Keybind for prompt menu (the <c-u> is important for selections)
{
"<leader>oo",
":<c-u>lua require('ollama').prompt()<cr>",
desc = "ollama prompt",
mode = { "n", "v" },
},
-- Direct prompt example
{
"<leader>oG",
":<c-u>lua require('ollama').prompt('Generate_Code')<cr>",
desc = "ollama Generate Code",
mode = { "n", "v" },
},
},
opts = {
-- your configuration overrides
model = "deepseek-coder-v2:16b",
}
}

9
lua/plugins/snacks.lua Normal file
View File

@@ -0,0 +1,9 @@
return {
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = {}
}
}

19
lua/plugins/telescope.lua Normal file
View File

@@ -0,0 +1,19 @@
-- ~/.config/nvim/lua/plugins/Telescope.lua
return {
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
-- Basic Telescope setup
require("telescope").setup({})
-- Keymap: <leader>p to find files from the CWD Neovim was opened in
vim.keymap.set("n", "<leader>p",
function()
require("telescope.builtin").find_files({ cwd = vim.fn.getcwd() })
end,
{ desc = "Find Files (CWD, Telescope)" }
)
end,
}

13
lua/plugins/terminal.lua Normal file
View File

@@ -0,0 +1,13 @@
return {
"akinsho/toggleterm.nvim",
version = "*",
config = function()
require("toggleterm").setup({
size = 15,
open_mapping = [[<C-\>]], -- toggle terminal with Ctrl + \
direction = "horizontal", -- options: 'vertical', 'tab', 'float'
shade_terminals = true,
})
end,
}

View File

@@ -0,0 +1,14 @@
return {
"nvim-treesitter/nvim-treesitter",
branch = "master",
lazy = false,
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "lua", "python", "javascript", "typescript", "html", "css" },
highlight = { enable = true },
indent = { enable = true },
})
end,
}