From 22e52c883a6331697308698e926ce6e25c48d6b3 Mon Sep 17 00:00:00 2001 From: Will Date: Sun, 29 Mar 2026 20:12:58 +0100 Subject: [PATCH] 2026 nvim config --- init.lua | 3 ++ lazy-lock.json | 27 ++++++++++++ lazyvim.json | 9 ++++ lua/.DS_Store | Bin 0 -> 8196 bytes lua/config/lazy.lua | 47 +++++++++++++++++++++ lua/plugins/cmp.lua | 32 ++++++++++++++ lua/plugins/colors.lua | 6 +++ lua/plugins/colorscheme.lua | 9 ++++ lua/plugins/harpoon.lua | 19 +++++++++ lua/plugins/lualine-clock.lua | 14 +++++++ lua/plugins/mason.lua | 77 ++++++++++++++++++++++++++++++++++ lua/plugins/neo-tree.lua | 55 ++++++++++++++++++++++++ lua/plugins/ollama.lua | 33 +++++++++++++++ lua/plugins/snacks.lua | 9 ++++ lua/plugins/telescope.lua | 19 +++++++++ lua/plugins/terminal.lua | 13 ++++++ lua/plugins/treesitter.lua | 14 +++++++ 17 files changed, 386 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lazyvim.json create mode 100644 lua/.DS_Store create mode 100644 lua/config/lazy.lua create mode 100644 lua/plugins/cmp.lua create mode 100644 lua/plugins/colors.lua create mode 100644 lua/plugins/colorscheme.lua create mode 100644 lua/plugins/harpoon.lua create mode 100644 lua/plugins/lualine-clock.lua create mode 100644 lua/plugins/mason.lua create mode 100644 lua/plugins/neo-tree.lua create mode 100644 lua/plugins/ollama.lua create mode 100644 lua/plugins/snacks.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/terminal.lua create mode 100644 lua/plugins/treesitter.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..d877fde --- /dev/null +++ b/init.lua @@ -0,0 +1,3 @@ +require("config.lazy") + +vim.g.lazyvim_check_order = false diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..9b38c3e --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,27 @@ +{ + "LazyVim": { "branch": "main", "commit": "c64a61734fc9d45470a72603395c02137802bc6f" }, + "LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" }, + "catppuccin": { "branch": "main", "commit": "234fc048de931a0e42ebcad675bf6559d75e23df" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, + "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" }, + "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" }, + "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" }, + "nvim-lspconfig": { "branch": "master", "commit": "b34fbdffdcb6295c7a25df6ba375452a2e73c32e" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "ollama.nvim": { "branch": "main", "commit": "45e58779fecde7ac5b8f62800bbe7180d4b48507" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "snacks.nvim": { "branch": "main", "commit": "dec29f55666f8f4545835636077a86b150faf630" }, + "telescope.nvim": { "branch": "master", "commit": "3a12a853ebf21ec1cce9a92290e3013f8ae75f02" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" } +} diff --git a/lazyvim.json b/lazyvim.json new file mode 100644 index 0000000..dc3e179 --- /dev/null +++ b/lazyvim.json @@ -0,0 +1,9 @@ +{ + "extras": [ + + ], + "news": { + "NEWS.md": "11866" + }, + "version": 8 +} \ No newline at end of file diff --git a/lua/.DS_Store b/lua/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..36dc0130a168b20ad92025a2e63548f38d21229d GIT binary patch literal 8196 zcmeHMTWl3Y7@lui=q~NbLaDSM%i5~kiuOX$LV?o@%0(#QwDh!G%DJrVhV5=WdoIP& zSYkvYYK*rBqwyAfGI)!LhTtVpL-3XuVnmEF@xd74gGSWE7ysGWL*UfD5rc6jnfYh_ z%gp@$`M;UYmNABoY^ss5YQ~sMl~b*pntv!<&g+yS1)Nf%AbZ9v<}fdj_eK-;6zz}^ zMj(tp7=bVXVFbbmTnQ1NJDV4IntNYJ!#0dS7=iy~1o-)2P~|id&`Cl4qk|g%2|$!T z0sKOJdI$J6MnEG0ofOnJr8&jx0f8xkCkBK$$qlYfG!oEBL4`SkFlPu>M({#`zdG3& zzB)rh(69|75Jq5X1UP)k*eJ7EmJMC}es>cjc_%SyTVAH2;VVcbr88!h$z^i6yf-@R z=A)T-ChK*?)4Tbo$93&Qp&w7|vdsLTHm}olGI7f>)4qX~GD&4mpXH?7e21HLQl4)c z6#`k2l|ij$e7vc(wccoKX1`!9Xz;0IukZ`t0Yly>ukX-Wmb8GdX*mQuNc^^?j4Aa^_XLssCAb)sLl4szs*V4 z*^xGLk}?#_eR*j%Unv+vdu|o6A+YM>Ce|c)QHBN0d*IOuM$d!}TmK z=#OPCn*9<{Y`}BVnNEL&K~2kg=1!9quySS>E#t*3+6P~$F0x#BtQ?zNZCtBjcs#Ne8!Y7(QEakvb>w~ zJJTk$f~~I5S1MXu?(t~qghVQA_&mWDUcw~D@sAs z6&Q8zyZimVA8Vy9(hx{wwwNtvZLEvM*a*9u-Orw4FR{1T2kaF4gnh$)VCUE`>@Unj z8D^mz8fvf@%g~55Xu~?J$8FezE!c_};z%F~7h^bxaU8;7JbWqku?9s8e*T5dP@1Ajh9{VjBDzn>JT$*{W{)FX8XZY>v2j zRaeiizV?O{4K1zfJ1*pMp8X4q} zr{q73dvGs~;66NpNAWnGz>}2v&*KHWh*xlo(*Jb=z;T?wyLb;LaSET}Gki`!_#Qvu zSNwrLi&A@gQEKy)FG}rPH0{`~GenXCATBk!GDjt1Th;vizj6BS|5xVb!(D|D2qSP= zB7oAaXjcbKHQnJQk<6gFpDHh0Z&Fa-gc`2G`Tld9=!Jh6Qr`$"] = cmp.mapping.complete(), + [""] = cmp.mapping.confirm({ select = true }), + }), + }) + end, + }, +} + diff --git a/lua/plugins/colors.lua b/lua/plugins/colors.lua new file mode 100644 index 0000000..3ed89eb --- /dev/null +++ b/lua/plugins/colors.lua @@ -0,0 +1,6 @@ +return { + { "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {} }, + { "catppuccin/nvim", name = "catppuccin", lazy = true }, + { "ellisonleao/gruvbox.nvim", lazy = true }, +} + diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..dff370e --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,9 @@ +return { + { + "LazyVim/LazyVim", + opts = { + colorscheme = "catppuccin-mocha", -- or "catppuccin-mocha", "gruvbox" + }, + }, +} + diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..b0655ce --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -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 h to toggle the Harpoon quick menu + vim.keymap.set("n", "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", "m", function() + require("harpoon"):list():add() + end, { desc = "Mark file (Harpoon)" }) + end, +} + diff --git a/lua/plugins/lualine-clock.lua b/lua/plugins/lualine-clock.lua new file mode 100644 index 0000000..c72ffc2 --- /dev/null +++ b/lua/plugins/lualine-clock.lua @@ -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, +} + diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua new file mode 100644 index 0000000..736306a --- /dev/null +++ b/lua/plugins/mason.lua @@ -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, + } +} + diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..3d899a8 --- /dev/null +++ b/lua/plugins/neo-tree.lua @@ -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", + -- }, + -- }, + }, + }, +} + diff --git a/lua/plugins/ollama.lua b/lua/plugins/ollama.lua new file mode 100644 index 0000000..99dacf1 --- /dev/null +++ b/lua/plugins/ollama.lua @@ -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 is important for selections) + { + "oo", + ":lua require('ollama').prompt()", + desc = "ollama prompt", + mode = { "n", "v" }, + }, + + -- Direct prompt example + { + "oG", + ":lua require('ollama').prompt('Generate_Code')", + desc = "ollama Generate Code", + mode = { "n", "v" }, + }, + }, + + opts = { + -- your configuration overrides + model = "deepseek-coder-v2:16b", + } +} + diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua new file mode 100644 index 0000000..463b427 --- /dev/null +++ b/lua/plugins/snacks.lua @@ -0,0 +1,9 @@ +return { + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + opts = {} + } +} + diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..ada40c4 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -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: p to find files from the CWD Neovim was opened in + vim.keymap.set("n", "p", + function() + require("telescope.builtin").find_files({ cwd = vim.fn.getcwd() }) + end, + { desc = "Find Files (CWD, Telescope)" } + ) + end, +} + diff --git a/lua/plugins/terminal.lua b/lua/plugins/terminal.lua new file mode 100644 index 0000000..2e925a6 --- /dev/null +++ b/lua/plugins/terminal.lua @@ -0,0 +1,13 @@ +return { + "akinsho/toggleterm.nvim", + version = "*", + config = function() + require("toggleterm").setup({ + size = 15, + open_mapping = [[]], -- toggle terminal with Ctrl + \ + direction = "horizontal", -- options: 'vertical', 'tab', 'float' + shade_terminals = true, + }) + end, +} + diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..f6d9bab --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -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, +} +