From e6c4ecde86cbc8a5bd747d8be4e083ff68f40c69 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 9 Jun 2026 14:23:18 +0000 Subject: [PATCH] initial commit --- init.lua | 11 ++ lazy-lock.json | 37 ++++ lazyvim.json | 9 + lua/config/keymaps.lua | 34 ++++ lua/config/lazy.lua | 80 ++++++++ lua/config/lspServers.lua | 45 +++++ lua/config/options.lua | 28 +++ lua/ignoreConfig/codeCompanionModel.lua | 5 + lua/ignoreConfig/colourConfig.lua | 5 + lua/ignoreConfig/lspIgnoreServers.lua | 2 + lua/plugins/alpha.lua | 55 ++++++ lua/plugins/barbar.lua | 16 ++ lua/plugins/blamer.lua | 3 + lua/plugins/blink-cmp.lua | 69 +++++++ lua/plugins/code-companion.lua | 72 +++++++ lua/plugins/colourscheme.lua | 107 +++++++++++ lua/plugins/conform.lua | 13 ++ lua/plugins/contextfiles.lua | 3 + lua/plugins/dressing.lua | 4 + lua/plugins/fzflua.lua | 12 ++ lua/plugins/indent-blanklines.lua | 7 + lua/plugins/lazygit.lua | 21 ++ lua/plugins/lsp.lua | 245 ++++++++++++++++++++++++ lua/plugins/lualine.lua | 7 + lua/plugins/noice.lua | 32 ++++ lua/plugins/nvim-colorizer.lua | 8 + lua/plugins/nvim-treesitter.lua | 24 +++ lua/plugins/oil.lua | 15 ++ lua/plugins/sleuth-vim.lua | 3 + lua/plugins/venv-selector.lua | 17 ++ 30 files changed, 989 insertions(+) create mode 100644 init.lua create mode 100644 lazy-lock.json create mode 100644 lazyvim.json create mode 100644 lua/config/keymaps.lua create mode 100644 lua/config/lazy.lua create mode 100644 lua/config/lspServers.lua create mode 100644 lua/config/options.lua create mode 100644 lua/ignoreConfig/codeCompanionModel.lua create mode 100644 lua/ignoreConfig/colourConfig.lua create mode 100644 lua/ignoreConfig/lspIgnoreServers.lua create mode 100644 lua/plugins/alpha.lua create mode 100644 lua/plugins/barbar.lua create mode 100644 lua/plugins/blamer.lua create mode 100644 lua/plugins/blink-cmp.lua create mode 100644 lua/plugins/code-companion.lua create mode 100644 lua/plugins/colourscheme.lua create mode 100644 lua/plugins/conform.lua create mode 100644 lua/plugins/contextfiles.lua create mode 100644 lua/plugins/dressing.lua create mode 100644 lua/plugins/fzflua.lua create mode 100644 lua/plugins/indent-blanklines.lua create mode 100644 lua/plugins/lazygit.lua create mode 100644 lua/plugins/lsp.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/noice.lua create mode 100644 lua/plugins/nvim-colorizer.lua create mode 100644 lua/plugins/nvim-treesitter.lua create mode 100644 lua/plugins/oil.lua create mode 100644 lua/plugins/sleuth-vim.lua create mode 100644 lua/plugins/venv-selector.lua diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..bacf2bb --- /dev/null +++ b/init.lua @@ -0,0 +1,11 @@ +vim.o.tabstop = 4 -- A TAB character looks like 4 spaces +vim.o.expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character +vim.o.softtabstop = 4 -- Number of spaces inserted instead of a TAB character +vim.o.shiftwidth = 4 -- Number of spaces inserted when indenting +--blamer globals +vim.g.blamer_delay = 0 -- Example: Set blame message delay to 500ms +vim.g.blamer_template = ", " -- Example: Customize blame message format +vim.g.blamer_relative_time = true +vim.g.blamer_enabled = true +vim.g.blamer_show_in_visual_modes = 0 +require("config.lazy") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..baa6ba0 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,37 @@ +{ + "alpha-nvim": { "branch": "main", "commit": "6c6a89d5b068b5251c8bdf0dd57bb921bcfeeb09" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "blamer.nvim": { "branch": "master", "commit": "e0d43c11697300eb68f00d69df8b87deb0bf52dc" }, + "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, + "codecompanion.nvim": { "branch": "main", "commit": "b1cbe52ecd71e7b0ed43ac1dc6eb3aab4099db00" }, + "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, + "contextfiles.nvim": { "branch": "main", "commit": "d5d0525c32777366e5c415fdb682444ce9f753f8" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "everforest-nvim": { "branch": "main", "commit": "d235ca0aa6a29546e661a020e2618612acbbffbe" }, + "fidget.nvim": { "branch": "main", "commit": "82404b196e73a00b1727a91903beef5ddc319d22" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "fzf-lua": { "branch": "main", "commit": "fea9eedc6894c44d44cbb772a5cd11c93b82d7a1" }, + "gitsigns.nvim": { "branch": "main", "commit": "dd3f588bacbeb041be6facf1742e42097f62165d" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" }, + "lualine.nvim": { "branch": "master", "commit": "131a558e13f9f28b15cd235557150ccb23f89286" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7b01e2974a47d489bb92f47a41e4c0088ea8f86e" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "bb639d4bf385a4d89f478b83af4d770be05ab7eb" }, + "mini.icons": { "branch": "main", "commit": "520995f1d75da0e4cc901ee95080b1ff2bc46b94" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, + "nvim-lspconfig": { "branch": "master", "commit": "9573948c38bfabeec353ae7dd7d3ffec4c506a6b" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, + "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, + "oil.nvim": { "branch": "master", "commit": "b91ee5a77a6a9605d9c1aaf4fda74b66082c8297" }, + "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, + "render-markdown.nvim": { "branch": "main", "commit": "5adf0895310c1904e5abfaad40a2baad7fe44a07" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "venv-selector.nvim": { "branch": "main", "commit": "cc4bb3975de8835291f9bb45889e96c6b2795fc4" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } +} 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/config/keymaps.lua b/lua/config/keymaps.lua new file mode 100644 index 0000000..f7eace6 --- /dev/null +++ b/lua/config/keymaps.lua @@ -0,0 +1,34 @@ +-- vim.keymap.set("n", "", "", {desc = ""}) + +--PERSONAL +vim.keymap.set("n", "", "18j", {desc = "Fast scroll down"}) +vim.keymap.set("n", "", "18k", {desc = "Fast scroll up"}) +vim.keymap.set("n", "h", ":noh", {desc = "Remove current highlighting"}) + +vim.keymap.set("v", "y", '"+y', {desc='Yank to "+ register for external copy/paste'}) + +--CODE/LSP +vim.keymap.set("n", "gl", function() vim.diagnostic.open_float() end, {desc = "Open LSP diagnostic"}) + +--OIL NVIM EXPLORER +vim.keymap.set("n", "-", "Oil --float", {desc = "Open floating Oil Explorer in parent dir"}) + +--FZF +vim.keymap.set("n", "/", ":FzfLua files", {desc = "Open fzf in cwd"}) +vim.keymap.set("n", "?", ":FzfLua files cwd=/", {desc = "Open fzf in root dir"}) +vim.keymap.set("n", "", ":FzfLua grep", {desc = "Grep CWD"}) +vim.keymap.set("n", "", ":FzfLua grep cwd=/", {desc = "Grep root dir"}) + +--BARBAR +vim.keymap.set("n", "b[", "BufferPrevious", {desc = "Previous buffer tab"}) +vim.keymap.set("n", "b]", "BufferNext", {desc = "Next buffer tab"}) +vim.keymap.set("n", "bp", "BufferPin", {desc = "Pin current buffer"}) +vim.keymap.set("n", "bq", "BufferClose", {desc = "Close current buffer"}) +vim.keymap.set("n", "br", "BufferRestore", {desc = "Restore buffer"}) +vim.keymap.set("n", "bg", "BufferPick", {desc = "Pick buffer"}) + +--ALPHA +vim.keymap.set("n", "a", ":Alpha", {desc = "Open Alpha welcome screen"}) + +--CONFORM +vim.keymap.set("n", "f", ":lua require('conform').format()") diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..bb11926 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,80 @@ +-- 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.rtp:prepend(lazypath) + + +-- 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 = "\\" + +require("config.options") + +-- 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 = { "everforest" } }, + -- automatically check for plugin updates + checker = { + enabled = true, + notify = false + }, +}) + +--setup colour indents +local highlight = { + "IndentHighlightEverForestGreen", + "IndentHighlightEverForestYellow", + "IndentHighlightEverForestBlue", +} + +local hooks = require "ibl.hooks" +-- create the highlight groups in the highlight setup hook, so they are reset +-- every time the colorscheme changes +hooks.register(hooks.type.HIGHLIGHT_SETUP, function() + vim.api.nvim_set_hl(0, "IndentHighlightRed", { fg = "#E06C75" }) + vim.api.nvim_set_hl(0, "IndentHighlightYellow", { fg = "#E5C07B" }) + vim.api.nvim_set_hl(0, "IndentHighlightBlue", { fg = "#61AFEF" }) + vim.api.nvim_set_hl(0, "IndentHighlightOrange", { fg = "#D19A66" }) + vim.api.nvim_set_hl(0, "IndentHighlightGreen", { fg = "#98C379" }) + vim.api.nvim_set_hl(0, "IndentHighlightViolet", { fg = "#C678DD" }) + vim.api.nvim_set_hl(0, "IndentHighlightCyan", { fg = "#56B6C2" }) + vim.api.nvim_set_hl(0, "IndentHighlightLightGray", { fg = "#BCCCDC" }) + vim.api.nvim_set_hl(0, "IndentHighlightLightTurquoise", { fg = "#70f1bc" }) + + vim.api.nvim_set_hl(0, "IndentHighlightEverForestGreen", { fg = "#A7C080" }) + vim.api.nvim_set_hl(0, "IndentHighlightEverForestYellow", { fg = "#DBBC7F" }) + vim.api.nvim_set_hl(0, "IndentHighlightEverForestRed", { fg = "#E67E80" }) + vim.api.nvim_set_hl(0, "IndentHighlightEverForestBlue", { fg = "#7FBBB3" }) + + vim.api.nvim_set_hl(0, "IndentHighlightDraculaBlue", { fg = "#8BE9FD"}) + vim.api.nvim_set_hl(0, "IndentHighlightDraculaGreen", { fg = "#50FA7B"}) + vim.api.nvim_set_hl(0, "IndentHighlightDraculaPink", { fg = "#FF79C6"}) + vim.api.nvim_set_hl(0, "IndentHighlightDraculaYellow", { fg = "#F1Fa8C"}) +end) + +require("ibl").setup { indent = { highlight = highlight } } + + +require("config.keymaps") + + diff --git a/lua/config/lspServers.lua b/lua/config/lspServers.lua new file mode 100644 index 0000000..93e5b15 --- /dev/null +++ b/lua/config/lspServers.lua @@ -0,0 +1,45 @@ +local ignoreServers = require('ignoreConfig.lspIgnoreServers') + +local servers = { + jq = {}, + clangd = {}, + glsl_analyzer = {}, + lua_ls = { + -- cmd = { ... }, + -- filetypes = { ... }, + -- capabilities = {}, + --settings = { + -- Lua = { + -- completion = { + -- callSnippet = 'Replace', + -- }, + -- -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- diagnostics = { disable = { 'missing-fields' },}, + -- runtime = { + -- -- Tell the language server which version of Lua you are using (likely LuaJIT in Neovim) + -- version = 'LuaJIT', + -- }, + -- workspace = { + -- -- Make the server aware of Neovim runtime files + -- library = vim.api.nvim_get_runtime_file("", true), + -- }, + -- }, + --}, + }, + cssls = {}, + + marksman = { + filetypes = { "markdown", "md" }, + }, + --pyright = {}, +} + +for key,value in pairs(ignoreServers) do + servers[key]=value + --print(key, value) +end +--for key, value in pairs(servers) do +-- print(key, "=", value) +--end + +return servers diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..ae950f5 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,28 @@ +vim.opt.smarttab = true +vim.opt.autoindent = true +vim.opt.breakindent = true +vim.opt.number = true +vim.o.confirm = true +--vim.o.inccommand = 'split' +vim.o.cursorline = true +vim.o.undofile = true +vim.o.showmode = false +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.signcolumn = "yes" +vim.o.splitright = true +vim.o.splitbelow = true +vim.opt.list = true +vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣"} +vim.opt.scrolloff = 8 +vim.opt.updatetime = 1200; + +vim.api.nvim_create_autocmd( "TextYankPost", { + group = vim.api.nvim_create_augroup("YankHighlight", { + clear = true }), + pattern = "*", + callback = function() + vim.highlight.on_yank() + end, + desc = "Highlight Yank", +}) diff --git a/lua/ignoreConfig/codeCompanionModel.lua b/lua/ignoreConfig/codeCompanionModel.lua new file mode 100644 index 0000000..22a73b9 --- /dev/null +++ b/lua/ignoreConfig/codeCompanionModel.lua @@ -0,0 +1,5 @@ +local opts = { + model = "claude_code" +} + +return opts diff --git a/lua/ignoreConfig/colourConfig.lua b/lua/ignoreConfig/colourConfig.lua new file mode 100644 index 0000000..a937d2b --- /dev/null +++ b/lua/ignoreConfig/colourConfig.lua @@ -0,0 +1,5 @@ +local opts = { + transparent = 0 +} + +return opts diff --git a/lua/ignoreConfig/lspIgnoreServers.lua b/lua/ignoreConfig/lspIgnoreServers.lua new file mode 100644 index 0000000..97aeadd --- /dev/null +++ b/lua/ignoreConfig/lspIgnoreServers.lua @@ -0,0 +1,2 @@ +return { +} diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua new file mode 100644 index 0000000..4236751 --- /dev/null +++ b/lua/plugins/alpha.lua @@ -0,0 +1,55 @@ +return { + "goolord/alpha-nvim", + config = function () + local alpha = require'alpha' + --local colours = require 'material.colors' + vim.api.nvim_set_hl(0, "alphaheader", {fg = "#3661cf" }) + --vim.api.nvim_set_hl(0, "alphafooter", {fg = colours.main.darkpurple }) + local dashboard = require'alpha.themes.dashboard' + dashboard.section.header.val = { + [[ ░░░░░░░░░░░░░░░░░░ ]], + [[ ░░░░░░░░░░░░░░░░░░░░░░░░░░ ]], + [[ ░░░░░░░░░░░░░░░░▒▓▒░░░░░░░░░░░ ]], + [[ ░░░░░░░░░░░░░░░░░▒██▓░░░░░░░░░░░░░░░ ]], + [[ ░░░░░░░░░░░░░░░░▓████▓░░░░░░░░░░░░░░░░ ]], + [[ ░░░░░░░░░░░░░░░░▒██████▓░░░░░░░░░░░░░░░░░░ ]], + [[ ░░░░░░░░░░░░░░░▓████████▒░░░░░░░░░░░░░░░░░ ]], + [[░░░░░░░░░░░░░░▒███████████▓░░░░░░░░░░░░░░░░░]], + [[░░░░░░░░░░░░░▓██████████████▒░░░░░░░░░░░░░░░]], + [[░░░░░░░░░░░░▓████████████████▓░░░░░░░░░░░░░░]], + [[░░░░░░░░░░░▓███████████████▓▓██▒░░░░░░░░░░░░]], + [[░░░░░░░░░░▒████████████████▓░▒██▒░░░░░░░░░░░]], + [[░░░░░░░░░░▒███████████████▓▒░░▓█▓░░░░░░░░░░░]], + [[ ░░░░░░░░░▒███████████████▓░░░▓█▓▒░░░░░░░░░ ]], + [[ ░░░░░░░░░░▓████████████████████▓░░░░░░░░░░ ]], + [[ ░░░░░░░░▒▓██████████████████▓░░░░░░░░░ ]], + [[ ░░░░░░░░░▓████████████████▒░░░░░░░░░ ]], + [[ ░░░░░░░░▒▓██████████▓▒░░░░░░░░ ]], + [[ ░░░░░░░░░░░░▒▒░░░░░░░░░░░░ ]], + [[ ░░░░░░░░░░░░░░░░░░ ]], + } + dashboard.section.header.opts.hl = "alphaheader" + dashboard.section.buttons.val = { + dashboard.button( "e", " new file" , ":ene startinsert "), + dashboard.button("f", " search file in cwd", ":FzfLua files"), + dashboard.button("-", " explore cwd", ":Oil --float"), + dashboard.button("l", " Lazy settings", ":Lazy"), + dashboard.button("g", " GIT", ":LazyGit"), + dashboard.button( "q", "󰅚 quit nvim" , ":qa"), + } + local handle = io.popen('fortune') + local fortune = handle:read("*a") + handle:close() + dashboard.section.footer.val = { + [["we define the boundaries of reality;]], + [[they don't define us."]], + [[ -Teferi]] + } + dashboard.section.footer.opts.hl = "alphafooter" + dashboard.config.opts.noautocmd = true + + vim.cmd[[autocmd user alphaready echo 'ready']] + + alpha.setup(dashboard.config) + end +} diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua new file mode 100644 index 0000000..7aa88e8 --- /dev/null +++ b/lua/plugins/barbar.lua @@ -0,0 +1,16 @@ +return { + {'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- animation = true, + -- insert_at_start = true, + -- …etc. + }, + version = '^1.0.0', -- optional: only update when a new 1.x version is released + }, +} diff --git a/lua/plugins/blamer.lua b/lua/plugins/blamer.lua new file mode 100644 index 0000000..8f1cf0a --- /dev/null +++ b/lua/plugins/blamer.lua @@ -0,0 +1,3 @@ +return{ + "APZelos/blamer.nvim", +} diff --git a/lua/plugins/blink-cmp.lua b/lua/plugins/blink-cmp.lua new file mode 100644 index 0000000..dcc76c7 --- /dev/null +++ b/lua/plugins/blink-cmp.lua @@ -0,0 +1,69 @@ +-- Autocommand to re-apply UI highlights after colorscheme changes +vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "*", + callback = function() + -- If using nvim-cmp, you can re-source the menu highlights + if pcall(require, 'blink-cmp') then + -- Optional: run a custom highlights function or just re-setup your completion colors + end + + -- Refresh LSP diagnostic highlights and signs + if vim.lsp.diagnostic and type(vim.lsp.diagnostic._define_default_signs_and_highlights) == 'function' then + vim.lsp.diagnostic._define_default_signs_and_highlights() + end + end, +}) + +return { + 'saghen/blink.cmp', + -- optional: provides snippets for the snippet source + dependencies = { 'rafamadriz/friendly-snippets' }, + + -- use a release tag to download pre-built binaries + version = '1.*', + -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust + -- build = 'cargo build --release', + -- If you use nix, you can build from source using latest nightly rust with: + -- build = 'nix run .#build-plugin', + + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { preset = 'super-tab' }, + + appearance = { + -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' + -- Adjusts spacing to ensure icons are aligned + nerd_font_variant = 'mono' + }, + + -- (Default) Only show the documentation popup when manually triggered + completion = { documentation = { auto_show = false } }, + + -- Default list of enabled providers defined so that you can extend it + -- elsewhere in your config, without redefining it, due to `opts_extend` + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer' }, + }, + + -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance + -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, + -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` + -- + -- See the fuzzy documentation for more information + fuzzy = { implementation = "prefer_rust_with_warning" } + }, + opts_extend = { "sources.default" } +} diff --git a/lua/plugins/code-companion.lua b/lua/plugins/code-companion.lua new file mode 100644 index 0000000..2fedccf --- /dev/null +++ b/lua/plugins/code-companion.lua @@ -0,0 +1,72 @@ +local ignore = require('ignoreConfig.codeCompanionModel'); +--[[ +-- ignore file should be formatted as: + +local opts = { + model = "claude_code", +} +return opts + +-- but change model to desired model, ex. ollama +--]] + +return { + "olimorris/codecompanion.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "hrsh7th/nvim-cmp", -- Optional: for autocompletion inside chat + { "MeanderingProgrammer/render-markdown.nvim", ft = { "markdown", "codecompanion" } }, -- Optional: pretty markdown render + }, + config = function() + require("codecompanion").setup({ + -- Define strategies (Chat vs. Inline code generation/refactor) + strategies = { + chat = { + adapter = ignore.model, + }, + inline = { + adapter = ignore.model, + }, + }, + -- Configure the actual connections (adapters) + adapters = { + claude_code = function() + return require("codecompanion.adapters").extend("claude_code", { + env = { + -- Looks for your export ANTHROPIC_API_KEY="your-key" in your .bashrc/.zshrc + command = "/usr/local/bin/claude-code-acp", + }, + }) + end, + ollama = function() + return require("codecompanion.adapters").extend("ollama", { + schema = { + model = { + default = "jean:latest", -- Your downloaded local model + }, + }, + }) + end, + }, + interactions = { + cli = { + agent = "claude_code", + agents = { + claude_code = { + cmd = "claude", + args = {}, + description = "Claude Code CLI", + provider = "terminal", + }, + }, + }, + }, + }) + + -- Quick Keymaps + vim.keymap.set({ "n", "v" }, "ac", "CodeCompanionChat Toggle", { desc = "Toggle AI Chat" }) + vim.keymap.set({ "n", "v" }, "ai", "CodeCompanionActions", { desc = "AI Actions Menu" }) + end, +} + diff --git a/lua/plugins/colourscheme.lua b/lua/plugins/colourscheme.lua new file mode 100644 index 0000000..2a3c389 --- /dev/null +++ b/lua/plugins/colourscheme.lua @@ -0,0 +1,107 @@ +--[[ +return { + 'marko-cerovac/material.nvim', + priority = 1000, + config = function() + local material = require "material" + --local colours = require "material.colors" + local ignores = require('ignoreConfig.colourConfig') + vim.g.material_style = "darker" + --vim.g.material_style = "palenight" + material.setup({ + lualine_style = "default", -- Lualine style ( can be 'stealth' or 'default' ) + disable = ignores[1], + custom_highlights = { + Comment = { fg = "#b7b0bf" }, + LineNr = { fg = "#b7b0bf" }, + -- AlphaHeader = { fg = "#3661cf" }, + -- AlphaFooter = { fg = colours.main.red}, + }, + }) + vim.cmd('colorscheme material') + + end, +} + +--material styles: +--daker +--lighter +--oceanic +--palenight +--deep ocean +--]] + +--[[ +-- DRACULA +return { + -- add dracula + "Mofiqul/dracula.nvim", + priority = 1000, + config = function() + vim.cmd('colorscheme dracula') + end, +} +--]] + + + +--[[ +return { + "rebelot/kanagawa.nvim", + priority = 1000, + config = function() + local ignores = require('ignoreConfig.colourConfig') + require('kanagawa').setup({ + theme = "lotus", + compile = true, + commentStyle = { italic = true }, + transparent = ignores.transparent, + colors = { + --palette = { + -- -- change all usages of these colors + -- --fujiGray = "#FFFFFF", + --}, + theme = { + all = { + syn = { + --comment = "#FF00FF", + comment = "#CDD3D4", + } + }, + }, + }, + }) + vim.cmd("colorscheme kanagawa-dragon") + -- colourschemes: + -- wave (default) + -- dragon (dark) + -- lotus (MY EEEEYES!) + end, + --uncomment this and 'compile=true' in setup if compiling to bytecode + build = function() + vim.cmd("KanagawaCompile") + end, +} +--]] + + + + + +--EVERFOREST +return{ + "neanias/everforest-nvim", + priority = 1000, + config = function() + local everforest = require("everforest"); + local ignore = require('ignoreConfig.colourConfig'); + everforest.setup({ + background = "hard", + transparent_background_level = ignore.transparent, + italics = true, + + }); + everforest.load(); + vim.cmd("colorscheme everforest"); + end, +} diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua new file mode 100644 index 0000000..4cf8d3d --- /dev/null +++ b/lua/plugins/conform.lua @@ -0,0 +1,13 @@ +return { + 'stevearc/conform.nvim', + opts = { + formatters_by_ft = { + json = { "jq" }, -- Or use "prettierd" / "prettier" / "fixjson" + }, + -- Optional: Automatically format when you save the file + --format_on_save = { + -- timeout_ms = 500, + -- lsp_format = "fallback", + --}, + }, + } diff --git a/lua/plugins/contextfiles.lua b/lua/plugins/contextfiles.lua new file mode 100644 index 0000000..8a89477 --- /dev/null +++ b/lua/plugins/contextfiles.lua @@ -0,0 +1,3 @@ +return { + "banjo/contextfiles.nvim", +} diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua new file mode 100644 index 0000000..693f41e --- /dev/null +++ b/lua/plugins/dressing.lua @@ -0,0 +1,4 @@ +return{ + 'stevearc/dressing.nvim', + opts = {}, +} diff --git a/lua/plugins/fzflua.lua b/lua/plugins/fzflua.lua new file mode 100644 index 0000000..308b930 --- /dev/null +++ b/lua/plugins/fzflua.lua @@ -0,0 +1,12 @@ +return { + "ibhagwan/fzf-lua", + -- optional for icon support + dependencies = { "nvim-tree/nvim-web-devicons" }, + -- or if using mini.icons/mini.nvim + -- dependencies = { "echasnovski/mini.icons" }, + opts = { + files = { + no_ignore = true, + } + } +} diff --git a/lua/plugins/indent-blanklines.lua b/lua/plugins/indent-blanklines.lua new file mode 100644 index 0000000..4cc695a --- /dev/null +++ b/lua/plugins/indent-blanklines.lua @@ -0,0 +1,7 @@ +return { + "lukas-reineke/indent-blankline.nvim", + main = "ibl", + ---@module "ibl" + ---@type ibl.config + opts = { }, +} diff --git a/lua/plugins/lazygit.lua b/lua/plugins/lazygit.lua new file mode 100644 index 0000000..c7cb122 --- /dev/null +++ b/lua/plugins/lazygit.lua @@ -0,0 +1,21 @@ +-- nvim v0.8.0 +return { + "kdheepak/lazygit.nvim", + lazy = true, + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { "lg", "LazyGit", desc = "LazyGit" } + } +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..9eec5ec --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,245 @@ +-- LSP Plugins +return { -- Main LSP Configuration + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs and related tools to stdpath for Neovim + -- Mason must be loaded before its dependents so we need to set it up here. + -- NOTE: `opts = {}` is the same as calling `require('mason').setup({})` + { 'mason-org/mason.nvim', opts = {} }, + { + 'mason-org/mason-lspconfig.nvim', + opts = { + automatic_enable = { + exclude = { 'jdtls' } + } + } + }, + 'WhoIsSethDaniel/mason-tool-installer.nvim', + + -- Useful status updates for LSP. + { 'j-hui/fidget.nvim', opts = {} }, + + -- Allows extra capabilities provided by blink.cmp + }, + config = function() + -- Brief aside: **What is LSP?** + -- + -- LSP is an initialism you've probably heard, but might not understand what it is. + -- + -- LSP stands for Language Server Protocol. It's a protocol that helps editors + -- and language tooling communicate in a standardized fashion. + -- + -- In general, you have a "server" which is some tool built to understand a particular + -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers + -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone + -- processes that communicate with some "client" - in this case, Neovim! + -- + -- LSP provides Neovim with features like: + -- - Go to definition + -- - Find references + -- - Autocompletion + -- - Symbol Search + -- - and more! + -- + -- Thus, Language Servers are external tools that must be installed separately from + -- Neovim. This is where `mason` and related plugins come into play. + -- + -- If you're wondering about lsp vs treesitter, you can check out the wonderfully + -- and elegantly composed help section, `:help lsp-vs-treesitter` + + -- This function gets run when an LSP attaches to a particular buffer. + -- That is to say, every time a new file is opened that is associated with + -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this + -- function will be executed to configure the current buffer + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), + callback = function(event) + -- NOTE: Remember that Lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local map = function(keys, func, desc, mode) + mode = mode or 'n' + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end + + + -- d = view diagnostic message under cursor + + -- Rename the variable under your cursor. + -- Most Language Servers support renaming across files, etc. + map('gn', vim.lsp.buf.rename, '[R]e[n]ame') + + -- Execute a code action, usually your cursor needs to be on top of an error + -- or a suggestion from your LSP for this to activate. + map('ga', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) + + -- Find references for the word under your cursor. + map('gr', require('fzf-lua').lsp_references, '[G]oto [R]eferences') + + -- Jump to the implementation of the word under your cursor. + -- Useful when your language has ways of declaring types without an actual implementation. + map('gi', require('fzf-lua').lsp_implementations, '[G]oto [I]mplementation') + + -- Jump to the definition of the word under your cursor. + -- This is where a variable was first declared, or where a function is defined, etc. + -- To jump back, press . + map('gd', require('fzf-lua').lsp_definitions, '[G]oto [D]efinition') + + -- WARN: This is not Goto Definition, this is Goto Declaration. + -- For example, in C this would take you to the header. + map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + + -- Fuzzy find all the symbols in your current document. + -- Symbols are things like variables, functions, types, etc. + map('gO', require('fzf-lua').lsp_document_symbols, 'Open Document Symbols') + + -- Fuzzy find all the symbols in your current workspace. + -- Similar to document symbols, except searches over your entire project. + map('gW', require('fzf-lua').lsp_live_workspace_symbols, 'Open Workspace Symbols') + + -- Jump to the type of the word under your cursor. + -- Useful when you're not sure what type a variable is and you want to see + -- the definition of its *type*, not where it was *defined*. + map('gt', require('fzf-lua').lsp_typedefs, '[G]oto [T]ype Definition') + + -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) + ---@param client vim.lsp.Client + ---@param method vim.lsp.protocol.Method + ---@param bufnr? integer some lsp support methods only in specific files + ---@return boolean + local function client_supports_method(client, method, bufnr) + if vim.fn.has 'nvim-0.11' == 1 then + return client:supports_method(method, bufnr) + else + return client.supports_method(method, { bufnr = bufnr }) + end + end + + -- The following two autocommands are used to highlight references of the + -- word under your cursor when your cursor rests there for a little while. + -- See `:help CursorHold` for information about when this is executed + -- + -- When you move your cursor, the highlights will be cleared (the second autocommand). + local client = vim.lsp.get_client_by_id(event.data.client_id) + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then + local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) + vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.document_highlight, + }) + + vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { + buffer = event.buf, + group = highlight_augroup, + callback = vim.lsp.buf.clear_references, + }) + + vim.api.nvim_create_autocmd({ 'LspDetach' }, { + group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), + callback = function(event2) + vim.lsp.buf.clear_references() + vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + end, + }) + end + + -- The following code creates a keymap to toggle inlay hints in your + -- code, if the language server you are using supports them + -- + -- This may be unwanted, since they displace some of your code + if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then + map('th', function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) + end, '[T]oggle Inlay [H]ints') + end + end, + }) + + -- Diagnostic Config + -- See :help vim.diagnostic.Opts + vim.diagnostic.config { + severity_sort = true, + float = { border = 'rounded', source = 'if_many' }, + underline = { severity = vim.diagnostic.severity.ERROR }, + signs = { + text = { + [vim.diagnostic.severity.ERROR] = '󰅚 ', + [vim.diagnostic.severity.WARN] = '󰀪 ', + [vim.diagnostic.severity.INFO] = '󰋽 ', + [vim.diagnostic.severity.HINT] = '󰌶 ', + }, + }, + virtual_text = { + source = 'if_many', + spacing = 2, + format = function(diagnostic) + local diagnostic_message = { + [vim.diagnostic.severity.ERROR] = diagnostic.message, + [vim.diagnostic.severity.WARN] = diagnostic.message, + [vim.diagnostic.severity.INFO] = diagnostic.message, + [vim.diagnostic.severity.HINT] = diagnostic.message, + } + return diagnostic_message[diagnostic.severity] + end, + }, + } + + -- LSP servers and clients are able to communicate to each other what features they support. + -- By default, Neovim doesn't support everything that is in the LSP specification. + -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities. + -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. + + + local orig_capabilities = vim.lsp.protocol.make_client_capabilities() + local capabilities = require('blink.cmp').get_lsp_capabilities(orig_capabilities) + + -- Enable the following language servers + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- + -- Add any additional override configuration in the following tables. Available keys are: + -- - cmd (table): Override the default command used to start the server + -- - filetypes (table): Override the default list of associated filetypes for the server + -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. + -- - settings (table): Override the default settings passed when initializing the server. + -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ + local servers = require('config.lspServers') + + -- Ensure the servers and tools above are installed + -- + -- To check the current status of installed tools and/or manually install + -- other tools, you can run + -- :Mason + -- + -- You can press `g?` for help in this menu. + -- + -- `mason` had to be setup earlier: to configure its options see the + -- `dependencies` table for `nvim-lspconfig` above. + -- + -- You can add other tools here that you want Mason to install + -- for you, so that they are available from within Neovim. + local ensure_installed = vim.tbl_keys(servers or {}) + vim.list_extend(ensure_installed, { + 'stylua', -- Used to format Lua code + }) + require('mason-tool-installer').setup { ensure_installed = ensure_installed } + + require('mason-lspconfig').setup { + ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) + automatic_installation = false, + handlers = { + function(server_name) + local server = servers[server_name] or {} + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for ts_ls) + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + require('lspconfig')[server_name].setup(server) + end, + }, + } + end, +} + diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..e563eef --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,7 @@ +return { + 'nvim-lualine/lualine.nvim', + opts = { + --theme = "solarized_light", --https://github.com/nvim-lualine/lualine.nvim/blob/master/THEMES.md + }, + dependencies = { 'nvim-tree/nvim-web-devicons' } +} diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..9112d30 --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,32 @@ +-- lazy.nvim +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + } +} diff --git a/lua/plugins/nvim-colorizer.lua b/lua/plugins/nvim-colorizer.lua new file mode 100644 index 0000000..7cc4f43 --- /dev/null +++ b/lua/plugins/nvim-colorizer.lua @@ -0,0 +1,8 @@ +return{ + { + 'norcalli/nvim-colorizer.lua', + opts = { + '*'; + } + }, +} diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..89ea397 --- /dev/null +++ b/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,24 @@ +return { + 'nvim-treesitter/nvim-treesitter', + branch = "main", + build = ':TSUpdate', + main = 'nvim-treesitter.config', + opts = { + ensure_installed = { + 'c', + 'cpp', + 'lua', + 'vim', + 'vimdoc', + 'markdown', + 'markdown_inline', + 'query', + 'c_sharp', + 'yaml', + }, + auto_install = true, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }, +} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..4ed2e23 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,15 @@ +return { + 'stevearc/oil.nvim', + opts = { + case_insensitive = true, + view_options = { + show_hidden = true, + natural_order = true, + sort = { + { "name", "asc" }, + }, + } + }, + dependencies = {{ "echasnovski/mini.icons", opts = {} }}, + lazy = false, +} diff --git a/lua/plugins/sleuth-vim.lua b/lua/plugins/sleuth-vim.lua new file mode 100644 index 0000000..9d02aa3 --- /dev/null +++ b/lua/plugins/sleuth-vim.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-sleuth" +} diff --git a/lua/plugins/venv-selector.lua b/lua/plugins/venv-selector.lua new file mode 100644 index 0000000..2aeb101 --- /dev/null +++ b/lua/plugins/venv-selector.lua @@ -0,0 +1,17 @@ +return { + "linux-cultist/venv-selector.nvim", + dependencies = { + "neovim/nvim-lspconfig", + { "nvim-telescope/telescope.nvim", branch = "master", dependencies = { "nvim-lua/plenary.nvim" } }, + }, + ft = "python", --load when python file opens + lazy = false, + branch = "main", -- This is the regexp branch, use this for the new version + keys = { + { "vs", "VenvSelect" }, + }, + ---@type venv-selector.Config + opts = { + -- Your settings go here + }, +}