From a099706d1bade4aec6ae822e98fd0669db69a504 Mon Sep 17 00:00:00 2001 From: Daniel Nehrig Date: Mon, 6 Jan 2025 08:03:32 +0100 Subject: [PATCH] Major upgrade (#25) * testing phase * feat(stuff): more lazy load stuff * feat(stuff): which key spec update * fix(bug): au group deletion * feat(format): add auto format toggle * fix(minor): change stuff * fix: surround plugin * fix: gitsigns preview hunk * chore(style): apply stylua format * chore(ci): ubuntu * feat: remove deprecated surround.nvim with mini.surround * fix: fixed the style of the dashboard * fix: header padding * update: themes * update: themeing stuff * update: use mini autopairs; add gpt func; add markdown style * fix: delete unused configs; make class types unique in naming * fix: double mappings * fix: commented gc/gcc binds * fix: readme gramma * fix: termhl * feat: add smear for ui swag * chore: update nvim.log speed Signed-off-by: Daniel Nehrig * feat: fix broken ts features textsubject and object * fix: capabilities bug * feat: add ts context * feat: adding some plugins and ai key adjustment - Mintty plugin added - Timer plugin added - Added configurable openai key * fix: chatgpt config * chore: fix formatting Signed-off-by: Daniel Nehrig * chore: remove print Signed-off-by: Daniel Nehrig * chore: remove error when outside colorschemes are loaded Signed-off-by: Daniel Nehrig --------- Signed-off-by: Daniel Nehrig --- .github/workflows/lint.yml | 2 +- Readme.md | 3 +- ftplugin/java.lua | 3 +- lazy-lock.json | 53 +- lua/config/core/autocmd.lua | 33 +- lua/config/core/config.type.lua | 31 +- lua/config/core/default_config.lua | 7 +- lua/config/core/global.lua | 2 +- lua/config/core/mappings.lua | 117 +---- lua/config/core/options.lua | 20 +- lua/config/load_config.lua | 2 - lua/config/plugins/configs/autopairs/init.lua | 22 - lua/config/plugins/configs/dap/init.lua | 19 + lua/config/plugins/configs/dashboard/init.lua | 85 --- .../plugins/configs/indent-blankline/init.lua | 37 -- .../configs/lspconfig/efm/scalafmt.lua | 6 +- .../plugins/configs/lspconfig/servers/efm.lua | 4 +- .../configs/lspconfig/servers/java.lua | 3 +- .../configs/lspconfig/servers/kotlin.lua | 3 +- lua/config/plugins/configs/nvimux/init.lua | 19 - .../plugins/configs/treesitter/init.lua | 26 +- lua/config/plugins/configs/which/init.lua | 102 ++-- lua/config/plugins/modules/completion.lua | 43 +- lua/config/plugins/modules/debug.lua | 7 +- lua/config/plugins/modules/git.lua | 84 ++- lua/config/plugins/modules/language.lua | 11 - lua/config/plugins/modules/lsp.lua | 58 +- lua/config/plugins/modules/navigation.lua | 6 +- lua/config/plugins/modules/themes.lua | 45 +- lua/config/plugins/modules/treesitter.lua | 65 +-- lua/config/plugins/modules/utility.lua | 494 +++++++++++++++--- lua/config/themes/hl/catppuccin.lua | 73 +++ lua/config/themes/hl/github_dark_default.lua | 25 +- lua/config/themes/hl/github_light.lua | 28 +- lua/config/themes/hl/radium.lua | 6 +- lua/config/themes/hl/tokyonight.lua | 14 +- lua/config/themes/hl/types.lua | 10 +- lua/config/themes/hl/vscode_dark.lua | 14 +- lua/config/themes/init.lua | 7 +- lua/config/themes/integrations/cmp.lua | 37 +- .../themes/integrations/codeactionsmenu.lua | 16 + lua/config/themes/integrations/dap.lua | 48 ++ lua/config/themes/theme_setup.lua | 15 +- lua/config/themes/ts.lua | 380 -------------- lua/config/utils/init.lua | 2 +- neoconf.json | 0 neovim.cat | 18 +- nvim.log | 239 ++++----- 48 files changed, 1142 insertions(+), 1202 deletions(-) delete mode 100644 lua/config/plugins/configs/autopairs/init.lua delete mode 100644 lua/config/plugins/configs/indent-blankline/init.lua delete mode 100644 lua/config/plugins/configs/nvimux/init.lua create mode 100644 lua/config/themes/hl/catppuccin.lua create mode 100644 lua/config/themes/integrations/codeactionsmenu.lua create mode 100644 lua/config/themes/integrations/dap.lua delete mode 100644 lua/config/themes/ts.lua create mode 100644 neoconf.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 40b90f53..339348f0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,7 +10,7 @@ on: jobs: lint: name: Luacheck - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: Setup diff --git a/Readme.md b/Readme.md index 7a8e7958..ef646e97 100644 --- a/Readme.md +++ b/Readme.md @@ -211,7 +211,8 @@ see `mappings.lua` for more info _you are probably better of using these since they are community driven I'm the sole maintainer of this config_ - Lvim -- nvchad and module suite +- LazyVim +- nvchad UI style - Theme based solution - If the theme modules wouldn't be strictly written for nvchad I would have used their module - base16 diff --git a/ftplugin/java.lua b/ftplugin/java.lua index d609e96b..6ee449ed 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -1,7 +1,8 @@ require("config.plugins.configs.dap.attach").init() local global = require("config.core.global") local build_path_string = require("config.utils").build_path_string -local capabilities = require("config.plugins.configs.lspconfig").capabilities +local capabilities = + require("config.plugins.configs.lspconfig.capabilities").capabilities local lsp = require("config.plugins.configs.lspconfig") local map = vim.keymap.set diff --git a/lazy-lock.json b/lazy-lock.json index bd31bfbe..b9eae3f0 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,9 +1,8 @@ { - "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "ChatGPT.nvim": { "branch": "main", "commit": "5b6d296eefc75331e2ff9f0adcffbd7d27862dd6" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, "aurora": { "branch": "master", "commit": "af3e80a8ca4f9a6e3bd40e2ba12073c1d0041a81" }, - "barbar.nvim": { "branch": "master", "commit": "a26bae6c51899db530de19ce3c2f4307e37a869e" }, + "barbar.nvim": { "branch": "master", "commit": "40c176c9af7e9aefe3af9ec9d985a3edb50d66a3" }, "better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" }, "bionic.nvim": { "branch": "main", "commit": "3523383b6db41046a3d813ac65dd57e78e61babb" }, "block.nvim": { "branch": "main", "commit": "6fb969ab12579e58b9379aa51933cad4a466cf75" }, @@ -16,67 +15,67 @@ "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, "commented.nvim": { "branch": "master", "commit": "be322c5ef455800984705cee97490a5450f072bc" }, "copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" }, - "crates.nvim": { "branch": "main", "commit": "8bf8358ee326d5d8c11dcd7ac0bcc9ff97dbc785" }, + "crates.nvim": { "branch": "main", "commit": "bd35b13e94a292ee6e32c351e05ca2202dc9f070" }, + "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" }, + "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "git-conflict.nvim": { "branch": "main", "commit": "a1badcd070d176172940eb55d9d59029dad1c5a6" }, "github-nvim-theme": { "branch": "main", "commit": "24c8706c9ad26b944f5a76dea999dca8708f252e" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "gruvqueen": { "branch": "master", "commit": "b79ed8b2bcc26e04fb7586f95a1e5d7a600e9cf8" }, - "hlargs.nvim": { "branch": "main", "commit": "023021a330956eecf54e1015ecba55900d284365" }, - "hlchunk.nvim": { "branch": "main", "commit": "5465dd33ade8676d63f6e8493252283060cd72ca" }, - "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, + "hlargs.nvim": { "branch": "main", "commit": "a5a7fdacc0ac2f7ca9d241e0e059cb85f0e733bc" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazygit.nvim": { "branch": "main", "commit": "77a0d42943d8265271e6e6beaed72da54eeb17e7" }, - "lightspeed.nvim": { "branch": "main", "commit": "fcc72d8a4d5f4ebba62d8a3a0660f88f1b5c3b05" }, - "live-server.nvim": { "branch": "main", "commit": "5fc8abb727827a09d0ce1b7757d0a4c7b5802b09" }, "lsp-lens.nvim": { "branch": "main", "commit": "48bb1a7e271424c15f3d588d54adc9b7c319d977" }, "lsp-status.nvim": { "branch": "master", "commit": "54f48eb5017632d81d0fd40112065f1d062d0629" }, "lspkind-nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "material.nvim": { "branch": "main", "commit": "c8ff153d2c2b22f8b2c9bcce0d741ab55c00cfed" }, + "mini.icons": { "branch": "main", "commit": "6787321f70d674a481776b7cc2c781fb7002c644" }, + "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, + "mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" }, + "minty": { "branch": "main", "commit": "6dce9f097667862537823d515a0250ce58faab05" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, - "neoconf.nvim": { "branch": "main", "commit": "daf26750632a8056511412d44d4f9f1240408828" }, + "neoconf.nvim": { "branch": "main", "commit": "1e6c856d062b92ef201b35e0a4fc798331750118" }, "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "neogen": { "branch": "main", "commit": "dd0301bfba1f83a3bc009b5430fce7aa3cee6941" }, "neogit": { "branch": "master", "commit": "9ea60f79e370d8f4847efc145e53afe4b0613fc1" }, - "neotest": { "branch": "master", "commit": "0dccb5ebcf00de245e2060fa17822a9464f5c41a" }, + "neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" }, "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, "neotest-rust": { "branch": "main", "commit": "e1cb22ecf0341fb894ef2ebde344389fe6e6fc8e" }, "no-neck-pain.nvim": { "branch": "main", "commit": "2a786bf7130cce20449885fb799f3c7f4ce93595" }, "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, - "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, "nvim-bqf": { "branch": "main", "commit": "68d3c20f6bee49105dcfde3df1f7ec972529f2a3" }, "nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" }, "nvim-cmp-lua-latex-symbols": { "branch": "master", "commit": "0050e236dbebe12de35ecdc646fc1d9a6b0dbb29" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" }, - "nvim-dap": { "branch": "master", "commit": "ffb077e65259f13be096ea6d603e3575a76b214a" }, + "nvim-dap": { "branch": "master", "commit": "0e673accbb512e1e191dfb4fecea89cc38c1bcdd" }, "nvim-dap-python": { "branch": "master", "commit": "34282820bb713b9a5fdb120ae8dd85c2b3f49b51" }, "nvim-dap-ui": { "branch": "master", "commit": "e94d98649dccb6a3884b66aabc2e07beb279e535" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" }, - "nvim-jdtls": { "branch": "master", "commit": "8f14aa1922ee5491ded1079a6576fae834535658" }, - "nvim-lspconfig": { "branch": "master", "commit": "8b15a1a597a59f4f5306fad9adfe99454feab743" }, + "nvim-jdtls": { "branch": "master", "commit": "266d0cb912bbe61d66b43c5e73db19a364380360" }, + "nvim-lspconfig": { "branch": "master", "commit": "a8ef5e6e497b3ebeaaf35b939c07c211563b2e05" }, "nvim-metals": { "branch": "main", "commit": "e6b02c99161b43c67cfe1d6e5f9a9b9a0bb4701c" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, - "nvim-notify": { "branch": "master", "commit": "c3797193536711b5d8983975791c4b11dc35ab3a" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-notify": { "branch": "master", "commit": "bd9cd51f9ef2f6326fc2bc9931d0718c1794e247" }, "nvim-pqf": { "branch": "main", "commit": "148ee2ca8b06d83fd9bf6f9b9497724ad39a07d6" }, "nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" }, - "nvim-treesitter": { "branch": "master", "commit": "4b222913486ec0a5983efa82b0649a2ab87cf1f0" }, + "nvim-treesitter": { "branch": "master", "commit": "6935286b4ee3d938954e446d657eebee71b4d07a" }, + "nvim-treesitter-context": { "branch": "master", "commit": "2bcf700b59bc92850ca83a1c02e86ba832e0fae0" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" }, "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ufo": { "branch": "main", "commit": "32cb247b893a384f1888b9cd737264159ecf183c" }, - "nvim-web-devicons": { "branch": "master", "commit": "4adeeaa7a32d46cf3b5833341358c797304f950a" }, + "nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" }, "nvim-yati": { "branch": "main", "commit": "df3dc06076c6fe20a1dcd8643e712af5c252d042" }, - "nvimux": { "branch": "master", "commit": "a2cd0cab0acf6c37d999e0cfd199a9fa126a8dcf" }, "one-small-step-for-vimkind": { "branch": "main", "commit": "5d2edc8937978585881d97a8fec4c2903fa4d72c" }, "orgmode.nvim": { "branch": "master", "commit": "bf657742f7cb56211f99946ff64f5f87d7d7f0d0" }, - "overseer.nvim": { "branch": "master", "commit": "10ee48ff96c8d1049efb278ea4c8cf9f3b0e4326" }, + "overseer.nvim": { "branch": "master", "commit": "8de110400643a02aeddf266b772a05f63db2e625" }, "package-info.nvim": { "branch": "master", "commit": "3de4f3569ce60e248707df042b72769b3ec343b8" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, @@ -84,19 +83,22 @@ "preview-swagger.nvim": { "branch": "master", "commit": "b2685918a51478e0c5d4790571e58188aa288512" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" }, + "render-markdown.nvim": { "branch": "main", "commit": "1faa6568eb61467d64c3d0aad8ac4c9c0e45514e" }, "rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" }, "satellite.nvim": { "branch": "main", "commit": "bce591cb5e379bd989623993c604c774633e7ed9" }, + "smear-cursor.nvim": { "branch": "main", "commit": "051fe67e0081da273e07cd33ab8357d6b720f08f" }, + "snacks.nvim": { "branch": "main", "commit": "d312053f78b4fb55523def179ac502438dd93193" }, "sniprun": { "branch": "master", "commit": "67ac2d84d03f3b857d59571ff5fefb6080dffa2d" }, - "sonokai": { "branch": "master", "commit": "1d7ca954792dfddd9e73c53563d85adaeb8c8437" }, + "sonokai": { "branch": "master", "commit": "0df1462da40e1473a61b80b7ce62497e0b59ff86" }, "stabilize.nvim": { "branch": "master", "commit": "eeb1873daffaba67246188a5668b366e45ed1de1" }, "suda.vim": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" }, - "surround.nvim": { "branch": "master", "commit": "36c253d6470910692491b13382f54c9bab2811e1" }, "tabout.nvim": { "branch": "master", "commit": "9a3499480a8e53dcaa665e2836f287e3b7764009" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, "telescope-project.nvim": { "branch": "master", "commit": "1d7920e799fc5001dffc7bd10909a86e0358eaf4" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, + "timerly": { "branch": "main", "commit": "fa7c53a106b481bd58af5b766c566dc4507f1e65" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" }, "treesj": { "branch": "main", "commit": "94f6df623f2d15630b1b617abff39962024cb501" }, @@ -104,10 +106,9 @@ "urlview.nvim": { "branch": "main", "commit": "c07733179e27c225ac3c58c3951701ee10b2dbde" }, "vgit.nvim": { "branch": "main", "commit": "9afe79a3ae65594ca483c2e6161690ff9b85123b" }, "vim-fugitive": { "branch": "master", "commit": "174230d6a7f2df94705a7ffd8d5413e27ec10a80" }, - "vim-grammarous": { "branch": "master", "commit": "db46357465ce587d5325e816235b5e92415f8c05" }, "vim-matchup": { "branch": "master", "commit": "aca23ce53ebfe34e02c4fe07e29e9133a2026481" }, "vim-slash": { "branch": "master", "commit": "31aee09b7ea8893a18fa34f65e63e364fc998444" }, - "vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" }, + "volt": { "branch": "main", "commit": "b7582c8e2ab3a411a72ab058251ba22d24e70f4a" }, "vscode.nvim": { "branch": "main", "commit": "18097b7aa47538afa780c821309c8b992972d726" }, "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" }, "windline.nvim": { "branch": "master", "commit": "bef735787bef64697036774eca6418e7a786100b" }, diff --git a/lua/config/core/autocmd.lua b/lua/config/core/autocmd.lua index b6886b74..0205d7a3 100644 --- a/lua/config/core/autocmd.lua +++ b/lua/config/core/autocmd.lua @@ -1,18 +1,9 @@ -local Func = require("config.utils") local M = {} function M.autocmds() - local au_utils = vim.api.nvim_create_augroup("utils", { clear = true }) local au_ft = vim.api.nvim_create_augroup("ft", { clear = true }) local au_cmp = vim.api.nvim_create_augroup("cmp", { clear = true }) - -- util - vim.api.nvim_create_autocmd("CursorHold", { - callback = function() - Func.open_diag_float() - end, - group = au_utils, - }) -- ft vim.api.nvim_create_autocmd("FileType", { pattern = "markdown,org,txt,tex", @@ -40,7 +31,10 @@ function M.autocmds() local client = vim.lsp.get_client_by_id(args.data.client_id) if client then if client.supports_method("textDocument/documentHighlight") then - local au_lsp = vim.api.nvim_create_augroup("LSPDocumentHighlight", {}) + local au_lsp = vim.api.nvim_create_augroup( + "LSPDocumentHighlight", + { clear = true } + ) vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { buffer = bufnr, @@ -56,25 +50,6 @@ function M.autocmds() }) end end - - end, - }) - - vim.api.nvim_create_autocmd("LspDetach", { - group = "LSP_Highlight", - callback = function(args) - if not (args.data and args.data.client_id) then - return - end - - local client = vim.lsp.get_client_by_id(args.data.client_id) - -- fixes the case where we do not create augroups when documentHighlight is not supported - -- so we check if the client supports it before deleting the augroup to align with the logic in LspAttach - if client then - if client.supports_method("textDocument/documentHighlight") then - vim.api.nvim_del_augroup_by_name("LSPDocumentHighlight") - end - end end, }) diff --git a/lua/config/core/config.type.lua b/lua/config/core/config.type.lua index 06a67ea6..9190e5e1 100644 --- a/lua/config/core/config.type.lua +++ b/lua/config/core/config.type.lua @@ -1,30 +1,35 @@ ---@meta ----@class Ui ----@field changed_themes table a list of themes that have been changed ----@field logo string the dashboard logo (info the path your logo string will append to is the neovim config path) ----@field transparent boolean A toggle to make everything transparent ----@field colorscheme Colorscheme the colorscheme config ----@field statusline Statusline the statusline config ----@field hl_override table a table of highlights to override +---@class ConfigUi +---@field changed_themes? table a list of themes that have been changed +---@field logo? string the dashboard logo (info the path your logo string will append to is the neovim config path) +---@field transparent? boolean A toggle to make everything transparent +---@field colorscheme? ConfigColorscheme the colorscheme config +---@field statusline? ConfigStatusline the statusline config +---@field hl_override? table a table of highlights to override ----@class Colorscheme +---@class ConfigColorscheme ---@field name ColorschemeNames the name of the colorscheme --- the names of the colorschemes to toggle between (nice for light/dark themes) ---@field toggle ColorschemeNames[] ----@class Statusline +---@class ConfigStatusline ---@field name StatuslineThemes the name of the statusline theme ---the name of the seperator styles left and right side length = 2 ---@field separator SeperatorStyle[] ----@class Plugins +---@class ConfigPlugins ---@field user table plugins you want to add ---@field remove string[] plugins you want to remove from the default list see modules folder ----@class Config ----@field ui Ui the ui config ----@field plugins Plugins the plugin config +---@class ConfigSetup +---@field ui ConfigUi the ui config +---@field plugins ConfigPlugins the plugin config ---@field mappings MapModes the mapping config +---@field ai_options? ConfigAi the ai config + +---@class ConfigAi +---@field openai_key? string +---@field copilot_key? string ---@alias StatuslineThemes ---| '"slanted_lsp"' diff --git a/lua/config/core/default_config.lua b/lua/config/core/default_config.lua index 9a132bff..370b0291 100644 --- a/lua/config/core/default_config.lua +++ b/lua/config/core/default_config.lua @@ -1,6 +1,6 @@ ---@module 'config.core.config.type' ----@type Config +---@class ConfigSetup local default_config = {} default_config.ui = { @@ -49,4 +49,9 @@ default_config.plugins = { }, } +default_config.ai_options = { + openai_key = nil, + copilot_key = nil, +} + return default_config diff --git a/lua/config/core/global.lua b/lua/config/core/global.lua index 797879e5..8f097f30 100644 --- a/lua/config/core/global.lua +++ b/lua/config/core/global.lua @@ -8,7 +8,7 @@ local home = function() return os.getenv("USERPROFILE") --[[@as string]] end - return os.getenv("HOME") --[[@as string]] + return os.getenv("HOME") --[[@as string]] end ---@class Global diff --git a/lua/config/core/mappings.lua b/lua/config/core/mappings.lua index 94f9558b..e31314e2 100644 --- a/lua/config/core/mappings.lua +++ b/lua/config/core/mappings.lua @@ -9,6 +9,7 @@ ---@field [1] string key binding ---@field [2] string|fun() command ---@field [3] MapOptions options for the mapping +---@field [4] string|nil type snack ---@class MapOptions ---@field noremap? boolean @@ -89,7 +90,6 @@ M.others = { { desc = "GitLinker" }, }, { "gt", "Trouble", { desc = "Trouble LSP" } }, - { "nf", "DocGen", { desc = "DocGen" } }, { "w", "WindowPick", { desc = "WindowPick" } }, }, v = { @@ -223,50 +223,6 @@ M.util = { require("config.core.options").fold_column_toggle, { desc = "Toggle Fold", silent = true }, }, - { - "ud", - vim.diagnostic.disable, - { desc = "Toggle Diagnostic 0", silent = true }, - }, - { - "ut", - vim.diagnostic.enable, - { desc = "Toggle Diagnostic 1", silent = true }, - }, - - { - "ur", - require("config.core.options").relative_position_toggle, - { - desc = "Toggle Relative", - silent = true, - }, - }, - - { - "un", - require("config.core.options").number_toggle, - { - desc = "Toggle Numbers", - silent = true, - }, - }, - { - "us", - require("config.core.options").spell_toggle, - { - desc = "Toggle Spell", - silent = true, - }, - }, - { - "ux", - require("config.core.options").toggle_signcolumn, - { - desc = "Toggle Signcolumn", - silent = true, - }, - }, }, } @@ -289,41 +245,6 @@ M.diag = { }, } -M.gram = { - n = { - { - "ggf", - "(grammarous-fixall)", - { desc = "Grammer Fix All", silent = false }, - }, - { - "ggo", - "(grammarous-open-info-window)", - { desc = "Grammer Open", silent = false }, - }, - { - "ggn", - "(grammarous-move-to-next-error)", - { desc = "Grammer Go Next", silent = false }, - }, - { - "ggp", - "(grammarous-move-to-previous-error)", - { desc = "Grammer Go Prev", silent = false }, - }, - { - "ggi", - "(grammarous-fixit)", - { desc = "Grammer Fix It", silent = false }, - }, - { - "ggc", - "GrammarousCheck", - { desc = "Grammer Check", silent = false }, - }, - }, -} - M.run = { v = { { @@ -374,7 +295,6 @@ M.map = { M.util, M.tree, M.diag, - M.gram, } M.vscode_file = { @@ -434,12 +354,12 @@ function M.set_lsp_mapping(bufnr) { "gw", vim.lsp.buf.document_symbol, - { desc = "Doc Symb", buffer = bufnr }, + { desc = "Doc Symbol", buffer = bufnr }, }, { "gW", vim.lsp.buf.workspace_symbol, - { desc = "Workspace Symbok", buffer = bufnr }, + { desc = "Workspace Symbol", buffer = bufnr }, }, { "gf", @@ -449,12 +369,7 @@ function M.set_lsp_mapping(bufnr) { "gl", vim.lsp.codelens.run, - { desc = "Code Action", buffer = bufnr }, - }, - { - "gf", - vim.lsp.buf.code_action, - { desc = "Code Action", buffer = bufnr }, + { desc = "Code Lens", buffer = bufnr }, }, { "gr", @@ -483,6 +398,22 @@ function M.set_lsp_mapping(bufnr) "lua vim.diagnostic.open_float({focusable = false, border = 'single', source = 'if_many' })", { desc = "Diagnostic Float", buffer = bufnr }, }, + { + "uP", + function() + return Snacks.toggle({ + name = "Auto Format (Global)", + get = function() + return vim.g.autoformat + end, + set = function(state) + vim.g.autoformat = state + end, + }) + end, + { desc = "Toggle Auto Format" }, + "toggle", + }, { "ui", function() @@ -497,7 +428,13 @@ function M.set_lsp_mapping(bufnr) for mode, map in pairs(M.lsp) do for _, conf in ipairs(map) do if conf then - vim.keymap.set(mode, conf[1], conf[2], conf[3]) + if conf[4] then + if conf[4] == "toggle" then + conf[2]():map(conf[1]) + end + elseif conf[3] then + vim.keymap.set(mode, conf[1], conf[2], conf[3]) + end end end end diff --git a/lua/config/core/options.lua b/lua/config/core/options.lua index 843eeaef..e473e6a6 100644 --- a/lua/config/core/options.lua +++ b/lua/config/core/options.lua @@ -22,6 +22,7 @@ function _G.click_fold() end --- Toggle breakpoint on click +--- tag: debug function _G.click_num() local lnum_cursor = vim.fn.getmousepos().line local lnum_pos = vim.fn.getpos(".")[2] @@ -128,7 +129,7 @@ M.StatusColumn = { [[ ]], }, sign_column = { - [[%s]], + [[ %s]], }, folds = { [[%#FoldColumn#]], -- HL @@ -192,6 +193,7 @@ function M.load_options() }) g.mapleader = " " -- space leader + g.autoformat = true opt.hidden = true -- buffer hidden opt.ignorecase = true -- case sens ignore search @@ -268,22 +270,6 @@ M.fold_column_toggle = function() g.status_col_fold = not g.status_col_fold end ---- toggle the relative number from relative to absolute -M.relative_position_toggle = function() - wo.relativenumber = not wo.relativenumber -end - ---- toggle the number from relative to absolute -M.number_toggle = function() - wo.number = not wo.number - wo.relativenumber = wo.number -end - ---- toggle the spell check -M.spell_toggle = function() - wo.spell = not wo.spell -end - --- toggle the sign column M.toggle_signcolumn = function() o.signcolumn = o.signcolumn == "yes:1" and "no" or "yes:1" diff --git a/lua/config/load_config.lua b/lua/config/load_config.lua index 9e5b472f..76b82ea6 100644 --- a/lua/config/load_config.lua +++ b/lua/config/load_config.lua @@ -8,9 +8,7 @@ M.__index = M M.init = function() require("config.themes").load_theme() require("config.plugins.configs.web-devicons").init() - require("config.plugins.configs.treesitter").init() require("config.plugins.configs.build").init() - require("config.plugins.configs.bufferline").init() end return M diff --git a/lua/config/plugins/configs/autopairs/init.lua b/lua/config/plugins/configs/autopairs/init.lua deleted file mode 100644 index 32f921f3..00000000 --- a/lua/config/plugins/configs/autopairs/init.lua +++ /dev/null @@ -1,22 +0,0 @@ -local M = {} - -function M.init() - local present1, autopairs = pcall(require, "nvim-autopairs") - local present2, cmp = pcall(require, "cmp") - - if not present1 and present2 then - return - end - - autopairs.setup({ - --check_ts = true, - fast_wrap = {}, - disable_filetype = { "TelescopePrompt", "vim" }, - }) - - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) -end - -return M diff --git a/lua/config/plugins/configs/dap/init.lua b/lua/config/plugins/configs/dap/init.lua index dcc675a4..3e19724d 100644 --- a/lua/config/plugins/configs/dap/init.lua +++ b/lua/config/plugins/configs/dap/init.lua @@ -200,6 +200,25 @@ dap.configurations.javascriptreact = { protocol = "inspector", }, } +dap.configurations.scala = { + { + type = "scala", + request = "launch", + name = "RunOrTest", + metals = { + runType = "runOrTestFile", + --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example + }, + }, + { + type = "scala", + request = "launch", + name = "Test Target", + metals = { + runType = "testTarget", + }, + }, +} dap.configurations.cpp = { { diff --git a/lua/config/plugins/configs/dashboard/init.lua b/lua/config/plugins/configs/dashboard/init.lua index b0cff191..e69de29b 100644 --- a/lua/config/plugins/configs/dashboard/init.lua +++ b/lua/config/plugins/configs/dashboard/init.lua @@ -1,85 +0,0 @@ ----@class Dashboard -local M = {} - -function M.dashboard() - local ok, alpha = pcall(require, "alpha") - if not ok then - return - end - - require("alpha.term") - local dashboard = require("alpha.themes.dashboard") - local global = require("config.core.global") - local config = require("config.core.config").config - local config_path = vim.fn.stdpath("config") - - -- Terminal header - if not global.is_windows then - dashboard.section.terminal.command = "cat | lolcat --seed=24 " - .. config_path - .. "/" - .. config.ui.logo - dashboard.section.terminal.width = 74 - dashboard.section.terminal.height = 11 - end - - local function button(sc, txt, keybind, keybind_opts) - local b = dashboard.button(sc, txt, keybind, keybind_opts) - b.opts.hl = "AlphaButtonText" - b.opts.hl_shortcut = "AlphaButtonShortcut" - return b - end - - dashboard.section.buttons.val = { - - -- " Load session", - -- 'lua require("persisted").load()' - -- ), - button("n", " New file", "ene startinsert "), - button("r", "󱔗 Recent files", "Telescope frecency"), - button( - "f", - " Find file", - "Telescope find_files hidden=true path_display=smart" - ), - button("p", " Projects", "Telescope project"), - button("u", " Update plugins", "Lazy sync"), - button("q", "󰩈 Quit Neovim", "qa!"), - } - dashboard.section.buttons.opts = { - spacing = 0, - } - - -- Footer - local function footer() - local total_plugins = require("lazy").stats().count - local version = vim.version() - - local nvim_version_info = "  Neovim v" - .. version.major - .. "." - .. version.minor - .. "." - .. version.patch - - return "󰣪 " .. total_plugins .. " plugins" .. nvim_version_info - end - dashboard.section.footer.val = footer() - dashboard.section.footer.opts.hl = "AlphaFooter" - - -- Layout - dashboard.config.layout = { - { type = "padding", val = 3 }, - dashboard.section.terminal, - { type = "padding", val = 13 }, - dashboard.section.buttons, - { type = "padding", val = 3 }, - dashboard.section.footer, - } - - dashboard.config.opts.noautocmd = true - - alpha.setup(dashboard.opts) -end - -return M diff --git a/lua/config/plugins/configs/indent-blankline/init.lua b/lua/config/plugins/configs/indent-blankline/init.lua deleted file mode 100644 index 2f5c1f7f..00000000 --- a/lua/config/plugins/configs/indent-blankline/init.lua +++ /dev/null @@ -1,37 +0,0 @@ ----@class Blankline -local M = {} - -function M.init() - local present, blank = pcall(require, "ibl") - if not present then - return - end - blank.setup({ - enabled = true, - scope = { - char = "▏", - }, - exclude = { - filetypes = { - "help", - "terminal", - "dashboard", - "alpha", - "lazy", - "NvimTree", - "packer", - "noice", - "notify", - "lspinfo", - "TelescopePrompt", - "OverseerForm", - "TelescopeResults", - "lsp-installer", - "", - }, - buftypes = { "terminal", "dashboard", "notify" }, - }, - }) -end - -return M diff --git a/lua/config/plugins/configs/lspconfig/efm/scalafmt.lua b/lua/config/plugins/configs/lspconfig/efm/scalafmt.lua index 63d3916a..c5742414 100644 --- a/lua/config/plugins/configs/lspconfig/efm/scalafmt.lua +++ b/lua/config/plugins/configs/lspconfig/efm/scalafmt.lua @@ -1,7 +1,7 @@ local fs = require("config.core.fs") -local formatter = 'scalafmt' -local args = '--stdin' -local command = string.format('%s %s', fs.executable(formatter), args) +local formatter = "scalafmt" +local args = "--stdin" +local command = string.format("%s %s", fs.executable(formatter), args) return { formatCanRange = true, diff --git a/lua/config/plugins/configs/lspconfig/servers/efm.lua b/lua/config/plugins/configs/lspconfig/servers/efm.lua index be326456..bf438261 100644 --- a/lua/config/plugins/configs/lspconfig/servers/efm.lua +++ b/lua/config/plugins/configs/lspconfig/servers/efm.lua @@ -30,7 +30,9 @@ lspconfig.efm.setup({ vim.api.nvim_create_autocmd("BufWritePre", { pattern = "*", callback = function() - vim.lsp.buf.format({ async = false, timeout_ms = 7000 }) + if vim.g.autoformat then + vim.lsp.buf.format({ async = false, timeout_ms = 7000 }) + end end, group = au_lsp, }) diff --git a/lua/config/plugins/configs/lspconfig/servers/java.lua b/lua/config/plugins/configs/lspconfig/servers/java.lua index 4dfaab59..a7626035 100644 --- a/lua/config/plugins/configs/lspconfig/servers/java.lua +++ b/lua/config/plugins/configs/lspconfig/servers/java.lua @@ -1,5 +1,6 @@ local lsp = require("config.plugins.configs.lspconfig") -local capabilities = require("config.plugins.configs.lspconfig").capabilities +local capabilities = + require("config.plugins.configs.lspconfig.capabilities").capabilities local lspconfig = require("lspconfig") local build_path_string = require("config.utils").build_path_string diff --git a/lua/config/plugins/configs/lspconfig/servers/kotlin.lua b/lua/config/plugins/configs/lspconfig/servers/kotlin.lua index 6aa8bbb2..82027ef0 100644 --- a/lua/config/plugins/configs/lspconfig/servers/kotlin.lua +++ b/lua/config/plugins/configs/lspconfig/servers/kotlin.lua @@ -1,5 +1,6 @@ local lsp = require("config.plugins.configs.lspconfig") -local capabilities = require("config.plugins.configs.lspconfig").capabilities +local capabilities = + require("config.plugins.configs.lspconfig.capabilities").capabilities local lspconfig = require("lspconfig") lspconfig.kotlin.setup({ diff --git a/lua/config/plugins/configs/nvimux/init.lua b/lua/config/plugins/configs/nvimux/init.lua deleted file mode 100644 index 3e0c7d39..00000000 --- a/lua/config/plugins/configs/nvimux/init.lua +++ /dev/null @@ -1,19 +0,0 @@ -local M = {} - -function M.init() - local present, nvimux = pcall(require, "nvimux") - if not present then - return - end - nvimux.setup({ - config = { - prefix = "", - }, - bindings = { - { { "n", "v", "i", "t" }, "s", nvimux.commands.horizontal_split }, - { { "n", "v", "i", "t" }, "v", nvimux.commands.vertical_split }, - }, - }) -end - -return M diff --git a/lua/config/plugins/configs/treesitter/init.lua b/lua/config/plugins/configs/treesitter/init.lua index e13014a4..4568e87e 100644 --- a/lua/config/plugins/configs/treesitter/init.lua +++ b/lua/config/plugins/configs/treesitter/init.lua @@ -8,19 +8,19 @@ function M.init() end local ensure_installed = { - "org", - "lua", - "rust", - "bash", - "javascript", - "typescript", - "jsdoc", - "html", - "json", - "markdown", - "markdown_inline", - "python", - } + "org", + "lua", + "rust", + "bash", + "javascript", + "typescript", + "jsdoc", + "html", + "json", + "markdown", + "markdown_inline", + "python", + } local global = require("config.core.global") if not global.is_windows then diff --git a/lua/config/plugins/configs/which/init.lua b/lua/config/plugins/configs/which/init.lua index 4adebdc2..9f608194 100644 --- a/lua/config/plugins/configs/which/init.lua +++ b/lua/config/plugins/configs/which/init.lua @@ -1,54 +1,60 @@ local M = {} M.init = function() - local present, which = pcall(require, "which-key") - - if not present then - return - end - - which.setup({}) - which.register({ - g = { - name = "Lsp and Grammar", - }, - f = { - name = "File", - }, - u = { - name = "Utils", - }, - d = { - name = "Debug", - }, - q = { - name = "QuickfixList", - }, - h = { - name = "Gitsigns", - }, - l = { - name = "LocList", - }, - m = { - name = "Make Test", - }, - o = { - name = "Orgmode", - }, - ["]"] = { - name = "TS Textobj", - }, - ["c"] = { - name = "Commented", - }, - t = { - name = "Tab Nav", - }, - b = { - name = "Build/Run/Test", - }, - }, { prefix = "" }) + require("which-key").add({ + { "c", group = "ChatGPT" }, + { + mode = { "n", "v" }, + { "cc", "ChatGPT", desc = "ChatGPT" }, + { + "ce", + "ChatGPTEditWithInstruction", + desc = "Edit with instruction", + }, + { + "cg", + "ChatGPTRun grammar_correction", + desc = "Grammar Correction", + }, + { "ct", "ChatGPTRun translate", desc = "Translate" }, + { "ck", "ChatGPTRun keywords", desc = "Keywords" }, + { "cd", "ChatGPTRun docstring", desc = "Docstring" }, + { "ca", "ChatGPTRun add_tests", desc = "Add Tests" }, + { + "co", + "ChatGPTRun optimize_code", + desc = "Optimize Code", + }, + { "cs", "ChatGPTRun summarize", desc = "Summarize" }, + { "cf", "ChatGPTRun fix_bugs", desc = "Fix Bugs" }, + { + "cx", + "ChatGPTRun explain_code", + desc = "Explain Code", + }, + { + "cr", + "ChatGPTRun roxygen_edit", + desc = "Roxygen Edit", + }, + { + "cl", + "ChatGPTRun code_readability_analysis", + desc = "Code Readability Analysis", + }, + }, + { "]", group = "TS Textobj" }, + { "b", group = "Build/Run/Test" }, + { "d", group = "Debug" }, + { "f", group = "File" }, + { "g", group = "Lsp and Grammar" }, + { "h", group = "Gitsigns" }, + { "l", group = "LocList" }, + { "o", group = "Orgmode" }, + { "q", group = "QuickfixList" }, + { "t", group = "Tab Nav" }, + { "u", group = "Utils" }, + }) end return M diff --git a/lua/config/plugins/modules/completion.lua b/lua/config/plugins/modules/completion.lua index 487be86a..593800d7 100644 --- a/lua/config/plugins/modules/completion.lua +++ b/lua/config/plugins/modules/completion.lua @@ -1,11 +1,45 @@ +local config = require("config.core.config").config ---@module 'lazy.types' ---@class completion ---@field completion table local M = {} M.completion = { + -- TODO: manage config of this by user cfg + ["jackMort/ChatGPT.nvim"] = { + event = "VeryLazy", + enabled = function() + if config.ai_options.openai_key == "" then + return false + end + if config.ai_options.openai_key == nil then + return false + end + + return true + end, + opts = { + api_key_cmd = config.ai_options.openai_key, + openai_params = { + model = "gpt-4-1106-preview", + frequency_penalty = 0, + presence_penalty = 0, + max_tokens = 4095, + temperature = 0.2, + top_p = 0.1, + n = 1, + }, + }, + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + }, + }, --- INFO: ai powered completion github - ["github/copilot.vim"] = {}, + ["github/copilot.vim"] = { + event = "VeryLazy", + }, --- INFO: completion plugin ["hrsh7th/nvim-cmp"] = { config = require("config.plugins.configs.cmp").init, @@ -18,11 +52,9 @@ M.completion = { "hrsh7th/cmp-buffer", "hrsh7th/cmp-cmdline", "hrsh7th/cmp-nvim-lsp-signature-help", + "danielnehrig/nvim-cmp-lua-latex-symbols", }, }, - ["danielnehrig/nvim-cmp-lua-latex-symbols"] = { - dependencies = "hrsh7th/nvim-cmp", - }, ["kristijanhusak/orgmode.nvim"] = { config = function() require("orgmode").setup({ @@ -39,12 +71,13 @@ M.completion = { dependencies = { "rafamadriz/friendly-snippets" }, version = "2.*", build = "make install_jsregexp", + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, config = function() require("config.plugins.configs.cmp.luasnip").init() end, }, ["onsails/lspkind-nvim"] = { - dependencies = "hrsh7th/nvim-cmp", + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, config = function() require("lspkind").init({ mode = "symbol_text", diff --git a/lua/config/plugins/modules/debug.lua b/lua/config/plugins/modules/debug.lua index 9f525bda..508dae49 100644 --- a/lua/config/plugins/modules/debug.lua +++ b/lua/config/plugins/modules/debug.lua @@ -34,15 +34,17 @@ M.debug = { }) end, dependencies = { + "nvim-neotest/nvim-nio", "nvim-lua/plenary.nvim", "haydenmeade/neotest-jest", "rouge8/neotest-rust", "nvim-treesitter/nvim-treesitter", - "antoinemadec/FixCursorHold.nvim", }, }, --- INFO: lua neovim debug - ["jbyuki/one-small-step-for-vimkind"] = {}, + ["jbyuki/one-small-step-for-vimkind"] = { + lazy = true, + }, --- INFO: py debug ["mfussenegger/nvim-dap-python"] = { lazy = true, @@ -51,7 +53,6 @@ M.debug = { --- INFO: main debug plug dap ["mfussenegger/nvim-dap"] = { lazy = true, - dependencies = { "mfussenegger/nvim-dap" }, }, --- INFO: ui for dap ["rcarriga/nvim-dap-ui"] = { diff --git a/lua/config/plugins/modules/git.lua b/lua/config/plugins/modules/git.lua index 740faa1e..d5e8ade0 100644 --- a/lua/config/plugins/modules/git.lua +++ b/lua/config/plugins/modules/git.lua @@ -7,9 +7,82 @@ local M = {} M.git = { --- INFO: show git hunks and gutter ["lewis6991/gitsigns.nvim"] = { - event = { "BufRead", "BufNewFile" }, - config = require("config.plugins.configs.gitsigns").init, - dependencies = { "nvim-lua/plenary.nvim" }, + event = "VeryLazy", + opts = { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, + signs_staged = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + }, + current_line_blame = true, + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + on_attach = function(buffer) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, desc) + vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) + end + + -- stylua: ignore start + map("n", "]h", function() + if vim.wo.diff then + vim.cmd.normal({ "]c", bang = true }) + else + gs.nav_hunk("next") + end + end, "Next Hunk") + map("n", "[h", function() + if vim.wo.diff then + vim.cmd.normal({ "[c", bang = true }) + else + gs.nav_hunk("prev") + end + end, "Prev Hunk") + map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk") + map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk") + map({ "n", "v" }, "ghs", ":Gitsigns stage_hunk", "Stage Hunk") + map({ "n", "v" }, "ghr", ":Gitsigns reset_hunk", "Reset Hunk") + map("n", "ghS", gs.stage_buffer, "Stage Buffer") + map("n", "ghu", gs.undo_stage_hunk, "Undo Stage Hunk") + map("n", "ghR", gs.reset_buffer, "Reset Buffer") + map("n", "ghp", gs.preview_hunk, "Preview Hunk Inline") + map("n", "ghb", function() gs.blame_line({ full = true }) end, "Blame Line") + map("n", "ghB", function() gs.blame() end, "Blame Buffer") + map("n", "ghd", gs.diffthis, "Diff This") + map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") + map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") + end, + }, + }, + ["gitsigns.nvim"] = { + opts = function() + Snacks.toggle({ + name = "Git Signs", + get = function() + return require("gitsigns.config").config.signcolumn + end, + set = function(state) + require("gitsigns").toggle_signs(state) + end, + }):map("uG") + end, }, --- INFO: scrollbar and gutter/diagnostic display ["lewis6991/satellite.nvim"] = { @@ -59,9 +132,8 @@ M.git = { }, --- INFO: Show git conflicts ["akinsho/git-conflict.nvim"] = { - config = function() - require("git-conflict").setup({}) - end, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = {}, }, } return M diff --git a/lua/config/plugins/modules/language.lua b/lua/config/plugins/modules/language.lua index 113a2291..90fc1a98 100644 --- a/lua/config/plugins/modules/language.lua +++ b/lua/config/plugins/modules/language.lua @@ -8,17 +8,6 @@ vim.g.languagetool_server_jar = "/usr/local/opt/languagetool/libexec/languagetool-server.jar" M.language = { - --- INFO: live server - --- TODO: does this still work ? - ["barrett-ruth/live-server.nvim"] = { - build = "yarn global add live-server", - config = true, - }, - ["rhysd/vim-grammarous"] = { - cmd = { - "GrammarousCheck", - }, - }, --- INFO: java lsp stuff ["mfussenegger/nvim-jdtls"] = { lazy = true }, --- INFO: rust crates info for cargo toml diff --git a/lua/config/plugins/modules/lsp.lua b/lua/config/plugins/modules/lsp.lua index 04157d41..5dc1ee5b 100644 --- a/lua/config/plugins/modules/lsp.lua +++ b/lua/config/plugins/modules/lsp.lua @@ -7,20 +7,54 @@ local M = {} M.lsp = { --- INFO: lsp lens integration ["VidocqH/lsp-lens.nvim"] = { - config = function() - require("lsp-lens").setup({}) - end, + event = "VeryLazy", + opts = {}, }, ["scalameta/nvim-metals"] = { dependencies = { "nvim-lua/plenary.nvim", + { + "j-hui/fidget.nvim", + opts = {}, + }, + { + "mfussenegger/nvim-dap", + config = function(self, opts) + -- Debug settings if you're using nvim-dap + local dap = require("dap") + + dap.configurations.scala = { + { + type = "scala", + request = "launch", + name = "RunOrTest", + metals = { + runType = "runOrTestFile", + --args = { "firstArg", "secondArg", "thirdArg" }, -- here just as an example + }, + }, + { + type = "scala", + request = "launch", + name = "Test Target", + metals = { + runType = "testTarget", + }, + }, + } + end, + }, }, ft = { "scala", "sbt", "java" }, opts = function() local metals_config = require("metals").bare_config() metals_config.settings.serverVersion = "1.2.0" + local capabilities = + require("config.plugins.configs.lspconfig.capabilities").capabilities + metals_config.capabilities = capabilities local lsp = require("config.plugins.configs.lspconfig") metals_config.on_attach = function(client, bufnr) + require("metals").setup_dap() local n_present, navic = pcall(require, "nvim-navic") if n_present then if client.supports_method("textDocument/documentSymbol") then @@ -34,7 +68,8 @@ M.lsp = { return metals_config end, config = function(self, metals_config) - local nvim_metals_group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }) + local nvim_metals_group = + vim.api.nvim_create_augroup("nvim-metals", { clear = true }) vim.api.nvim_create_autocmd("FileType", { pattern = self.ft, callback = function() @@ -42,12 +77,12 @@ M.lsp = { end, group = nvim_metals_group, }) - end + end, }, --- INFO: neoconf load lsp specific infos from a conf file used for projects for instance ["folke/neoconf.nvim"] = { - config = true, - priority = 52, -- needs to load before lspconfig + cmd = "Neoconf", + opts = {}, }, --- INFO: lsp ts aware folding ["kevinhwang91/nvim-ufo"] = { @@ -96,7 +131,10 @@ M.lsp = { ["neovim/nvim-lspconfig"] = { config = require("config.plugins.configs.lspconfig").init, priority = 51, - event = { "BufReadPost", "BufNewFile" }, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + dependencies = { + "lsp-status.nvim", + }, }, --- INFO: project wide diagnostic infos ["folke/trouble.nvim"] = { @@ -107,7 +145,9 @@ M.lsp = { dependencies = "kyazdani42/nvim-web-devicons", }, --- INFO: shows lsp status loading - ["nvim-lua/lsp-status.nvim"] = {}, + ["nvim-lua/lsp-status.nvim"] = { + lazy = true, + }, } return M diff --git a/lua/config/plugins/modules/navigation.lua b/lua/config/plugins/modules/navigation.lua index 81a984ec..c93d4848 100644 --- a/lua/config/plugins/modules/navigation.lua +++ b/lua/config/plugins/modules/navigation.lua @@ -7,15 +7,11 @@ local M = {} M.navigation = { --- INFO: % motion ["andymass/vim-matchup"] = { + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, config = function() vim.g.matchup_matchparen_offscreen = {} end, }, - --- INFO: tmuxish behaviour in vim - ["hkupty/nvimux"] = { - keys = { "" }, - config = require("config.plugins.configs.nvimux").init, - }, --- INFO: file picker / grep search etc anything fuzzy related ["nvim-telescope/telescope.nvim"] = { cmd = { "Telescope" }, diff --git a/lua/config/plugins/modules/themes.lua b/lua/config/plugins/modules/themes.lua index 5ffd1698..91b7621d 100644 --- a/lua/config/plugins/modules/themes.lua +++ b/lua/config/plugins/modules/themes.lua @@ -36,25 +36,21 @@ vim.g.tokyodark_enable_italic = true vim.g.tokyodark_color_gamma = "1" M.theme = { + ["sphamba/smear-cursor.nvim"] = { + event = "VeryLazy", + enabled = function() + return not vim.g.neovide + end, + opts = {}, + }, --- INFO: highlight start of words bold - ["HampusHauffman/bionic.nvim"] = {}, + ["HampusHauffman/bionic.nvim"] = { + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + }, --- INFO: shows indentation scopes with different background highlight making it a block ["HampusHauffman/block.nvim"] = { - config = function() - require("block").setup({ - percent = 0.8, - depth = 4, - colors = nil, - automatic = false, - -- bg = nil, - -- colors = { - -- "#ff0000" - -- "#00ff00" - -- "#0000ff" - -- }, - }) - end, - enabled = true, + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + opts = {}, }, ["projekt0n/github-nvim-theme"] = { tag = "v0.0.7", @@ -64,20 +60,11 @@ M.theme = { ["m-demare/hlargs.nvim"] = { event = "VeryLazy", dependencies = { "nvim-treesitter/nvim-treesitter" }, + lazy = true, config = function() require("hlargs").setup() end, }, - --- INFO: display of emptyspaces/indentations vertical bars - ["lukas-reineke/indent-blankline.nvim"] = { - config = require("config.plugins.configs.indent-blankline").init, - lazy = true, - event = "BufRead", - }, - --- INFO: dashboard plugin - ["goolord/alpha-nvim"] = { - config = require("config.plugins.configs.dashboard").dashboard, - }, --- INFO: the statusline builder im using ["windwp/windline.nvim"] = { event = "VeryLazy", @@ -89,6 +76,10 @@ M.theme = { end, }, ["romgrk/barbar.nvim"] = { + event = { "BufReadPost", "BufWritePost", "BufNewFile" }, + config = function() + require("config.plugins.configs.bufferline").init() + end, dependencies = { "kyazdani42/nvim-web-devicons" }, }, } @@ -98,13 +89,11 @@ M.ts_themes = { colorscheme_name = { "sonokai" }, lazy = true, priority = 1000, - opts = {}, }, ["ray-x/aurora"] = { colorscheme_name = { "aurora" }, lazy = true, priority = 1000, - opts = {}, }, ["Mofiqul/vscode.nvim"] = { colorscheme_name = { "vscode" }, diff --git a/lua/config/plugins/modules/treesitter.lua b/lua/config/plugins/modules/treesitter.lua index b76727a4..6bc8fe07 100644 --- a/lua/config/plugins/modules/treesitter.lua +++ b/lua/config/plugins/modules/treesitter.lua @@ -5,32 +5,6 @@ local M = {} M.ts = { - -- INFO: hihglight current chunk - ["shellRaining/hlchunk.nvim"] = { - event = "UIEnter", - config = function() - require("hlchunk").setup({ - blank = { - enable = false, - }, - line_num = { - enable = false, - }, - indent = { - enable = false, - }, - }) - end, - }, - --- TODO: ? - ["Wansmer/treesj"] = { - keys = { "m", "j", "s" }, - opts = { use_default_keymaps = false, max_join_length = 150 }, - dependencies = { "nvim-treesitter/nvim-treesitter" }, - config = function() - require("treesj").setup({}) - end, - }, --- INFO: refactor plugin ["ThePrimeagen/refactoring.nvim"] = { config = require("config.plugins.configs.refactoring").init, @@ -54,9 +28,28 @@ M.ts = { }) end, }, - ["nvim-treesitter/nvim-treesitter"] = {}, + ["nvim-treesitter/nvim-treesitter"] = { + config = function() + require("config.plugins.configs.treesitter").init() + end, + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + "RRethy/nvim-treesitter-textsubjects", + "windwp/nvim-ts-autotag", + "nvim-treesitter/nvim-treesitter-context", + }, + }, + ["Wansmer/treesj"] = { + event = "VeryLazy", + opts = { use_default_keymaps = false, max_join_length = 150 }, + dependencies = { "nvim-treesitter/nvim-treesitter" }, + config = function() + require("treesj").setup({}) + end, + }, --- INFO: indenter ["yioneko/nvim-yati"] = { + event = "VeryLazy", dependencies = "nvim-treesitter/nvim-treesitter", }, --- INFO: doc generation @@ -72,37 +65,23 @@ M.ts = { --- INFO: treesitter aware commenting ["winston0410/commented.nvim"] = { keys = { - { "cc", mode = { "n", "v" }, desc = "Comment out line" }, + { "gcc", mode = { "n", "v" }, desc = "Comment out line" }, }, dependencies = "nvim-treesitter/nvim-treesitter", config = function() require("commented").setup({ + keybindings = { n = "gc", v = "gc", nl = "gcc" }, hooks = { before_comment = require("ts_context_commentstring.internal").update_commentstring, }, }) end, }, - -- INFO: textobject movements like change inside argument jump to function - ["nvim-treesitter/nvim-treesitter-textobjects"] = { - dependencies = "nvim-treesitter/nvim-treesitter", - lazy = true, - }, -- INFO: show ts nodes etc ["nvim-treesitter/playground"] = { cmd = "TSPlaygroundToggle", dependencies = "nvim-treesitter/nvim-treesitter", }, - -- INFO: textsubject movements - ["RRethy/nvim-treesitter-textsubjects"] = { - dependencies = "nvim-treesitter/nvim-treesitter", - lazy = true, - }, - -- INFO: add auto tags - ["windwp/nvim-ts-autotag"] = { - dependencies = "nvim-treesitter/nvim-treesitter", - lazy = true, - }, } return M diff --git a/lua/config/plugins/modules/utility.lua b/lua/config/plugins/modules/utility.lua index 3ed54176..161fc039 100644 --- a/lua/config/plugins/modules/utility.lua +++ b/lua/config/plugins/modules/utility.lua @@ -1,9 +1,34 @@ +local config = require("config.core.config").config +local config_path = vim.fn.stdpath("config") + ---@module 'lazy.types' +--- ---@class utility ---@field utility table local M = {} M.utility = { + ["nvzone/timerly"] = { + cmd = "TimerlyToggle", + }, + ["nvzone/minty"] = { + cmd = { "Shades", "Huefy" }, + dependencies = { + "nvzone/volt", + }, + }, + ["echasnovski/mini.pairs"] = { + event = "VeryLazy", + opts = {}, + }, + ["MeanderingProgrammer/render-markdown.nvim"] = { + event = "VeryLazy", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "echasnovski/mini.icons", + }, -- if you use standalone mini plugins + opts = {}, + }, -- INFO: center the current buffer nice for widescreen ["shortcuts/no-neck-pain.nvim"] = { cmd = { "NoNeckPain" }, @@ -35,49 +60,363 @@ M.utility = { }, }, }, + ["folke/snacks.nvim"] = { + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + bigfile = { enabled = true }, + dashboard = { + enabled = true, + width = 76, + row = nil, -- dashboard position. nil for center + col = nil, -- dashboard position. nil for center + pane_gap = 4, -- empty columns between vertical panes + autokeys = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -- autokey sequence + -- These settings are used by some built-in sections + preset = { + -- Defaults to a picker that supports `fzf-lua`, `telescope.nvim` and `mini.pick` + ---@type fun(cmd:string, opts:table)|nil + pick = nil, + -- Used by the `keys` section to show keymaps. + -- Set your custom keymaps here. + -- When using a function, the `items` argument are the default keymaps. + ---@type snacks.dashboard.Item[] + keys = { + { + icon = " ", + key = "f", + desc = "Find File", + action = ":lua Snacks.dashboard.pick('files')", + }, + { + icon = " ", + key = "n", + desc = "New File", + action = ":ene | startinsert", + }, + { + icon = " ", + key = "g", + desc = "Find Text", + action = ":lua Snacks.dashboard.pick('live_grep')", + }, + { + icon = " ", + key = "r", + desc = "Recent Files", + action = ":lua Snacks.dashboard.pick('oldfiles')", + }, + { + icon = " ", + key = "c", + desc = "Config", + action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})", + }, + { + icon = " ", + key = "s", + desc = "Restore Session", + section = "session", + }, + { + icon = "󰒲 ", + key = "L", + desc = "Lazy", + action = ":Lazy", + enabled = package.loaded.lazy ~= nil, + }, + { icon = " ", key = "q", desc = "Quit", action = ":qa" }, + }, + -- Used by the `header` section + header = [[ +███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ +████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ +██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ +██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ +██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ +╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]], + }, + -- item field formatters + formats = { + icon = function(item) + if + item.file and item.icon == "file" or item.icon == "directory" + then + -- return M.icon(item.file, item.icon) + end + return { item.icon, width = 2, hl = "icon" } + end, + footer = { "%s", align = "center" }, + header = { "%s", align = "center" }, + file = function(item, ctx) + local fname = vim.fn.fnamemodify(item.file, ":~") + fname = ctx.width + and #fname > ctx.width + and vim.fn.pathshorten(fname) + or fname + if #fname > ctx.width then + local dir = vim.fn.fnamemodify(fname, ":h") + local file = vim.fn.fnamemodify(fname, ":t") + if dir and file then + file = file:sub(-(ctx.width - #dir - 2)) + fname = dir .. "/…" .. file + end + end + local dir, file = fname:match("^(.*)/(.+)$") + return dir and { { dir .. "/", hl = "dir" }, { file, hl = "file" } } + or { { fname, hl = "file" } } + end, + }, + sections = function() + local global = require("config.core.global") + local header + if not global.is_windows then + header = { + pane = 1, + section = "terminal", + cmd = "cat | lolcat --seed=24 " + .. config_path + .. "/" + .. config.ui.logo, + gap = 1, + padding = 1, + } + else + header = { + section = "header", + } + end + return { + header, + { + title = "Keymaps", + indent = 2, + section = "keys", + gap = 1, + padding = 1, + }, + { + icon = " ", + title = "Projects", + section = "projects", + indent = 2, + padding = 1, + }, + { + icon = " ", + title = "Git Status", + section = "terminal", + enabled = function() + return Snacks.git.get_root() ~= nil + end, + cmd = "git status --short --branch --renames", + height = 5, + padding = 1, + ttl = 5 * 60, + indent = 3, + }, + { section = "startup" }, + } + end, + }, + indent = { enabled = true }, + input = { enabled = true }, + notifier = { + enabled = true, + timeout = 3000, + }, + quickfile = { enabled = true }, + scroll = { enabled = not vim.g.neovide }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + styles = { + notification = { + -- wo = { wrap = true } -- Wrap notifications + }, + }, + }, + keys = { + { + "z", + function() + Snacks.zen() + end, + desc = "Toggle Zen Mode", + }, + { + "Z", + function() + Snacks.zen.zoom() + end, + desc = "Toggle Zoom", + }, + { + ".", + function() + Snacks.scratch() + end, + desc = "Toggle Scratch Buffer", + }, + { + "S", + function() + Snacks.scratch.select() + end, + desc = "Select Scratch Buffer", + }, + { + "N", + function() + Snacks.notifier.show_history() + end, + desc = "Notification History", + }, + { + "cR", + function() + Snacks.rename.rename_file() + end, + desc = "Rename File", + }, + { + "gB", + function() + Snacks.gitbrowse() + end, + desc = "Git Browse", + mode = { "n", "v" }, + }, + { + "gb", + function() + Snacks.git.blame_line() + end, + desc = "Git Blame Line", + }, + { + "gF", + function() + Snacks.lazygit.log_file() + end, + desc = "Lazygit Current File History", + }, + { + "gg", + function() + Snacks.lazygit() + end, + desc = "Lazygit", + }, + { + "gL", + function() + Snacks.lazygit.log() + end, + desc = "Lazygit Log (cwd)", + }, + { + "un", + function() + Snacks.notifier.hide() + end, + desc = "Dismiss All Notifications", + }, + { + "", + function() + Snacks.terminal() + end, + desc = "Toggle Terminal", + }, + { + "", + function() + Snacks.terminal() + end, + desc = "which_key_ignore", + }, + { + "]]", + function() + Snacks.words.jump(vim.v.count1) + end, + desc = "Next Reference", + mode = { "n", "t" }, + }, + { + "[[", + function() + Snacks.words.jump(-vim.v.count1) + end, + desc = "Prev Reference", + mode = { "n", "t" }, + }, + }, + init = function() + vim.api.nvim_create_autocmd("User", { + pattern = "VeryLazy", + callback = function() + -- Setup some globals for debugging (lazy-loaded) + _G.dd = function(...) + Snacks.debug.inspect(...) + end + _G.bt = function() + Snacks.debug.backtrace() + end + vim.print = _G.dd -- Override print to use snacks for `:=` command + + -- Create some toggle mappings + Snacks.toggle.option("spell", { name = "Spelling" }):map("us") + Snacks.toggle.option("wrap", { name = "Wrap" }):map("uw") + Snacks.toggle + .option("relativenumber", { name = "Relative Number" }) + :map("uL") + Snacks.toggle.diagnostics():map("ud") + Snacks.toggle.line_number():map("ul") + Snacks.toggle + .option("conceallevel", { + off = 0, + on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2, + }) + :map("uc") + Snacks.toggle.treesitter():map("uT") + Snacks.toggle + .option( + "background", + { off = "light", on = "dark", name = "Dark Background" } + ) + :map("ub") + Snacks.toggle.inlay_hints():map("uh") + Snacks.toggle.indent():map("ug") + Snacks.toggle.dim():map("uD") + end, + }) + end, + }, -- INFO: Handles the fancy floating terms for search/commands ["folke/noice.nvim"] = { - event = "VimEnter", + event = "VeryLazy", enabled = function() return vim.g.neovide == nil end, - config = function() - if not vim.g.neovide then - require("noice").setup({ - presets = { - -- you can enable a preset by setting it to true, or a table that will override the preset config - -- you can also add custom presets that you can enable/disable with enabled=true - bottom_search = false, -- use a classic bottom cmdline for search - command_palette = false, -- position the cmdline and popupmenu together - long_message_to_split = false, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = true, -- add a border to hover docs and signature help - }, - }) - end - end, + opts = { + presets = { + -- you can enable a preset by setting it to true, or a table that will override the preset config + -- you can also add custom presets that you can enable/disable with enabled=true + bottom_search = false, -- use a classic bottom cmdline for search + command_palette = false, -- position the cmdline and popupmenu together + long_message_to_split = false, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- 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", "rcarriga/nvim-notify", - "hrsh7th/nvim-cmp", }, }, - -- INFO: auto install lsp servers - ["williamboman/mason.nvim"] = { - config = function() - require("mason").setup() - end, - build = ":MasonUpdate", -- :MasonUpdate updates registry contents - priority = 53, - }, - -- INFO: autoinstall lsp servers and configs - ["williamboman/mason-lspconfig.nvim"] = { - config = function() - require("mason-lspconfig").setup() - end, - priority = 52, - }, -- INFO: depedencie for some plugins ["MunifTanjim/nui.nvim"] = { lazy = true }, -- INFO: lua nvim framework that is a depedencie for most plugins @@ -109,21 +448,21 @@ M.utility = { }) end, }, - -- INFO: handle autopairs () - ["windwp/nvim-autopairs"] = { - dependencies = "nvim-cmp", - enabled = true, - config = function() - require("config.plugins.configs.autopairs").init() - end, - }, - -- vimwiki - -- INFO: not used anymore (by me) - ["vimwiki/vimwiki"] = { - cmd = { "VimwikiIndex", "VimwikiDiaryIndex", "VimwikiMakeDiaryNote" }, - }, -- shows infos of chained commands ["folke/which-key.nvim"] = { + event = "VeryLazy", + opts = { + preset = "helix", + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", + }, + }, config = function() require("config.plugins.configs.which").init() end, @@ -176,29 +515,10 @@ M.utility = { -- INFO: handles notifications for instance used by noice ["rcarriga/nvim-notify"] = { lazy = true, - config = function() - local notify = require("notify") - notify.setup({ - -- Animation style (see below for details) - -- stages = "fade", - -- Default timeout for notifications - timeout = 3000, - -- For stages that change opacity this is treated as the highlight behind the window - background_colour = "#000000", - -- Icons for the different levels - icons = { - ERROR = "", - WARN = "", - INFO = "", - DEBUG = "", - TRACE = "✎", - }, - }) - vim.notify = notify - end, }, -- notication pop up -- INFO: pick your desired window ["ten3roberts/window-picker.nvim"] = { + lazy = true, config = function() require("window-picker").setup({ -- Default keys to annotate, keys will be used in order. The default uses the @@ -217,9 +537,13 @@ M.utility = { -- INFO: better quickfix list shows context for instance of current file ["kevinhwang91/nvim-bqf"] = { ft = "qf" }, -- better quickfix -- INFO: another quickfix tool - ["yorickpeterse/nvim-pqf"] = { event = "VeryLazy", config = true }, + ["yorickpeterse/nvim-pqf"] = { + event = "VeryLazy", + opts = {}, + }, -- INFO: no weird buffer jumping/jitters ["luukvbaal/stabilize.nvim"] = { + event = "VeryLazy", config = function() require("stabilize").setup({ force = true, @@ -240,6 +564,7 @@ M.utility = { }, -- INFO: discord integration ["andweeb/presence.nvim"] = { + lazy = true, config = function() require("presence"):setup({ -- General options @@ -264,26 +589,45 @@ M.utility = { }) end, }, - -- INFO: s movement motion - ["ggandor/lightspeed.nvim"] = {}, + -- INFO: movement plugin + ["folke/flash.nvim"] = { + event = "VeryLazy", + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, + }, -- INFO: create folders if do not exist when in buffer ["jghauser/mkdir.nvim"] = { + lazy = true, config = function() require("mkdir") end, }, -- INFO: highlight comments like - -- TODO: fix this ["folke/todo-comments.nvim"] = { - config = require("config.plugins.configs.todo").init, - dependencies = "telescope.nvim", event = "VeryLazy", + opts = {}, }, -- INFO: surround () motion - ["ur4ltz/surround.nvim"] = { - config = function() - require("surround").setup({ mappings_style = "surround" }) - end, + ["echasnovski/mini.surround"] = { + event = "VeryLazy", + opts = { + mappings = { + add = "gsa", -- Add surrounding in Normal and Visual modes + delete = "gsd", -- Delete surrounding + find = "gsf", -- Find surrounding (to the right) + find_left = "gsF", -- Find surrounding (to the left) + highlight = "gsh", -- Highlight surrounding + replace = "gsr", -- Replace surrounding + update_n_lines = "gsn", -- Update `n_lines` + }, + }, }, } diff --git a/lua/config/themes/hl/catppuccin.lua b/lua/config/themes/hl/catppuccin.lua new file mode 100644 index 00000000..3e51ed5d --- /dev/null +++ b/lua/config/themes/hl/catppuccin.lua @@ -0,0 +1,73 @@ +-- credits to original radium theme from https://github.com/dharmx +-- this is a modified version of it +---@module 'config.themes.hl.types' + +---@type ColorScheme +local M = {} + +M.base_30 = { + white = "#D9E0EE", + darker_black = "#191828", + black = "#1E1D2D", -- nvim bg + black2 = "#252434", + one_bg = "#2d2c3c", -- real bg of onedark + one_bg2 = "#363545", + one_bg3 = "#3e3d4d", + grey = "#474656", + grey_fg = "#4e4d5d", + grey_fg2 = "#555464", + light_grey = "#605f6f", + red = "#F38BA8", + baby_pink = "#ffa5c3", + pink = "#F5C2E7", + line = "#383747", -- for lines like vertsplit + green = "#ABE9B3", + vibrant_green = "#b6f4be", + nord_blue = "#8bc2f0", + blue = "#89B4FA", + yellow = "#FAE3B0", + sun = "#ffe9b6", + purple = "#d0a9e5", + dark_purple = "#c7a0dc", + teal = "#B5E8E0", + orange = "#F8BD96", + cyan = "#89DCEB", + statusline_bg = "#232232", + lightbg = "#2f2e3e", + pmenu_bg = "#ABE9B3", + folder_bg = "#89B4FA", + lavender = "#c7d1ff", +} + +M.base_16 = { + base00 = "#1E1D2D", + base01 = "#282737", + base02 = "#2f2e3e", + base03 = "#383747", + base04 = "#414050", + base05 = "#bfc6d4", + base06 = "#ccd3e1", + base07 = "#D9E0EE", + base08 = "#F38BA8", + base09 = "#F8BD96", + base0A = "#FAE3B0", + base0B = "#ABE9B3", + base0C = "#89DCEB", + base0D = "#89B4FA", + base0E = "#CBA6F7", + base0F = "#F38BA8", +} + +M.polish_hl = { + treesitter = { + ["@variable"] = { fg = M.base_30.lavender }, + ["@property"] = { fg = M.base_30.teal }, + ["@variable.builtin"] = { fg = M.base_30.red }, + }, +} + +M.type = "dark" + +M = require("config.themes").override_theme(M, "catppuccin") + +return M diff --git a/lua/config/themes/hl/github_dark_default.lua b/lua/config/themes/hl/github_dark_default.lua index e6592d1a..0d6707f5 100644 --- a/lua/config/themes/hl/github_dark_default.lua +++ b/lua/config/themes/hl/github_dark_default.lua @@ -61,25 +61,12 @@ M.base_16 = { M.type = "dark" M.polish_hl = { - ["@punctuation.bracket"] = { - fg = M.base_30.orange, - }, - - ["@string"] = { - fg = M.base_30.white, - }, - - ["@field.key"] = { - fg = M.base_30.white, - }, - - ["@constructor"] = { - fg = M.base_30.vibrant_green, - bold = true, - }, - - ["@tag.attribute"] = { - link = "@method", + treesitter = { + ["@punctuation.bracket"] = { fg = M.base_30.orange }, + ["@string"] = { fg = M.base_30.white }, + ["@variable.member.key"] = { fg = M.base_30.white }, + ["@constructor"] = { fg = M.base_30.vibrant_green }, + ["@tag.attribute"] = { link = "@function.method" }, }, } diff --git a/lua/config/themes/hl/github_light.lua b/lua/config/themes/hl/github_light.lua index 010c22f9..eed3978c 100644 --- a/lua/config/themes/hl/github_light.lua +++ b/lua/config/themes/hl/github_light.lua @@ -61,28 +61,16 @@ M.base_16 = { M.type = "light" M.polish_hl = { - ["@punctuation.bracket"] = { - fg = M.base_30.blue, + treesitter = { + ["@punctuation.bracket"] = { fg = M.base_30.blue }, + ["@variable.member.key"] = { fg = M.base_30.white }, + ["@constructor"] = { fg = M.base_30.vibrant_green }, + ["@operator"] = { fg = M.base_30.orange }, }, - ["@field.key"] = { - fg = M.base_30.white, - }, - - Constant = { - fg = M.base_16.base07, - }, - - ["@constructor"] = { - fg = M.base_30.vibrant_green, - }, - - Tag = { - fg = M.base_30.vibrant_green, - }, - - ["@operator"] = { - fg = M.base_30.orange, + syntax = { + Constant = { fg = M.base_16.base07 }, + Tag = { fg = M.base_30.vibrant_green }, }, } diff --git a/lua/config/themes/hl/radium.lua b/lua/config/themes/hl/radium.lua index 457177ce..1c483315 100644 --- a/lua/config/themes/hl/radium.lua +++ b/lua/config/themes/hl/radium.lua @@ -58,8 +58,10 @@ M.base_16 = { } M.polish_hl = { - ["@punctuation.bracket"] = { fg = M.base_16.base07 }, - ["@parenthesis"] = { link = "@punctuation.bracket" }, + treesitter = { + ["@punctuation.bracket"] = { fg = M.base_16.base07 }, + ["@parenthesis"] = { link = "@punctuation.bracket" }, + }, } M.type = "dark" diff --git a/lua/config/themes/hl/tokyonight.lua b/lua/config/themes/hl/tokyonight.lua index 5f19c14f..c8a7af26 100644 --- a/lua/config/themes/hl/tokyonight.lua +++ b/lua/config/themes/hl/tokyonight.lua @@ -59,12 +59,14 @@ M.base_16 = { } M.polish_hl = { - ["@variable"] = { fg = M.base_16.base05 }, - ["@punctuation.bracket"] = { fg = M.base_30.purple }, - ["@method.call"] = { fg = M.base_30.red }, - ["@function.call"] = { fg = M.base_30.blue }, - ["@constant"] = { fg = M.base_30.orange }, - ["@parameter"] = { fg = M.base_30.orange }, + treesitter = { + ["@variable"] = { fg = M.base_16.base05 }, + ["@punctuation.bracket"] = { fg = M.base_30.purple }, + ["@function.method.call"] = { fg = M.base_30.red }, + ["@function.call"] = { fg = M.base_30.blue }, + ["@constant"] = { fg = M.base_30.orange }, + ["@variable.parameter"] = { fg = M.base_30.orange }, + }, } M.type = "dark" diff --git a/lua/config/themes/hl/types.lua b/lua/config/themes/hl/types.lua index 0ee17e45..2c99f236 100644 --- a/lua/config/themes/hl/types.lua +++ b/lua/config/themes/hl/types.lua @@ -1,5 +1,12 @@ ---@meta +--- @class HighlightTheme +--- @field fg? string +--- @field bg? string +--- @field sp? string +--- @field style? string +--- @field link? string + ---@alias Flavor ---| '"dark"' ---| '"light"' @@ -7,7 +14,7 @@ ---@class ColorScheme ---@field base_30 BASE_30 ---@field base_16 BASE_16 ----@field polish_hl? table +---@field polish_hl? table> ---@field type? Flavor ---@class BASE_30 @@ -16,6 +23,7 @@ ---@field black string ---@field black2 string ---@field one_bg string +---@field lavender string ---@field one_bg2 string ---@field one_bg3 string ---@field grey string diff --git a/lua/config/themes/hl/vscode_dark.lua b/lua/config/themes/hl/vscode_dark.lua index 8326cead..f870db49 100644 --- a/lua/config/themes/hl/vscode_dark.lua +++ b/lua/config/themes/hl/vscode_dark.lua @@ -62,12 +62,14 @@ M.base_16 = { } M.polish_hl = { - ["@parameter"] = { fg = M.base_30.blue }, - ["@keyword"] = { fg = M.base_30.blue }, - ["@variable"] = { fg = M.base_30.cyan }, - ["@field.key"] = { fg = M.base_30.green1 }, - ["@keyword.return"] = { fg = M.base_16.base0E }, - ["@keyword.function"] = { fg = M.base_30.teal }, + treesitter = { + ["@parameter"] = { fg = M.base_30.blue }, + ["@keyword"] = { fg = M.base_30.blue }, + ["@variable"] = { fg = M.base_30.cyan }, + ["@field.key"] = { fg = M.base_30.green1 }, + ["@keyword.return"] = { fg = M.base_16.base0E }, + ["@keyword.function"] = { fg = M.base_30.teal }, + }, } M.type = "dark" diff --git a/lua/config/themes/init.lua b/lua/config/themes/init.lua index c6bba6de..1c9b5ee6 100644 --- a/lua/config/themes/init.lua +++ b/lua/config/themes/init.lua @@ -7,11 +7,10 @@ local M = {} M.get_theme_tb = function(type) local default_path = "config.themes.hl." .. config.ui.colorscheme.name - local present1, default_theme = pcall(require, default_path) + local theme_exists, selected_theme = pcall(require, default_path) - if present1 then - return default_theme[type] - -- error("No such theme! " .. default_path) + if theme_exists then + return selected_theme[type] end end diff --git a/lua/config/themes/integrations/cmp.lua b/lua/config/themes/integrations/cmp.lua index 98a7dcab..ade89ece 100644 --- a/lua/config/themes/integrations/cmp.lua +++ b/lua/config/themes/integrations/cmp.lua @@ -1,18 +1,18 @@ local base16 = require("config.themes").get_colors("base_16") local colors = require("config.themes").get_colors("base_30") ----@type table -local cmp = { - -- nvim cmp +local highlights = { CmpItemAbbr = { fg = colors.white }, CmpItemAbbrMatch = { fg = colors.blue, bold = true }, - CmpBorder = { fg = colors.grey }, - CmpDocBorder = { fg = colors.grey }, - CmPmenu = { bg = colors.darker_black }, + CmpDoc = { bg = colors.black }, + CmpDocBorder = { fg = colors.grey_fg }, + CmpPmenu = { bg = colors.black }, + CmpSel = { link = "PmenuSel", bold = true }, +} - -- cmp item kinds +---@type table +local item_kinds = { CmpItemKindConstant = { fg = base16.base09 }, - CopilotSuggestion = { fg = "#555555" }, CmpItemKindFunction = { fg = base16.base0D }, CmpItemKindIdentifier = { fg = base16.base08 }, CmpItemKindField = { fg = base16.base08 }, @@ -27,20 +27,25 @@ local cmp = { CmpItemKindFolder = { fg = base16.base07 }, CmpItemKindModule = { fg = base16.base0A }, CmpItemKindProperty = { fg = base16.base08 }, - -- CmpItemKindEnum = { fg = "" }, + CmpItemKindEnum = { fg = colors.blue }, CmpItemKindUnit = { fg = base16.base0E }, - -- CmpItemKindClass = { fg = "" }, + CmpItemKindClass = { fg = colors.teal }, CmpItemKindFile = { fg = base16.base07 }, - -- CmpItemKindInterface = { fg = "" }, - CmpItemKindColor = { fg = colors.red }, + CmpItemKindInterface = { fg = colors.green }, + CmpItemKindColor = { fg = colors.white }, CmpItemKindReference = { fg = base16.base05 }, - -- CmpItemKindEnumMember = { fg = "" }, + CmpItemKindEnumMember = { fg = colors.purple }, CmpItemKindStruct = { fg = base16.base0E }, - -- CmpItemKindValue = { fg = "" }, - -- CmpItemKindEvent = { fg = "" }, + CmpItemKindValue = { fg = colors.cyan }, + CmpItemKindEvent = { fg = colors.yellow }, CmpItemKindOperator = { fg = base16.base05 }, CmpItemKindTypeParameter = { fg = base16.base08 }, CmpItemKindCopilot = { fg = colors.green }, + CmpItemKindCodeium = { fg = colors.vibrant_green }, + CmpItemKindTabNine = { fg = colors.baby_pink }, + CmpItemKindSuperMaven = { fg = colors.yellow }, } -return cmp +highlights = vim.tbl_deep_extend("force", highlights, item_kinds) + +return highlights diff --git a/lua/config/themes/integrations/codeactionsmenu.lua b/lua/config/themes/integrations/codeactionsmenu.lua new file mode 100644 index 00000000..cc03e219 --- /dev/null +++ b/lua/config/themes/integrations/codeactionsmenu.lua @@ -0,0 +1,16 @@ +local colors = require("config.themes").get_colors("base_30") + +return { + CodeActionMenuWarningMessageText = { fg = colors.white }, + CodeActionMenuWarningMessageBorder = { fg = colors.red }, + CodeActionMenuMenuIndex = { fg = colors.blue }, + CodeActionMenuMenuKind = { fg = colors.green }, + CodeActionMenuMenuTitle = { fg = colors.white }, + CodeActionMenuMenuDisabled = { link = "Comment" }, + CodeActionMenuMenuSelection = { fg = colors.blue }, + CodeActionMenuDetailsTitle = { fg = colors.white }, + CodeActionMenuDetailsLabel = { fg = colors.yellow }, + CodeActionMenuDetailsPreferred = { fg = colors.green }, + CodeActionMenuDetailsDisabled = { link = "Comment" }, + CodeActionMenuDetailsUndefined = { link = "Comment" }, +} diff --git a/lua/config/themes/integrations/dap.lua b/lua/config/themes/integrations/dap.lua new file mode 100644 index 00000000..764b7d9e --- /dev/null +++ b/lua/config/themes/integrations/dap.lua @@ -0,0 +1,48 @@ +local colors = require("config.themes").get_colors("base_30") + +return { + -- Dap + DapBreakpoint = { fg = colors.red }, + DapBreakpointCondition = { fg = colors.yellow }, + DapLogPoint = { fg = colors.cyan }, + DapStopped = { fg = colors.baby_pink }, + + -- DapUI + DAPUIScope = { fg = colors.cyan }, + DAPUIType = { fg = colors.dark_purple }, + DAPUIValue = { fg = colors.cyan }, + DAPUIVariable = { fg = colors.white }, + DapUIModifiedValue = { fg = colors.orange }, + DapUIDecoration = { fg = colors.cyan }, + DapUIThread = { fg = colors.green }, + DapUIStoppedThread = { fg = colors.cyan }, + DapUISource = { fg = colors.lavender }, + DapUILineNumber = { fg = colors.cyan }, + DapUIFloatBorder = { fg = colors.cyan }, + + DapUIWatchesEmpty = { fg = colors.baby_pink }, + DapUIWatchesValue = { fg = colors.green }, + DapUIWatchesError = { fg = colors.baby_pink }, + + DapUIBreakpointsPath = { fg = colors.cyan }, + DapUIBreakpointsInfo = { fg = colors.green }, + DapUIBreakPointsCurrentLine = { fg = colors.green, bold = true }, + DapUIBreakpointsDisabledLine = { fg = colors.grey_fg2 }, + + DapUIStepOver = { fg = colors.blue }, + DapUIStepOverNC = { fg = colors.blue }, + DapUIStepInto = { fg = colors.blue }, + DapUIStepIntoNC = { fg = colors.blue }, + DapUIStepBack = { fg = colors.blue }, + DapUIStepBackNC = { fg = colors.blue }, + DapUIStepOut = { fg = colors.blue }, + DapUIStepOutNC = { fg = colors.blue }, + DapUIStop = { fg = colors.red }, + DapUIStopNC = { fg = colors.red }, + DapUIPlayPause = { fg = colors.green }, + DapUIPlayPauseNC = { fg = colors.green }, + DapUIRestart = { fg = colors.green }, + DapUIRestartNC = { fg = colors.green }, + DapUIUnavailable = { fg = colors.grey_fg }, + DapUIUnavailableNC = { fg = colors.grey_fg }, +} diff --git a/lua/config/themes/theme_setup.lua b/lua/config/themes/theme_setup.lua index 6bdc2da8..cb1d901e 100644 --- a/lua/config/themes/theme_setup.lua +++ b/lua/config/themes/theme_setup.lua @@ -17,18 +17,19 @@ for _, file in ipairs(hl_files) do ---@type table local integration = require("config.themes.integrations." .. a) highlights = merge_tb("force", highlights, integration) + + -- polish theme specific highlights + local polish_hl = require("config.themes").get_colors("polish_hl") + + -- polish themes + if polish_hl and polish_hl[a] then + highlights = merge_tb("force", highlights, polish_hl[a]) + end end -- term colors require("config.themes.termhl") --- polish theme specific highlights -local polish_hl = require("config.themes").get_colors("polish_hl") - -if polish_hl then - highlights = merge_tb("force", highlights, polish_hl) -end - if ui.transparent then highlights = merge_tb("force", highlights, require("config.themes.glassy")) end diff --git a/lua/config/themes/ts.lua b/lua/config/themes/ts.lua deleted file mode 100644 index e980cd5b..00000000 --- a/lua/config/themes/ts.lua +++ /dev/null @@ -1,380 +0,0 @@ -local M = {} - -function M.new_style() - ---@diagnostic disable-next-line: undefined-field - return vim.treesitter.highlighter.hl_map == nil -end - -function M.get(group) - if group:sub(1, 1) ~= "@" or M.new_style() then - return group - end - - group = group:sub(2) - - local lang - while group do - if M.fallbacks[group] then - return (lang or "") .. M.fallbacks[group] - end - group, lang = group:match("(.*)%.(.*)") - end -end - --- taken from https://github.com/nvim-treesitter/nvim-treesitter/blob/master/lua/nvim-treesitter/highlight.lua -M.fallbacks = { - ["annotation"] = "TSAnnotation", - ["attribute"] = "TSAttribute", - ["boolean"] = "TSBoolean", - ["character"] = "TSCharacter", - ["character.special"] = "TSCharacterSpecial", - ["comment"] = "TSComment", - ["conditional"] = "TSConditional", - ["constant"] = "TSConstant", - ["constant.builtin"] = "TSConstBuiltin", - ["constant.macro"] = "TSConstMacro", - ["constructor"] = "TSConstructor", - ["debug"] = "TSDebug", - ["define"] = "TSDefine", - ["error"] = "TSError", - ["exception"] = "TSException", - ["field"] = "TSField", - ["float"] = "TSFloat", - ["function"] = "TSFunction", - ["function.call"] = "TSFunctionCall", - ["function.builtin"] = "TSFuncBuiltin", - ["function.macro"] = "TSFuncMacro", - ["include"] = "TSInclude", - ["keyword"] = "TSKeyword", - ["keyword.function"] = "TSKeywordFunction", - ["keyword.operator"] = "TSKeywordOperator", - ["keyword.return"] = "TSKeywordReturn", - ["label"] = "TSLabel", - ["method"] = "TSMethod", - ["method.call"] = "TSMethodCall", - ["namespace"] = "TSNamespace", - ["none"] = "TSNone", - ["number"] = "TSNumber", - ["operator"] = "TSOperator", - ["parameter"] = "TSParameter", - ["parameter.reference"] = "TSParameterReference", - ["preproc"] = "TSPreProc", - ["property"] = "TSProperty", - ["punctuation.delimiter"] = "TSPunctDelimiter", - ["punctuation.bracket"] = "TSPunctBracket", - ["punctuation.special"] = "TSPunctSpecial", - ["repeat"] = "TSRepeat", - ["storageclass"] = "TSStorageClass", - ["string"] = "TSString", - ["string.regex"] = "TSStringRegex", - ["string.escape"] = "TSStringEscape", - ["string.special"] = "TSStringSpecial", - ["symbol"] = "TSSymbol", - ["tag"] = "TSTag", - ["tag.attribute"] = "TSTagAttribute", - ["tag.delimiter"] = "TSTagDelimiter", - ["text"] = "TSText", - ["text.strong"] = "TSStrong", - ["text.emphasis"] = "TSEmphasis", - ["text.underline"] = "TSUnderline", - ["text.strike"] = "TSStrike", - ["text.title"] = "TSTitle", - ["text.literal"] = "TSLiteral", - ["text.uri"] = "TSURI", - ["text.math"] = "TSMath", - ["text.reference"] = "TSTextReference", - ["text.environment"] = "TSEnvironment", - ["text.environment.name"] = "TSEnvironmentName", - ["text.note"] = "TSNote", - ["text.warning"] = "TSWarning", - ["text.danger"] = "TSDanger", - ["text.todo"] = "TSTodo", - ["type"] = "TSType", - ["type.builtin"] = "TSTypeBuiltin", - ["type.qualifier"] = "TSTypeQualifier", - ["type.definition"] = "TSTypeDefinition", - ["variable"] = "TSVariable", - ["variable.builtin"] = "TSVariableBuiltin", -} - -M.defaults = { - ["@annotation"] = { - default = true, - link = "PreProc", - }, - ["@attribute"] = { - default = true, - link = "PreProc", - }, - ["@boolean"] = { - default = true, - link = "Boolean", - }, - ["@character"] = { - default = true, - link = "Character", - }, - ["@character.special"] = { - default = true, - link = "SpecialChar", - }, - ["@comment"] = { - default = true, - link = "Comment", - }, - ["@conditional"] = { - default = true, - link = "Conditional", - }, - ["@constant"] = { - default = true, - link = "Constant", - }, - ["@constant.builtin"] = { - default = true, - link = "Special", - }, - ["@constant.macro"] = { - default = true, - link = "Define", - }, - ["@constructor"] = { - default = true, - link = "Special", - }, - ["@debug"] = { - default = true, - link = "Debug", - }, - ["@define"] = { - default = true, - link = "Define", - }, - ["@exception"] = { - default = true, - link = "Exception", - }, - ["@field"] = { - default = true, - link = "Identifier", - }, - ["@float"] = { - default = true, - link = "Float", - }, - ["@function"] = { - default = true, - link = "Function", - }, - ["@function.builtin"] = { - default = true, - link = "Special", - }, - ["@function.call"] = { - default = true, - link = "@function", - }, - ["@function.macro"] = { - default = true, - link = "Macro", - }, - ["@include"] = { - default = true, - link = "Include", - }, - ["@keyword"] = { - default = true, - link = "Keyword", - }, - ["@keyword.coroutine"] = { - default = true, - link = "@keyword", - }, - ["@keyword.function"] = { - default = true, - link = "Keyword", - }, - ["@keyword.operator"] = { - default = true, - link = "@operator", - }, - ["@keyword.return"] = { - default = true, - link = "@keyword", - }, - ["@label"] = { - default = true, - link = "Label", - }, - ["@method"] = { - default = true, - link = "Function", - }, - ["@method.call"] = { - default = true, - link = "@method", - }, - ["@namespace"] = { - default = true, - link = "Include", - }, - ["@none"] = { - default = true, - }, - ["@number"] = { - default = true, - link = "Number", - }, - ["@operator"] = { - default = true, - link = "Operator", - }, - ["@parameter"] = { - default = true, - link = "Identifier", - }, - ["@preproc"] = { - default = true, - link = "PreProc", - }, - ["@property"] = { - default = true, - link = "Identifier", - }, - ["@punctuation.bracket"] = { - default = true, - link = "Delimiter", - }, - ["@punctuation.delimiter"] = { - default = true, - link = "Delimiter", - }, - ["@punctuation.special"] = { - default = true, - link = "Delimiter", - }, - ["@repeat"] = { - default = true, - link = "Repeat", - }, - ["@storageclass"] = { - default = true, - link = "StorageClass", - }, - ["@string"] = { - default = true, - link = "String", - }, - ["@string.escape"] = { - default = true, - link = "SpecialChar", - }, - ["@string.regex"] = { - default = true, - link = "String", - }, - ["@string.special"] = { - default = true, - link = "SpecialChar", - }, - ["@symbol"] = { - default = true, - link = "Identifier", - }, - ["@tag"] = { - default = true, - link = "Label", - }, - ["@tag.attribute"] = { - default = true, - link = "@property", - }, - ["@tag.delimiter"] = { - default = true, - link = "Delimiter", - }, - ["@text"] = { - default = true, - link = "@none", - }, - ["@text.danger"] = { - default = true, - link = "WarningMsg", - }, - ["@text.emphasis"] = { - default = true, - italic = true, - }, - ["@text.environment"] = { - default = true, - link = "Macro", - }, - ["@text.environment.name"] = { - default = true, - link = "Type", - }, - ["@text.literal"] = { - default = true, - link = "String", - }, - ["@text.math"] = { - default = true, - link = "Special", - }, - ["@text.note"] = { - default = true, - link = "SpecialComment", - }, - ["@text.reference"] = { - default = true, - link = "Constant", - }, - ["@text.strike"] = { - strikethrough = true, - }, - ["@text.strong"] = { - bold = true, - default = true, - }, - ["@text.title"] = { - default = true, - link = "Title", - }, - ["@text.underline"] = { - underline = true, - }, - ["@text.uri"] = { - default = true, - link = "Underlined", - }, - ["@text.warning"] = { - default = true, - link = "Todo", - }, - ["@text.todo"] = { - default = true, - link = "Todo", - }, - ["@type"] = { - default = true, - link = "Type", - }, - ["@type.builtin"] = { - default = true, - link = "Type", - }, - ["@type.definition"] = { - default = true, - link = "Typedef", - }, - ["@type.qualifier"] = { - default = true, - link = "@keyword", - }, - ["@variable.builtin"] = { - default = true, - link = "Special", - }, -} - -return M diff --git a/lua/config/utils/init.lua b/lua/config/utils/init.lua index 0c57103b..c4567bff 100644 --- a/lua/config/utils/init.lua +++ b/lua/config/utils/init.lua @@ -46,7 +46,7 @@ end --- combines plugin manager colorschemes --- with internal colorschemes ---- @todo add support for custom colorschemes +--- @TODO: add support for custom colorschemes --- @param arg string M.switch_theme = function(arg) local colorscheme = nil diff --git a/neoconf.json b/neoconf.json new file mode 100644 index 00000000..e69de29b diff --git a/neovim.cat b/neovim.cat index 753136e7..af1bf116 100644 --- a/neovim.cat +++ b/neovim.cat @@ -1,11 +1,11 @@ - ███████████ █████ ██ - ███████████ █████  - ████████████████ ███████████ ███ ███████████ - █████████████████████████████ █████ ██████████████ - ██████████████████ █████████ █████ █████ ████ █████ - ██████████████████████ █████████ █████ █████ ████ █████ - ██████ ███ █████████████████ ████ █████ █████ ████ ██████ - ██████ ██ ███████████████ ██ █████████████████ - ██████ ██ ███████████████ ██ █████████████████ + ███████████ █████ ██ + ███████████ █████  + ████████████████ ███████████ ███ ███████████ + █████████████████████████████ █████ ██████████████ + ██████████████████ █████████ █████ █████ ████ █████ + ██████████████████████ █████████ █████ █████ ████ █████ + ██████ ███ █████████████████ ████ █████ █████ ████ ██████ + ██████ ██ ███████████████ ██ █████████████████ + ██████ ██ ███████████████ ██ █████████████████ diff --git a/nvim.log b/nvim.log index 5bf50d87..7096e176 100644 --- a/nvim.log +++ b/nvim.log @@ -1,143 +1,114 @@ - Startuptime: 83.18ms + Startuptime: 47.15ms Based on the actual CPU time of the Neovim process till UIEnter. This is more accurate than `nvim --startuptime`. - LazyStart 6.54ms - LazyDone 49.51ms (+42.97ms) - UIEnter 83.18ms (+33.67ms) + LazyStart 14.22ms + LazyDone 27.97ms (+13.75ms) + UIEnter 47.15ms (+19.18ms) Profile You can press to change sorting between chronological order & time taken. Press to filter profiling entries that took more time than a given threshold - ●  lazy.nvim 2.92ms - ➜  module 0.21ms - ➜  config 0.12ms - ➜  spec 1.54ms - ➜  state 0.18ms - ➜  install 0.05ms - ➜  handlers 0.8ms - ★  rust.vim/ftdetect/rust.vim 0.03ms - ●  startup 36.32ms - ➜  runtime/filetype.lua 0.05ms - ➜  init 0.02ms - ➜  start 33.94ms - ★  start  nvim-ts-context-commentstring 1.35ms - ‒  nvim-treesitter 1.2ms - ●  nvim-treesitter/plugin/nvim-treesitter.lua 1.14ms - ‒  nvim-ts-context-commentstring/plugin/ts_context_commentstring.vim 0.08ms - ★  start  filetype.nvim 0.01ms - ★  start  window-picker.nvim 0.3ms - ‒  window-picker.nvim/plugin/window-picker.vim 0.02ms - ★  start  gitlinker.nvim 0.02ms - ★  start  nvim-ts-autotag 0.33ms - ‒  nvim-ts-autotag/plugin/nvim-ts-autotag.vim 0.25ms - ★  start  orgmode.nvim 3.92ms - ‒  nvim-cmp 3.29ms - ●  nvim-cmp/plugin/cmp.lua 0.55ms - ‒  orgmode.nvim/plugin/orgmode.vim 0.02ms - ★  start  one-small-step-for-vimkind 0.04ms - ★  start  barbar.nvim 2.45ms - ‒  nvim-web-devicons 0.08ms - ●  nvim-web-devicons/plugin/nvim-web-devicons.vim 0.03ms - ‒  barbar.nvim/plugin/barbar.lua 2.29ms - ★  start  lightspeed.nvim 0.47ms - ‒  lightspeed.nvim/plugin/init.lua 0.44ms - ★  start  lsp-status.nvim 0.1ms - ★  start  git-conflict.nvim 0.5ms - ★  start  alpha-nvim 0.93ms - ★  start  nvim-ts-rainbow 0.25ms - ‒  nvim-ts-rainbow/plugin/rainbow.vim 0.2ms - ★  start  stabilize.nvim 0.3ms - ★  start  nvim-treesitter-textobjects 1.24ms - ‒  nvim-treesitter-textobjects/plugin/nvim-treesitter-textobjects.vim 1.15ms - ★  start  neotest 2.68ms - ‒  plenary.nvim 0.11ms - ●  plenary.nvim/plugin/plenary.vim 0.03ms - ‒  neotest-jest 0.08ms - ‒  neotest-rust 0.06ms - ‒  FixCursorHold.nvim 0.16ms - ●  FixCursorHold.nvim/plugin/fix_cursorhold_nvim.vim 0.04ms - ‒  neotest/plugin/neotest.lua 0.04ms - ★  start  nvim-gps 0.42ms - ‒  nvim-gps/plugin/nvim-gps.vim 0.19ms - ★  start  nvim-treesitter-textsubjects 0.2ms - ‒  nvim-treesitter-textsubjects/plugin/nvim-treesitter-textsubjects.vim 0.17ms - ★  start  vim-matchup 1.44ms - ‒  vim-matchup/plugin/matchup.vim 1.4ms - ★  start  lspkind-nvim 0.26ms - ★  start  lsp-inlayhints.nvim 0.3ms - ★  start  cmp_luasnip 0.02ms - ★  start  LuaSnip 9.61ms - ‒  friendly-snippets 0.08ms - ‒  LuaSnip/plugin/luasnip.lua 3.01ms - ‒  LuaSnip/plugin/luasnip.vim 0.03ms - ★  start  nvim-autopairs 0.54ms - ★  start  cmp-spell 0.03ms - ★  start  cmp-nvim-lsp 0.18ms - ★  start  presence.nvim 1.95ms - ‒  presence.nvim/plugin/presence.vim 1.26ms - ★  start  cmp-cmdline 0.08ms - ★  start  mkdir.nvim 0.39ms - ‒  mkdir.nvim/plugin/mkdir.lua 0.04ms - ★  start  cmp-nvim-lsp-signature-help 0.05ms - ★  start  cmp-buffer 0.15ms - ★  start  nvim-jdtls 0.14ms - ‒  nvim-jdtls/plugin/nvim_jdtls.vim 0.03ms - ★  start  nvim-yati 0.43ms - ‒  nvim-yati/plugin/nvim-yati.vim 0.3ms - ★  start  surround.nvim 0.54ms - ★  start  cmp-path 0.08ms - ★  start  lsp-colors.nvim 0.64ms - ‒  lsp-colors.nvim/plugin/lsp-colors.vim 0.5ms - ★  start  copilot.vim 0.66ms - ‒  copilot.vim/plugin/copilot.vim 0.62ms - ★  start  which-key.nvim 0.64ms - ‒  which-key.nvim/plugin/which-key.vim 0.01ms - ➜  rtp plugins 1.54ms - ★  runtime/plugin/editorconfig.lua 0.03ms - ★  runtime/plugin/gzip.vim 0.01ms - ★  runtime/plugin/man.lua 0.03ms - ★  runtime/plugin/matchit.vim 0.01ms - ★  runtime/plugin/matchparen.vim 0.01ms - ★  runtime/plugin/netrwPlugin.vim 0.01ms - ★  runtime/plugin/nvim.lua 0.12ms - ★  runtime/plugin/rplugin.vim 0.14ms - ★  runtime/plugin/shada.vim 1.03ms - ★  runtime/plugin/spellfile.vim 0.01ms - ★  runtime/plugin/tarPlugin.vim 0.01ms - ★  runtime/plugin/tohtml.vim 0.01ms - ★  runtime/plugin/tutor.vim 0.01ms - ★  runtime/plugin/zipPlugin.vim 0.01ms - ➜  after 0.73ms - ★  after/plugin/cmp_path.lua 0.11ms - ★  after/plugin/cmp_buffer.lua 0.15ms - ★  after/plugin/cmp_nvim_lsp_signature_help.lua 0.05ms - ★  after/plugin/cmp_cmdline.lua 0.07ms - ★  after/plugin/cmp_nvim_lsp.lua 0.06ms - ★  after/plugin/cmp-spell.lua 0.04ms - ★  after/plugin/cmp_luasnip.lua 0.1ms - ★  after/plugin/matchit.vim 0.01ms - ●  windline.nvim 0.05ms - ●  VimEnter 1.52ms - ➜  noice.nvim 1.46ms - ★  nui.nvim 0.23ms - ★  nvim-notify 0.95ms - ●  nvim-navic 60.85ms - ➜  nvim-lspconfig 60.58ms - ★  nvim-lspconfig/plugin/lspconfig.lua 0.59ms - ★  neodev.nvim 0.05ms - ●  VeryLazy 30.04ms - ➜  nvimux 1.43ms - ➜  tokyonight.nvim 0.08ms - ➜  sonokai 0.18ms - ➜  hlargs.nvim 1.15ms - ➜  tabout.nvim 1.16ms - ★  tabout.nvim/plugin/tabout.vim 0.05ms - ➜  telescope.nvim 25.99ms - ★  telescope-fzf-native.nvim 0.24ms - ★  telescope-ui-select.nvim 0.24ms - ★  telescope-file-browser.nvim 0.22ms - ★  telescope-project.nvim 0.18ms - ★  telescope.nvim/plugin/telescope.lua 0.15ms + ●  lazy.nvim 6.38ms + ➜  module 0.94ms + ➜  config 0.13ms + ➜  spec 2.7ms + ★  pkg 0.06ms + ★  resolve plugins 0.69ms + ➜  state 0.32ms + ➜  install 0.04ms + ➜  handlers 1.98ms + ★  rust.vim/ftdetect/rust.vim 0.08ms + ●  startup 7.43ms + ➜  runtime/filetype.lua 0.2ms + ➜  init 0.06ms + ★  init  snacks.nvim 0ms + ➜  start 6.35ms + ★  start  snacks.nvim 0.69ms + ‒  snacks.nvim/plugin/snacks.lua 0.38ms + ★  start  nvim-treesitter 4.24ms + ‒  nvim-treesitter/plugin/nvim-treesitter.lua 2.58ms + ‒  nvim-ts-context-commentstring 0.14ms + ●  nvim-ts-context-commentstring/plugin/ts_context_commentstring.lua 0.09ms + ★  start  nvim-coverage 1.37ms + ‒  plenary.nvim 0.18ms + ●  plenary.nvim/plugin/plenary.vim 0.05ms + ➜  rtp plugins 0.78ms + ★  runtime/plugin/editorconfig.lua 0.06ms + ★  runtime/plugin/gzip.vim 0.03ms + ★  runtime/plugin/man.lua 0.06ms + ★  runtime/plugin/matchit.vim 0.03ms + ★  runtime/plugin/matchparen.vim 0.09ms + ★  runtime/plugin/netrwPlugin.vim 0.03ms + ★  runtime/plugin/osc52.lua 0.06ms + ★  runtime/plugin/rplugin.vim 0.1ms + ★  runtime/plugin/shada.vim 0.05ms + ★  runtime/plugin/spellfile.vim 0.03ms + ★  runtime/plugin/tarPlugin.vim 0.03ms + ★  runtime/plugin/tohtml.lua 0.07ms + ★  runtime/plugin/tutor.vim 0.03ms + ★  runtime/plugin/zipPlugin.vim 0.05ms + ➜  after 0.03ms + ●  nvim-web-devicons 0.12ms + ➜  nvim-web-devicons/plugin/nvim-web-devicons.vim 0.06ms + ●  startuptime 47.15ms + ●  VeryLazy 42.56ms + ➜  render-markdown.nvim 9.53ms + ★  mini.icons 0.12ms + ★  render-markdown.nvim/plugin/render-markdown.lua 9.34ms + ‒  nvim-cmp 6.33ms + ●  cmp_luasnip 2.59ms + ➜  after/plugin/cmp_luasnip.lua 2.41ms + ●  cmp-spell 0.38ms + ➜  after/plugin/cmp-spell.lua 0.33ms + ●  cmp-path 0.35ms + ➜  after/plugin/cmp_path.lua 0.27ms + ●  cmp-nvim-lsp 0.44ms + ➜  after/plugin/cmp_nvim_lsp.lua 0.34ms + ●  cmp-buffer 0.52ms + ➜  after/plugin/cmp_buffer.lua 0.45ms + ●  cmp-cmdline 0.45ms + ➜  after/plugin/cmp_cmdline.lua 0.4ms + ●  cmp-nvim-lsp-signature-help 0.34ms + ➜  after/plugin/cmp_nvim_lsp_signature_help.lua 0.28ms + ●  nvim-cmp-lua-latex-symbols 0.45ms + ➜  after/plugin/cmp-lua-latex-symbols.lua 0.4ms + ●  nvim-cmp/plugin/cmp.lua 0.21ms + ➜  smear-cursor.nvim 0.62ms + ➜  noice.nvim 1.17ms + ★  nui.nvim 0.24ms + ★  nvim-notify 0.18ms + ➜  windline.nvim 2ms + ➜  todo-comments.nvim 0.88ms + ★  todo-comments.nvim/plugin/todo.vim 0.05ms + ➜  hlargs.nvim 1.11ms + ➜  gitsigns.nvim 1.32ms + ➜  mini.surround 0.82ms + ➜  mini.pairs 1.33ms + ➜  copilot.vim 0.37ms + ★  copilot.vim/plugin/copilot.vim 0.23ms + ➜  lsp-lens.nvim 1.79ms + ➜  which-key.nvim 0.54ms + ★  which-key.nvim/plugin/which-key.lua 0.06ms + ➜  ChatGPT.nvim 14.41ms + ★  telescope.nvim 8.67ms + ‒  telescope-fzf-native.nvim 0.2ms + ‒  telescope-ui-select.nvim 0.22ms + ‒  telescope-file-browser.nvim 0.19ms + ‒  telescope-project.nvim 0.21ms + ‒  telescope.nvim/plugin/telescope.lua 0.15ms + ★  ChatGPT.nvim/plugin/chatgpt.lua 0.09ms + ★  trouble.nvim 1.4ms + ➜  nvim-yati 0.76ms + ★  nvim-yati/plugin/nvim-yati.vim 0.65ms + ➜  gitlinker.nvim 0.04ms + ➜  tabout.nvim 1.19ms + ★  tabout.nvim/plugin/tabout.lua 0.08ms + ➜  nvim-pqf 0.6ms + ➜  stabilize.nvim 0.58ms + ➜  flash.nvim 1.82ms + ➜  cmp_luasnip 0.01ms + ➜  Stabilize 0ms + ●  lspkind-nvim 1.98ms