commit 22e52c883a6331697308698e926ce6e25c48d6b3 Author: Will Date: Sun Mar 29 20:12:58 2026 +0100 2026 nvim config 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 0000000..36dc013 Binary files /dev/null and b/lua/.DS_Store differ diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..cd97078 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,47 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end + +vim.opt.number = true +vim.api.nvim_create_autocmd("InsertEnter", { command = "set norelativenumber" }) +vim.api.nvim_create_autocmd("InsertLeave", { command = "set relativenumber" }) + + +vim.opt.tabstop = 4 -- Number of spaces tabs count for +vim.opt.shiftwidth = 4 -- Number of spaces for each indent +vim.opt.softtabstop = 4 -- Number of spaces for a tab when editing +vim.opt.expandtab = true -- Use spaces instead of actual tab characters + + +vim.opt.rtp:prepend(lazypath) +vim.opt.number = true -- show absolute line numbers +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + -- import your plugins + { import = "plugins" }, + }, + -- Configure any other settings here. See the documentation for more details. + -- colorscheme that will be used when installing plugins. + install = { colorscheme = { "habamax" } }, + -- automatically check for plugin updates + checker = { enabled = true }, +}) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..f30787e --- /dev/null +++ b/lua/plugins/cmp.lua @@ -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({ + [""] = 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, +} +