diff --git a/.github/cspell/repo_soft.txt b/.github/cspell/repo_soft.txt index a063140..6a1da8d 100644 --- a/.github/cspell/repo_soft.txt +++ b/.github/cspell/repo_soft.txt @@ -4,3 +4,10 @@ luacheck yamlfmt neogit luarocks +Luasnip +lualine +devicons +lazygit +Gruvbox +Quickkey +lspconfig diff --git a/.luacheckrc b/.luacheckrc index 065234c..5ea0bb6 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -3,7 +3,21 @@ -- luacheck:ignore 111 std = { - globals = { "vim", "require", "strategy", "query", "globals", "math" }, -- these globals can be set and accessed. + globals = { + "vim", + "require", + "strategy", + "query", + "globals", + "math", + "pcall", + "os", + "pairs", + "string", + "table", + "ipairs", + }, } + codes = true ranges = true diff --git a/.luarc.json b/.luarc.json index fe127fd..55caf15 100644 --- a/.luarc.json +++ b/.luarc.json @@ -1,9 +1,3 @@ { - "diagnostics.globals": [ - "vim", - "globals", - "std", - "codes", - "ranges" - ] -} \ No newline at end of file + "diagnostics.globals": ["vim", "globals", "std", "codes", "ranges"] +} diff --git a/README.md b/README.md index 860c6eb..da8ff3b 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,24 @@ ![markdownlint](https://img.shields.io/github/actions/workflow/status/CelticBoozer/nvim-config/markdownlint.yaml?branch=master&label=markdownlint) ![cspell](https://img.shields.io/github/actions/workflow/status/CelticBoozer/nvim-config/cspell.yaml?branch=master&label=cspell) -## External dependencies +**Welcome to my Neovim configuration repository!** This config is designed as a +universal, extensible IDE setup for web and DevOps development. It emphasizes +modular Lua-based plugin configurations and best practices (e.g., one plugin per +file, LSP integration, and consistent style conventions). +## 🚀 Setup Instructions + +1. **Install Neovim** (version >= 0.8) on your system. +2. **Clone this repo** into your config directory: + +```bash +git clone https://github.com/CelticBoozer/nvim-config.git ~/.config/nvim +``` + +3. Install plugin manager (lazy.nvim) will automatically setup on first launch. +4. Open Neovim and let it install plugins. +5. Install external dependencies listed below. + |External Dependency | Plugins | |--------------------|---------| | [git](https://git-scm.com/downloads) | [lazy.nvim](https://github.com/folke/lazy.nvim) [neogit](https://github.com/NeogitOrg/neogit) [mason.nvim](https://github.com/williamboman/mason.nvim) | @@ -22,3 +38,34 @@ | gzip | [mason.nvim](https://github.com/williamboman/mason.nvim) | | [rg](https://github.com/BurntSushi/ripgrep) | [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) [todo-comments.nvim](https://github.com/folke/todo-comments.nvim) | | [fd](https://github.com/sharkdp/fd) | [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) | + +## 🌟 Features + +- Modular Plugin Setup: Each plugin config is in its own Lua file (e.g., +lua/plugin/git/git.lua), promoting clarity and easy updates. +- LSP & Treesitter: Built-in support for many languages via Mason, lspconfig, +and Treesitter. +- Completion & Snippets: Autocompletion with nvim-cmp and Luasnip. +- Statusline & Icons: Beautiful statusline (lualine) and file icons +(nvim-web-devicons) with auto color adaptation. +- Git Integration: Lazy-loaded Git plugins (e.g., lazygit) for in-editor +version control. +- Theming: Gruvbox Material colorscheme with UI tweaks, plus dynamic icon +coloring. +- Quickkey Hints: which-key integration for discovering keybindings. + +## 📚 Usage Examples + +- Open Telescope file search: ff +- Toggle NvimTree: te +- Git status (lazygit): gg +- LSP actions: aa for code actions, tl for diagnostics, etc. +- Color preview: Hex color codes will display actual colors via nvim-colorizer.lua +when opening relevant files. + +[PLACE IMAGE HERE] – (e.g., screenshot of Neovim with this config) + +## ⭐ Stay Updated + +If you find this configuration helpful, consider starring the repo! Feedback +and suggestions are always appreciated. diff --git a/init.lua b/init.lua index 8d2e8d9..5eaedbc 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,5 @@ --- init.lua +-- NOTE: Core initialization file for Neovim configuration. Requires and sets up modules. require("core.options") - --- Bootstrap and setup lazy.nvim through its own plugin spec require("core.lazy") -- Safe telescope extension loading diff --git a/lazy-lock.json b/lazy-lock.json index 7c7e578..ab480d3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,6 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "auto-session": { "branch": "main", "commit": "00334ee24b9a05001ad50221c8daffbeedaa0842" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -9,64 +10,67 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "code_runner.nvim": { "branch": "main", "commit": "ca64b5bb70730fca03c57d8edee6623863f3fbcb" }, - "conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }, - "dashboard-nvim": { "branch": "master", "commit": "000448d837f6e7a47f8f342f29526c4d7e49e9ce" }, + "code_runner.nvim": { "branch": "main", "commit": "b1f2e70bf9824ca1b7aa9478c71ec19f5984ecef" }, + "conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" }, + "dashboard-nvim": { "branch": "master", "commit": "591b5b29e2f17b97496ec3179f6ecd08bb8502cc" }, "decisive.nvim": { "branch": "main", "commit": "ead9188df6411a52d8859552b8332cb864d22171" }, - "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "fine-cmdline.nvim": { "branch": "main", "commit": "aec9efebf6f4606a5204d49ffa3ce2eeb7e08a3e" }, "garbage-day.nvim": { "branch": "main", "commit": "750ef08ae6031ee3683014c5349144340c08ead6" }, - "gruvbox-material": { "branch": "master", "commit": "146f40fd42cbef30fed69b4ef51329aeeaceb909" }, + "gitsigns.nvim": { "branch": "main", "commit": "8dec8da8ed8a4463cc6abcd3cc3801373600767d" }, + "gruvbox-material": { "branch": "master", "commit": "f5f912fbc7cf2d45da6928b792d554f85c7aa89a" }, "inc-rename.nvim": { "branch": "main", "commit": "87ebe7bee0b83d3b6e4f1494c74abed21b318175" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazygit.nvim": { "branch": "main", "commit": "b9eae3badab982e71abab96d3ee1d258f0c07961" }, "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, - "lsp_signature.nvim": { "branch": "master", "commit": "15bb33cdb47e85278e168cad11acb1b6fa9c6488" }, + "lsp_signature.nvim": { "branch": "master", "commit": "a793d02b6a5e639fa9d3f2a89a839fa688ab2d0a" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lspsaga.nvim": { "branch": "main", "commit": "778d56ff9b387dacd14ae648ed5604394b486f51" }, - "lualine.nvim": { "branch": "master", "commit": "86fe39534b7da729a1ac56c0466e76f2c663dc42" }, + "lspsaga.nvim": { "branch": "main", "commit": "920b1253e1a26732e53fac78412f6da7f674671d" }, + "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, - "neogit": { "branch": "master", "commit": "97f83f1dc51dee41e08e3c7a8adf00e1083e3178" }, - "neotest": { "branch": "master", "commit": "747775fc22dfeb6102bdde6559ccb5126dac0ff8" }, + "neotest": { "branch": "master", "commit": "6267dcd577aa519c828d2526b05844770d3a2c6a" }, "neotest-bash": { "branch": "main", "commit": "57eab5b80a5296dc3fc5b22112b3ed78da3a5732" }, "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, "neotest-rust": { "branch": "main", "commit": "e1cb22ecf0341fb894ef2ebde344389fe6e6fc8e" }, - "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, + "nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "7aade9e99bef5f0735cf966e715b3ce45515d786" }, - "nvim-dap-ui": { "branch": "master", "commit": "881a69e25bd6658864fab47450025490b74be878" }, + "nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" }, + "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, - "nvim-lint": { "branch": "master", "commit": "5b1bdf306bd3e565908145279e8bbfc594dac3b3" }, - "nvim-lspconfig": { "branch": "master", "commit": "3a7387a9c980304059b2bd7075684d6ef98ff331" }, + "nvim-lint": { "branch": "master", "commit": "9dfb77ef6c5092a19502883c02dc5a02ec648729" }, + "nvim-lspconfig": { "branch": "master", "commit": "2e3f389aa06c7b7c29600ec2e67ee64c332077eb" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" }, - "nvim-surround": { "branch": "main", "commit": "caf6f633d4d77a29b6e265b560c5a035d171a913" }, - "nvim-tree.lua": { "branch": "master", "commit": "5bea2b37523a31288e0fcab42f3be5c1bd4516bb" }, - "nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" }, + "nvim-surround": { "branch": "main", "commit": "0e62500b98f4513feaaf7425c135472457ea5b7d" }, + "nvim-tree.lua": { "branch": "master", "commit": "582ae48c9e43d2bcd55dfcc8e2e7a1f29065d924" }, + "nvim-treesitter": { "branch": "master", "commit": "3b308861a8d7d7bfbe9be51d52e54dcfd9fe3d38" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-ufo": { "branch": "main", "commit": "a026364df62e88037b26d37c9f14c17c006fd577" }, - "nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" }, + "nvim-ufo": { "branch": "main", "commit": "cac999ec9f6302d2fd4ad8a846bf8f731af6e7cf" }, + "nvim-web-devicons": { "branch": "master", "commit": "50b5b06bff13a9b4eab946de7c7033649a6618a1" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "c921526c23fe94e3da5132fea5ca9ee3c3068a90" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "55ad4fb76ab68460f700599b7449385f0c4e858e" }, "reactive.nvim": { "branch": "master", "commit": "e0a22a42811ca1e7aa7531f931c55619aad68b5d" }, - "render-markdown.nvim": { "branch": "main", "commit": "8355c85e4a34c2071fb9c78295aedf877116648b" }, + "render-markdown.nvim": { "branch": "main", "commit": "7f81e9dcc15504c044f20df39d28a590cd5c6ca5" }, "search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" }, "sqls.nvim": { "branch": "main", "commit": "d1bc5421ef3e8edc5101e37edbb7de6639207a09" }, - "statuscol.nvim": { "branch": "main", "commit": "c399884e8f64019ec9bb581251f9710915b7f996" }, + "statuscol.nvim": { "branch": "main", "commit": "a2580e009a3b4c51b5978768d907dafae2c919ac" }, + "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, "telescope-docker.nvim": { "branch": "main", "commit": "4219840291d9e3e64f6b8eefa11e8deb14357581" }, "telescope-media-files.nvim": { "branch": "master", "commit": "0826c7a730bc4d36068f7c85cf4c5b3fd9fb570a" }, "telescope-undo.nvim": { "branch": "main", "commit": "928d0c2dc9606e01e2cc547196f48d2eaecf58e5" }, "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "51f548421f8a74680eff27d283c9d5ea6e8d0074" }, - "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "220cba7596cc2ff95c251d3173b26eaf9924ec10" }, + "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "cd401038de4cbae37651cfe02510294ccf5cdc98" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, + "virt-column.nvim": { "branch": "master", "commit": "b87e3e0864211a32724a2ebf3be37e24e9e2fa99" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/lua/core/lazy.lua b/lua/core/lazy.lua index 465bb55..8af10d5 100644 --- a/lua/core/lazy.lua +++ b/lua/core/lazy.lua @@ -2,6 +2,7 @@ -- NOTE: Essential foundation for plugin management. Handles installation, updates, and lazy loading. 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({ @@ -22,6 +23,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then os.exit(1) end end + vim.opt.rtp:prepend(lazypath) -- Setup lazy.nvim @@ -31,7 +33,6 @@ require("lazy").setup({ { import = "plugin.completion" }, { import = "plugin.dap" }, { import = "plugin.editor" }, - { import = "plugin.git" }, { import = "plugin.lsp" }, { import = "plugin.syntax" }, { import = "plugin.testing" }, diff --git a/lua/core/options.lua b/lua/core/options.lua index 458cb66..61fecb2 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -1,6 +1,8 @@ +-- INFO: Editor and UI settings for Neovim +-- NOTE: Configure line numbers, indentation, splits, and more. local o = vim.opt --- Set lines enable +-- Set line numbering o.number = true o.relativenumber = true @@ -13,10 +15,10 @@ o.smartindent = true -- Save changes automatically o.autowriteall = true --- Enable cursor higlighting +-- Enable cursor highlighting o.cursorline = true --- Search ingroing case +-- Search ignoring case o.ignorecase = true -- Split rules diff --git a/lua/plugin/colors/colorscheme.lua b/lua/plugin/colors/colorscheme.lua index d16384d..dbba401 100644 --- a/lua/plugin/colors/colorscheme.lua +++ b/lua/plugin/colors/colorscheme.lua @@ -23,10 +23,8 @@ return { for option, value in pairs(opts) do vim.g["gruvbox_material_" .. option] = value end - -- Set colorscheme vim.cmd.colorscheme("gruvbox-material") - -- Custom float window styling vim.api.nvim_set_hl(0, "NormalFloat", { fg = "#d4be98" }) vim.api.nvim_set_hl(0, "FloatBorder", { fg = "#d4be98" }) diff --git a/lua/plugin/completion/cmp-dotenv.lua b/lua/plugin/completion/cmp-dotenv.lua deleted file mode 100644 index 22ce6b9..0000000 --- a/lua/plugin/completion/cmp-dotenv.lua +++ /dev/null @@ -1,8 +0,0 @@ --- INFO: .env file completions --- NOTE: Provides environment variable suggestions for .env files - -return { - "SergioRibera/cmp-dotenv", - dependencies = { "hrsh7th/nvim-cmp" }, - config = function() end, -} diff --git a/lua/plugin/completion/cmp.lua b/lua/plugin/completion/cmp.lua index bb89a9a..8141dd4 100644 --- a/lua/plugin/completion/cmp.lua +++ b/lua/plugin/completion/cmp.lua @@ -1,5 +1,5 @@ --- INFO: .env file completions --- NOTE: Provides environment variable suggestions for .env files +-- INFO: Autocompletion configuration using nvim-cmp with integrations for LSP, snippets, and other completion sources. +-- NOTE: This configuration integrates nvim-autopairs, custom formatting, and provides experimental ghost text. return { "hrsh7th/nvim-cmp", @@ -13,10 +13,12 @@ return { "saadparwaiz1/cmp_luasnip", "onsails/lspkind.nvim", "windwp/nvim-autopairs", - "SergioRibera/cmp-dotenv", -- add dotenv plugin as dependency + "SergioRibera/cmp-dotenv", }, config = function() local cmp = require("cmp") + + -- Initialize autopairs integration for automatic closing. require("nvim-autopairs").setup() cmp.event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done()) @@ -31,8 +33,8 @@ return { { name = "nvim_lsp" }, { name = "luasnip" }, { name = "buffer" }, - -- You can comment out the global dotenv source if you want it only in .env files: { name = "dotenv" }, + { name = "supermaven" }, }, formatting = { format = require("lspkind").cmp_format({ @@ -50,14 +52,5 @@ return { }, }, }) - - -- Optional: if you want dotenv completions only for .env files, you can remove it from the - -- global sources list above and add it here: - -- - -- cmp.setup.filetype("env", { - -- sources = { - -- { name = "dotenv" }, - -- }, - -- }) end, } diff --git a/lua/plugin/dap/dap-ui.lua b/lua/plugin/dap/dap-ui.lua index 4707e1d..78c10c9 100644 --- a/lua/plugin/dap/dap-ui.lua +++ b/lua/plugin/dap/dap-ui.lua @@ -1,5 +1,5 @@ -- INFO: Debug Adapter Protocol UI with interactive elements --- NOTE: Provides visual debugging interface with variable inspection and REPL +-- NOTE: Provides visual debugging interface with variable inspection and REPL. return { "rcarriga/nvim-dap-ui", @@ -22,13 +22,6 @@ return { desc = "Evaluate expression", mode = { "n", "v" }, }, - { - "db", - function() - require("dap").toggle_breakpoint() - end, - desc = "Toggle breakpoint", - }, }, opts = { icons = { @@ -48,10 +41,7 @@ return { position = "left", }, { - elements = { - "repl", - "console", - }, + elements = { "repl", "console" }, size = 0.25, position = "bottom", }, diff --git a/lua/plugin/dap/dap.lua b/lua/plugin/dap/dap.lua index fac5048..1c27332 100644 --- a/lua/plugin/dap/dap.lua +++ b/lua/plugin/dap/dap.lua @@ -1,5 +1,5 @@ --- INFO: Configures nvim-dap --- NOTE: 'mfussenegger/nvim-dap' provides the core Debug Adapter Protocol client for Neovim +-- INFO: Configures nvim-dap with IntelliJ IDEA-like key mappings. +-- NOTE: 'mfussenegger/nvim-dap' provides the core Debug Adapter Protocol client for Neovim. return { "mfussenegger/nvim-dap", @@ -11,63 +11,50 @@ return { }, keys = { { - "", + "", function() require("dap").continue() end, desc = "Start/Continue Debugging", }, { - "", + "", function() require("dap").step_over() end, desc = "Step Over", }, { - "", + "", function() require("dap").step_into() end, desc = "Step Into", }, { - "", + "", function() require("dap").step_out() end, desc = "Step Out", }, { - "b", + "", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint", }, { - "B", + "", function() - require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) + require("dap").eval() end, - desc = "Set Conditional Breakpoint", + desc = "Evaluate Expression", + mode = { "n", "v" }, }, { - "lp", - function() - require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) - end, - desc = "Set Log Point", - }, - { - "dr", - function() - require("dap").repl.open() - end, - desc = "Open REPL", - }, - { - "dl", + "", function() require("dap").run_last() end, diff --git a/lua/plugin/editor/autopairs.lua b/lua/plugin/editor/autopairs.lua index 2f22718..657ae96 100644 --- a/lua/plugin/editor/autopairs.lua +++ b/lua/plugin/editor/autopairs.lua @@ -1,18 +1,20 @@ -- INFO: Automatic bracket/parenthesis completion --- NOTE: Smart pair management with LSP/cmp integration +-- NOTE: Smart pair management with LSP/cmp integration. return { "windwp/nvim-autopairs", event = "InsertEnter", - dependencies = { "hrsh7th/nvim-cmp" }, + dependencies = { + "hrsh7th/nvim-cmp", + }, opts = { - check_ts = true, -- Use treesitter to check pairs + check_ts = true, disable_filetype = { "TelescopePrompt", "spectre_panel" }, ignored_next_char = "[%w%.]", -- Don't pair if next char is alphanumeric or dot fast_wrap = { - map = "", -- Alt+e to jump between pairs - offset = -1, -- Offset from pair start + map = "", + offset = -1, }, - map_cr = false, -- Disable Enter key pairing + map_cr = false, }, } diff --git a/lua/plugin/editor/comment.lua b/lua/plugin/editor/comment.lua index 05783d0..043062a 100644 --- a/lua/plugin/editor/comment.lua +++ b/lua/plugin/editor/comment.lua @@ -1,5 +1,5 @@ -- INFO: Smart comment toggling with context awareness --- NOTE: Supports language-specific comment styles +-- NOTE: Supports language-specific comment styles. return { "numToStr/Comment.nvim", @@ -9,25 +9,23 @@ return { "JoosepAlviste/nvim-ts-context-commentstring", }, config = function() - -- First ensure treesitter is initialized + -- INFO: Initialize Treesitter and context-aware commentstring integration. require("nvim-treesitter.configs").setup({}) - - -- Then setup context commentstring require("ts_context_commentstring").setup({}) - -- Finally configure Comment.nvim + -- INFO: Configure Comment.nvim with a pre-hook for context-aware commenting. require("Comment").setup({ pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), toggler = { - line = "cc", - block = "bc", + line = "cc", -- Toggle line comment + block = "cb", -- Toggle block comment }, opleader = { - line = "c", - block = "b", + line = "cc", -- Operator-pending line comment + block = "cb", -- Operator-pending block comment }, extra = { - eol = "cA", + eol = "cA", -- Comment at the end of line }, }) end, diff --git a/lua/plugin/editor/indent-blankline.lua b/lua/plugin/editor/indent-blankline.lua index 6b6d0d7..fb0c956 100644 --- a/lua/plugin/editor/indent-blankline.lua +++ b/lua/plugin/editor/indent-blankline.lua @@ -1,5 +1,5 @@ -- INFO: Visual indentation guides (v3+) --- NOTE: Modern indentation visualization with treesitter +-- NOTE: Modern indentation visualization with treesitter. return { "lukas-reineke/indent-blankline.nvim", diff --git a/lua/plugin/editor/surround.lua b/lua/plugin/editor/surround.lua index 7adc006..db0286f 100644 --- a/lua/plugin/editor/surround.lua +++ b/lua/plugin/editor/surround.lua @@ -1,5 +1,5 @@ -- INFO: Easily add, delete, or change surroundings in Neovim --- NOTE: Inspired by tpope/vim-surround, written in Lua +-- NOTE: Inspired by tpope/vim-surround, written in Lua. return { "kylechui/nvim-surround", diff --git a/lua/plugin/editor/virt-column.lua b/lua/plugin/editor/virt-column.lua new file mode 100644 index 0000000..4a82716 --- /dev/null +++ b/lua/plugin/editor/virt-column.lua @@ -0,0 +1,11 @@ +-- INFO: Visualize guides at multiple specific text widths +-- NOTE: Provides a visual guide at specific column widths + +return { + "lukas-reineke/virt-column.nvim", + event = "BufReadPost", + opts = { + char = "▕", + virtcolumn = "80,100,120", -- draw rulers at columns 80, 100, and 120 + }, +} diff --git a/lua/plugin/git/neogit.lua b/lua/plugin/git/neogit.lua deleted file mode 100644 index b888e9d..0000000 --- a/lua/plugin/git/neogit.lua +++ /dev/null @@ -1,83 +0,0 @@ --- INFO: Provides an interactive Git interface within Neovim, inspired by Magit. --- NOTE: Enhances Git operations directly from Neovim without leaving the editor. - -return { - "NeogitOrg/neogit", - lazy = false, - cmd = { "Neogit" }, - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - keys = { - { "gg", "Neogit", desc = "Open Neogit" }, - }, - - opts = { - disable_hint = false, - disable_context_highlighting = false, - disable_signs = false, - prompt_force_push = true, - disable_insert_on_commit = "auto", - filewatcher = { - interval = 1000, - enabled = true, - }, - graph_style = "kitty", - use_default_keymaps = true, - auto_refresh = true, - kind = "floating", - disable_line_numbers = true, - disable_relative_line_numbers = true, - console_timeout = 2000, - auto_show_console = true, - auto_close_console = true, - notification_icon = "", - status = { - show_head_commit_hash = true, - recent_commit_count = 10, - HEAD_padding = 10, - HEAD_folded = false, - mode_padding = 3, - mode_text = { - M = "modified", - N = "new file", - A = "added", - D = "deleted", - C = "copied", - U = "updated", - R = "renamed", - DD = "unmerged", - AU = "unmerged", - UD = "unmerged", - }, - }, - integrations = { - diffview = true, - }, - highlight = { - italic = true, - bold = true, - underline = true, - }, - remember_settings = true, - use_per_project_settings = true, - ignored_settings = { - "NeogitPushPopup--force-with-lease", - "NeogitPushPopup--force", - "NeogitPullPopup--rebase", - "NeogitCommitPopup--allow-empty", - "NeogitRevertPopup--no-edit", - }, - git_services = { - ["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", - ["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1", - ["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", - ["azure.com"] = "https://dev.azure.com/${owner}/_git/${repository}/pullrequestcreate?sourceRef=${branch_name}&targetRef=${target}", - }, - telescope_sorter = function() - return require("telescope").extensions.fzf.native_fzf_sorter() - end, - }, -} diff --git a/lua/plugin/lsp/conform.lua b/lua/plugin/lsp/conform.lua index 63850da..a162d36 100644 --- a/lua/plugin/lsp/conform.lua +++ b/lua/plugin/lsp/conform.lua @@ -1,5 +1,5 @@ -- INFO: Unified file formatting interface --- NOTE: Handles code formatting through LSP and external tools +-- NOTE: Handles code formatting through LSP and external tools. return { "stevearc/conform.nvim", @@ -7,7 +7,7 @@ return { event = { "BufReadPre", "BufNewFile", "BufWrite" }, keys = { { - "lf", + "rf", function() require("conform").format({ lsp_fallback = true, diff --git a/lua/plugin/lsp/inc-rename.lua b/lua/plugin/lsp/inc-rename.lua index aa86363..b206712 100644 --- a/lua/plugin/lsp/inc-rename.lua +++ b/lua/plugin/lsp/inc-rename.lua @@ -1,5 +1,5 @@ -- INFO: Interactive LSP rename with live preview --- NOTE: Provides real-time renaming previews +-- NOTE: Provides real-time renaming previews. return { "smjonas/inc-rename.nvim", diff --git a/lua/plugin/lsp/lint.lua b/lua/plugin/lsp/lint.lua index a9dc7ff..2ab4a90 100644 --- a/lua/plugin/lsp/lint.lua +++ b/lua/plugin/lsp/lint.lua @@ -1,18 +1,9 @@ -- INFO: Asynchronous linting integration --- NOTE: Provides real-time code analysis for various languages +-- NOTE: Provides real-time code analysis for various languages. return { "mfussenegger/nvim-lint", event = "VeryLazy", - keys = { - { - "ll", - function() - require("lint").try_lint() - end, - desc = "Lint file", - }, - }, opts = { linters_by_ft = { python = { "ruff" }, @@ -35,18 +26,20 @@ return { config = function(_, opts) local lint = require("lint") - -- Configure linters + -- Configure linters for each filetype lint.linters_by_ft = opts.linters_by_ft - for name, config in pairs(opts.linters or {}) do - lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name] or {}, config) + + -- Extend existing linter configurations if 'opts.linters' is provided + for name, conf in pairs(opts.linters or {}) do + lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name] or {}, conf) end - -- Setup automatic linting + -- Setup automatic linting on buffer write and insert leave vim.api.nvim_create_autocmd({ "BufWritePost", "InsertLeave" }, { + group = vim.api.nvim_create_augroup("nvim-lint", { clear = true }), callback = function() lint.try_lint() end, - group = vim.api.nvim_create_augroup("nvim-lint", { clear = true }), }) end, } diff --git a/lua/plugin/lsp/lsp_signature.lua b/lua/plugin/lsp/lsp_signature.lua index 6a27eae..834c1da 100644 --- a/lua/plugin/lsp/lsp_signature.lua +++ b/lua/plugin/lsp/lsp_signature.lua @@ -1,5 +1,5 @@ -- INFO: Interactive function signature help during typing --- NOTE: Displays parameter information and documentation +-- NOTE: Displays parameter information and documentation. return { "ray-x/lsp_signature.nvim", @@ -8,7 +8,7 @@ return { "neovim/nvim-lspconfig", }, opts = { - hint_prefix = "󰛩 ", -- Custom hint indicator - extra_trigger_chars = { "(", ",", "<" }, -- Added angle bracket + hint_prefix = "󰛩 ", + extra_trigger_chars = { "(", ",", "<" }, }, } diff --git a/lua/plugin/lsp/lspconfig.lua b/lua/plugin/lsp/lspconfig.lua index b245492..f404d4b 100644 --- a/lua/plugin/lsp/lspconfig.lua +++ b/lua/plugin/lsp/lspconfig.lua @@ -1,5 +1,5 @@ -- INFO: Core LSP configuration and integrations --- NOTE: Provides language-aware features and server management +-- NOTE: Provides language-aware features and server management. return { "neovim/nvim-lspconfig", @@ -10,12 +10,12 @@ return { }, opts = { capabilities = function() - local caps = require("cmp_nvim_lsp").default_capabilities() - caps.textDocument.foldingRange = { + local capabilities = require("cmp_nvim_lsp").default_capabilities() + capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true, } - return caps + return capabilities end, signs = { @@ -53,20 +53,20 @@ return { }, }, config = function(_, opts) - -- Configure diagnostic signs + -- INFO: Configure diagnostic signs using the specified icons. for type, icon in pairs(opts.signs) do local hl = "DiagnosticSign" .. type vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) end - -- Configure LSP servers + -- INFO: Configure LSP servers with capabilities and custom settings. local lspconfig = require("lspconfig") local capabilities = opts.capabilities() - for server, config in pairs(opts.servers) do + for server, server_opts in pairs(opts.servers) do lspconfig[server].setup(vim.tbl_deep_extend("force", { capabilities = capabilities, - }, config)) + }, server_opts)) end end, } diff --git a/lua/plugin/lsp/lspsaga.lua b/lua/plugin/lsp/lspsaga.lua index 6c9d8fc..e7e5516 100644 --- a/lua/plugin/lsp/lspsaga.lua +++ b/lua/plugin/lsp/lspsaga.lua @@ -1,5 +1,5 @@ -- INFO: Enhanced LSP UI with interactive features --- NOTE: Provides IDE-like interactions for code navigation and diagnostics +-- NOTE: Provides IDE-like interactions for code navigation and diagnostics. return { "nvimdev/lspsaga.nvim", @@ -9,23 +9,78 @@ return { "nvim-lua/plenary.nvim", }, keys = { - { "gd", "Lspsaga peek_definition", desc = "Peek definition", mode = "n" }, - { "gD", "Lspsaga goto_definition", desc = "Goto definition", mode = "n" }, - { "gy", "Lspsaga peek_type_definition", desc = "Peek type definition", mode = "n" }, - { "gY", "Lspsaga goto_type_definition", desc = "Goto type definition", mode = "n" }, - { "aa", "Lspsaga code_action", desc = "Code action", mode = { "n", "v" } }, - { "]d", "Lspsaga diagnostic_jump_next", desc = "Next diagnostic", mode = "n" }, - { "[d", "Lspsaga diagnostic_jump_prev", desc = "Prev diagnostic", mode = "n" }, - { "fr", "Lspsaga finder", desc = "References finder", mode = "n" }, - { "tl", "Lspsaga show_buf_diagnostics ++normal", desc = "File diagnostics", mode = "n" }, + { + "gd", + "Lspsaga peek_definition", + desc = "Peek definition", + mode = "n", + }, + { + "gD", + "Lspsaga goto_definition", + desc = "Goto definition", + mode = "n", + }, + { + "gy", + "Lspsaga peek_type_definition", + desc = "Peek type definition", + mode = "n", + }, + { + "gY", + "Lspsaga goto_type_definition", + desc = "Goto type definition", + mode = "n", + }, + { + "aa", + "Lspsaga code_action", + desc = "Code action", + mode = { "n", "v" }, + }, + { + "]d", + "Lspsaga diagnostic_jump_next", + desc = "Next diagnostic", + mode = "n", + }, + { + "[d", + "Lspsaga diagnostic_jump_prev", + desc = "Prev diagnostic", + mode = "n", + }, + { + "fr", + "Lspsaga finder", + desc = "References finder", + mode = "n", + }, + { + "tl", + "Lspsaga show_buf_diagnostics ++normal", + desc = "File diagnostics", + mode = "n", + }, { "tL", "Lspsaga show_workspace_diagnostics ++normal", desc = "Workspace diagnostics", mode = "n", }, - { "?", "Lspsaga hover_doc", desc = "Hover documentation", mode = "n" }, - { "to", "Lspsaga outline", desc = "Symbols outline", mode = "n" }, + { + "?", + "Lspsaga hover_doc", + desc = "Hover documentation", + mode = "n", + }, + { + "to", + "Lspsaga outline", + desc = "Outline", + mode = "n", + }, }, opts = { ui = { diff --git a/lua/plugin/lsp/mason.lua b/lua/plugin/lsp/mason.lua index f5812fd..0e6f165 100644 --- a/lua/plugin/lsp/mason.lua +++ b/lua/plugin/lsp/mason.lua @@ -1,5 +1,5 @@ -- INFO: LSP/DAP/linter/formatter package manager --- NOTE: Centralized dependency management for development tools +-- NOTE: Centralized dependency management for development tools. return { "williamboman/mason.nvim", @@ -23,10 +23,10 @@ return { max_concurrent_installers = 4, }, config = function(_, opts) - -- Setup Mason core + -- Setup Mason core with UI and installation settings require("mason").setup(opts) - -- Setup LSP config + -- Configure Mason LSPconfig to ensure necessary LSP servers are installed automatically require("mason-lspconfig").setup({ ensure_installed = { "pylsp", @@ -49,20 +49,23 @@ return { automatic_installation = true, }) - -- Setup tools installer + -- Configure Mason Tool Installer to manage external development tools require("mason-tool-installer").setup({ ensure_installed = { - "luacheck", + -- Linters + "ruff", + "checkstyle", + "cspell", + "eslint_d", "hadolint", - "shellcheck", "jsonlint", - "yamllint", - "eslint_d", - "stylelint", - "checkstyle", - "sqlfluff", + "luacheck", "markdownlint", - "cspell", + "shellcheck", + "sqlfluff", + "stylelint", + "yamllint", + -- Formatters "stylua", "shfmt", "yamlfmt", @@ -70,6 +73,7 @@ return { "google-java-format", "sql-formatter", "xmlformatter", + -- DAP Tools "firefox-debug-adapter", "debugpy", "bash-debug-adapter", diff --git a/lua/plugin/lsp/sqls.lua b/lua/plugin/lsp/sqls.lua index acdad6d..732d80f 100644 --- a/lua/plugin/lsp/sqls.lua +++ b/lua/plugin/lsp/sqls.lua @@ -1,10 +1,12 @@ -- INFO: SQL language support via LSP --- NOTE: Requires Neovim 0.10+ and the sqls language server +-- NOTE: Requires Neovim 0.10+ and the sqls language server. return { "nanotee/sqls.nvim", ft = { "sql" }, - dependencies = { "neovim/nvim-lspconfig" }, + dependencies = { + "neovim/nvim-lspconfig", + }, config = function() local lspconfig = require("lspconfig") local sqls = require("sqls") diff --git a/lua/plugin/lsp/tiny-inline-diagnostic.lua b/lua/plugin/lsp/tiny-inline-diagnostic.lua index e7e8f25..802a3b2 100644 --- a/lua/plugin/lsp/tiny-inline-diagnostic.lua +++ b/lua/plugin/lsp/tiny-inline-diagnostic.lua @@ -1,15 +1,15 @@ -- INFO: Minimal inline LSP diagnostic display --- NOTE: Shows diagnostics at end of line without virtual text +-- NOTE: Shows diagnostics at end of line without virtual text. return { "rachartier/tiny-inline-diagnostic.nvim", event = "VeryLazy", dependencies = { - "neovim/nvim-lspconfig" + "neovim/nvim-lspconfig", }, opts = { - enable_virtual_text = true, -- Show diagnostic message after error symbol - delay = 300, -- ms delay after cursor movement - enable_auto = true -- Automatically show diagnostics - } + enable_virtual_text = true, + delay = 300, + enable_auto = true, + }, } diff --git a/lua/plugin/syntax/rainbow-delimiters.lua b/lua/plugin/syntax/rainbow-delimiters.lua index 710daa6..e73b427 100644 --- a/lua/plugin/syntax/rainbow-delimiters.lua +++ b/lua/plugin/syntax/rainbow-delimiters.lua @@ -1,8 +1,8 @@ -- INFO: Syntax-aware delimiter highlighting -- NOTE: Context-aware bracket/quote colorization + return { "hiphish/rainbow-delimiters.nvim", - event = "VeryLazy", dependencies = { "nvim-treesitter/nvim-treesitter", }, diff --git a/lua/plugin/ui/gitsigns.lua b/lua/plugin/ui/gitsigns.lua new file mode 100644 index 0000000..1aa8d7f --- /dev/null +++ b/lua/plugin/ui/gitsigns.lua @@ -0,0 +1,24 @@ +-- INFO: Git indicators in the gutter +-- NOTE: Provides git diff information in the gutter. + +return { + "lewis6991/gitsigns.nvim", + event = "BufReadPost", + opts = { + signs = { + add = { text = "│" }, + change = { text = "│" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, + on_attach = function(bufnr) + local gs = require("gitsigns") + vim.keymap.set("n", "hs", gs.stage_hunk, { buffer = bufnr, desc = "Stage hunk" }) + vim.keymap.set("n", "hu", gs.undo_stage_hunk, { buffer = bufnr, desc = "Undo stage hunk" }) + vim.keymap.set("n", "hr", gs.reset_hunk, { buffer = bufnr, desc = "Reset hunk" }) + vim.keymap.set("n", "hR", gs.reset_buffer, { buffer = bufnr, desc = "Reset buffer" }) + vim.keymap.set("n", "hp", gs.preview_hunk, { buffer = bufnr, desc = "Preview hunk" }) + end, + }, +} diff --git a/lua/plugin/ui/lualine.lua b/lua/plugin/ui/lualine.lua index 079a93b..a2f1770 100644 --- a/lua/plugin/ui/lualine.lua +++ b/lua/plugin/ui/lualine.lua @@ -3,7 +3,6 @@ return { "nvim-lualine/lualine.nvim", - event = "VeryLazy", dependencies = { "nvim-tree/nvim-web-devicons", { diff --git a/lua/plugin/ui/ufo.lua b/lua/plugin/ui/ufo.lua index 4fb1425..9fb1f33 100644 --- a/lua/plugin/ui/ufo.lua +++ b/lua/plugin/ui/ufo.lua @@ -49,10 +49,20 @@ return { end, }, config = function(_, opts) + -- Workaround for auto-session conflict: + vim.api.nvim_create_autocmd("BufReadPost", { + callback = function() + if not pcall(require, "ufo") then + vim.notify("nvim-ufo failed to load", vim.log.levels.WARN) + return + end + require("ufo").setup(opts) + end, + }) + -- Configure LSP folding capabilities - -- UFO folding - vim.o.foldcolumn = "1" -- '0' is not bad - vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value + vim.o.foldcolumn = "1" + vim.o.foldlevel = 99 vim.o.foldlevelstart = 99 vim.o.foldenable = true vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] @@ -60,15 +70,12 @@ return { -- Link custom highlight group vim.api.nvim_set_hl(0, "UfoFoldedEllipsis", { link = "Comment" }) - -- Initialize UFO with merged options - require("ufo").setup(opts) - -- Key mappings for folding vim.keymap.set("n", "zE", require("ufo").openAllFolds) vim.keymap.set("n", "zC", require("ufo").closeAllFolds) vim.keymap.set("n", "ze", require("ufo").openFoldsExceptKinds) vim.keymap.set("n", "zc", function() - require("ufo").closeFoldsWith(1) -- Close only immediate fold + require("ufo").closeFoldsWith(1) end, { desc = "Close current fold" }) end, } diff --git a/lua/plugin/util/auto-session.lua b/lua/plugin/util/auto-session.lua new file mode 100644 index 0000000..a59b8cd --- /dev/null +++ b/lua/plugin/util/auto-session.lua @@ -0,0 +1,35 @@ +-- INFO: Session management with automatic save and restore +-- NOTE: Ensures session persistence across restarts and integrates with Telescope + +return { + "rmagatti/auto-session", + lazy = false, + dependencies = { + "nvim-telescope/telescope.nvim", + }, + keys = { + { "sl", "Telescope session-lens search_session", desc = "Search sessions" }, + { "ss", "SessionSave", desc = "Save session" }, + { "sr", "SessionRestore", desc = "Restore session" }, + { "sd", "SessionDelete", desc = "Delete session" }, + }, + config = function() + require("auto-session").setup({ + log_level = "info", + auto_session_enable_last_session = false, + auto_save = true, + auto_restore = true, + show_auto_restore_notif = true, + session_lens = { + load_on_setup = true, + mappings = { + delete_session = { "n", "d" }, + }, + }, + }) + + vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" + + require("telescope").load_extension("session-lens") + end, +} diff --git a/lua/plugin/util/decisive.lua b/lua/plugin/util/decisive.lua index 7e050fd..f6b2971 100644 --- a/lua/plugin/util/decisive.lua +++ b/lua/plugin/util/decisive.lua @@ -8,14 +8,14 @@ return { dependencies = {}, keys = { { - "cca", + "csv", ":lua require('decisive').align_csv({})", { silent = true }, desc = "Align CSV", mode = "n", }, { - "ccA", + "csvc", ":lua require('decisive').align_csv_clear({})", { silent = true }, desc = "Align CSV clear", diff --git a/lua/plugin/util/lazygit.lua b/lua/plugin/util/lazygit.lua new file mode 100644 index 0000000..9c6357c --- /dev/null +++ b/lua/plugin/util/lazygit.lua @@ -0,0 +1,20 @@ +-- INFO: lazygit is a git client for neovim. +-- NOTE: Plugin needs original lazygit to work. + +return { + "kdheepak/lazygit.nvim", + lazy = true, + dependencies = { + "nvim-lua/plenary.nvim", + }, + keys = { + { "tg", "LazyGit", desc = "LazyGit" }, + }, + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, +} diff --git a/lua/plugin/util/project.lua b/lua/plugin/util/project.lua new file mode 100644 index 0000000..d663be7 --- /dev/null +++ b/lua/plugin/util/project.lua @@ -0,0 +1,55 @@ +-- INFO: Project management with telescope +-- NOTE: Provides project detection and management + +return { + "ahmedkhalf/project.nvim", + event = "VimEnter", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", + }, + config = function() + require("project_nvim").setup({ + detection_methods = { "pattern", "lsp" }, + + -- Project patterns to detect (defaults to common VCS roots) + patterns = { + ".git", + "package.json", + "Cargo.toml", + "Makefile", + "*.sln", + "pyproject.toml", + }, + + -- Ignore directories (e.g., build folders) + ignore_lsp = { "null-ls", "efm" }, + exclude_dirs = { "**/node_modules/**", "**/.build/**", "**/target/**" }, + + -- Show hidden files in telescope + show_hidden = false, + + -- Manual mode (don't auto-detect projects) + manual_mode = false, + + -- Telescope theme configuration + telescope = { + theme = "dropdown", + previewer = false, + layout_config = { + width = 0.3, + height = 0.4, + }, + }, + + -- Session management integration + silent_chdir = true, + datapath = vim.fn.stdpath("data"), + }) + + vim.keymap.set("n", "sp", function() + vim.cmd("SessionSave") + require("project_nvim").add_project() + end, { desc = "Save session and add project" }) + end, +} diff --git a/lua/plugin/util/reactive.lua b/lua/plugin/util/reactive.lua index 05c155e..cf0bb85 100644 --- a/lua/plugin/util/reactive.lua +++ b/lua/plugin/util/reactive.lua @@ -19,7 +19,6 @@ return { }, }, modes = { - -- this does not work when whichkey is enabled no = { operators = { [{ "gu", "gU", "g~", "~" }] = { diff --git a/lua/plugin/util/search.lua b/lua/plugin/util/search.lua index 58d198a..7a1ca88 100644 --- a/lua/plugin/util/search.lua +++ b/lua/plugin/util/search.lua @@ -43,6 +43,12 @@ return { require("telescope").extensions.media_files.media_files() end, }, + { + name = "Projects", + tele_func = function() + require("telescope").extensions.projects.projects() + end, + }, { name = "Docker", tele_func = function() diff --git a/lua/plugin/util/supermaven.lua b/lua/plugin/util/supermaven.lua new file mode 100644 index 0000000..860e7de --- /dev/null +++ b/lua/plugin/util/supermaven.lua @@ -0,0 +1,23 @@ +-- INFO:Plugin that provides a highly customizable code suggestion engine. +-- NOTE: Uses LSP to provide code suggestions. + +return { + "supermaven-inc/supermaven-nvim", + config = function() + require("supermaven-nvim").setup({ + keymaps = { + accept_suggestion = "", + clear_suggestion = "", + accept_word = "", + }, + color = { + suggestion_color = "#7daea3", + cterm = 244, + }, + log_level = "info", + condition = function() + return false + end, + }) + end, +} diff --git a/lua/plugin/util/telescope.lua b/lua/plugin/util/telescope.lua index 4c63d46..508a611 100644 --- a/lua/plugin/util/telescope.lua +++ b/lua/plugin/util/telescope.lua @@ -12,21 +12,8 @@ return { }, opts = { defaults = { - mappings = { - i = { - [""] = require("telescope.actions").which_key, - [""] = require("telescope.actions").select_vertical, - [""] = require("telescope.actions").select_horizontal, - }, - n = { - s = require("telescope.actions").select_vertical, - S = require("telescope.actions").select_horizontal, - t = require("telescope.actions").select_tab, - }, - }, layout_strategy = "horizontal", layout_config = { - preview_width = 0.6, width = 0.95, height = 0.85, }, diff --git a/lua/plugin/util/which-key.lua b/lua/plugin/util/which-key.lua index ac581a4..ba233ff 100644 --- a/lua/plugin/util/which-key.lua +++ b/lua/plugin/util/which-key.lua @@ -1,9 +1,9 @@ -- INFO: Keybinding discovery and documentation -- NOTE: Provides visual hints for leader key mappings --- luacheck: globals vim return { "folke/which-key.nvim", + lazy = false, keys = { { "", @@ -35,11 +35,11 @@ return { wk.register({ [""] = { f = { name = "Find" }, + t = { name = "Tool panels" }, d = { name = "Debug" }, - g = { name = "Git" }, - l = { name = "LSP" }, - s = { name = "Search" }, - w = { name = "Workspace" }, + s = { name = "Session" }, + c = { name = "Comment" }, + r = { name = "Refactor" }, }, }) end,