From 20ee6d8f95df41d1aba29f1a5c143a8e55e6f8cf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 23:01:27 +0200 Subject: [PATCH] refactor: neovim plugins --- nvim/init.lua | 4 +- nvim/lazy-lock.json | 122 ++++++++--------- nvim/lazyvim.json | 16 +-- nvim/lua/config/keymaps.lua | 2 +- nvim/lua/config/options.lua | 1 + nvim/lua/plugins/coding.lua | 70 ---------- nvim/lua/plugins/colorscheme.lua | 33 +---- nvim/lua/plugins/lsp.lua | 126 +---------------- nvim/lua/plugins/noice.lua | 55 -------- nvim/lua/plugins/telescope.lua | 9 -- nvim/lua/plugins/tmp.lua | 106 +++++++------- nvim/lua/plugins/tools.lua | 41 +----- nvim/lua/plugins/treesitter.lua | 28 +++- nvim/lua/plugins/ui.lua | 228 +++++++++++++++++-------------- 14 files changed, 279 insertions(+), 562 deletions(-) delete mode 100644 nvim/lua/plugins/noice.lua diff --git a/nvim/init.lua b/nvim/init.lua index 2d6c65e9..9e7f90f4 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -23,12 +23,10 @@ require("config.lazy")({ debug = false, profiling = { loader = false, - require = false, + require = true, }, }) -_G.lv = require("lazyvim.util") - -- require("util.dashboard").setup() vim.api.nvim_create_autocmd("User", { diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 68a8253e..50091ae7 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,82 +1,70 @@ { - "ChatGPT.nvim": { "branch": "main", "commit": "df53728e05129278d6ea26271ec086aa013bed90" }, - "SchemaStore.nvim": { "branch": "main", "commit": "88355559bb42cc8e4f6ca7b624dc4c3b654c5c08" }, - "bufferline.nvim": { "branch": "main", "commit": "615aeb04ae73d827e2cc0c35fa5ba15f2b77f4bb" }, - "catppuccin": { "branch": "main", "commit": "045e3499d9ec8d84635fb08877ae44fd33f6a38d" }, + "SchemaStore.nvim": { "branch": "main", "commit": "4d30877ccb3499e74d3a835956258e51501785ff" }, + "bufferline.nvim": { "branch": "main", "commit": "73edc1f2732678e7a681e3d3be49782610914f6b" }, + "catppuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-emoji": { "branch": "main", "commit": "0acd702358230abeb6576769f7116e766bca28a0" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "codeium.nvim": { "branch": "main", "commit": "cd5913ff5481229b15186293d1d46dd9500789f9" }, - "conform.nvim": { "branch": "master", "commit": "34b81e70da83e26c048290204de44268eb59814e" }, + "conform.nvim": { "branch": "master", "commit": "00f9d91391b04b1935e2f15948bd96cc111e7d3a" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, - "dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" }, - "dial.nvim": { "branch": "master", "commit": "27eb570085db2ef44bff4f620d3806039184651c" }, - "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, - "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, - "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, - "gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" }, + "dashboard-nvim": { "branch": "master", "commit": "5182c09ac8085dc73b78ad0ea9f5479c9a866fc4" }, + "dial.nvim": { "branch": "master", "commit": "7af2daaaf933b0617ded0f78b49f4d5fc45f9f64" }, + "diffview.nvim": { "branch": "main", "commit": "ad03c42b2899117ff039d84ac24860a77116204b" }, + "dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" }, + "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, - "inc-rename.nvim": { "branch": "main", "commit": "6f9b5f9cb237e12935144cdc535322b8c93c1b25" }, - "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, - "lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" }, + "inc-rename.nvim": { "branch": "main", "commit": "7c6125b1ee476b56708a6518a37b2a3357f57bfc" }, + "indent-blankline.nvim": { "branch": "master", "commit": "ece00d5fb44d196680a81fd2761062d2fa44663b" }, + "log-highlight.nvim": { "branch": "main", "commit": "c18d1fd20c411f9fd9702d6d0d09edf3faa2bb96" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, - "mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" }, - "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" }, + "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "mini-git": { "branch": "main", "commit": "746696dd5db769cf6c809995adaab7cbfcdf6492" }, + "mini.ai": { "branch": "main", "commit": "a0262e61f79dfc7bb940d1719c00b0ede042ddd7" }, + "mini.align": { "branch": "main", "commit": "b820379e333da87b4ee1eca41792aecea998eee3" }, "mini.animate": { "branch": "main", "commit": "82519630b2760ffc516ebc387bef632f9c07b9f5" }, - "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, - "mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" }, - "mini.hipatterns": { "branch": "main", "commit": "0a72439dbded766af753a3e7ec0a5b21d0f8ada0" }, - "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, - "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, - "mini.pick": { "branch": "main", "commit": "3276a2d9e8b28e0d3ce89ee4c547cea3745961ba" }, - "mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" }, - "muren.nvim": { "branch": "main", "commit": "818c09097dba1322b2ca099e35f7471feccfef93" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "459c60317cc1d251f6eb3b6f010d015d5d24b806" }, - "neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" }, + "mini.diff": { "branch": "main", "commit": "10cc9d370737b8b8c8d996fc537394635da0a4b1" }, + "mini.hipatterns": { "branch": "main", "commit": "088bbfef23e17934080f125751a94a2758ba7fdf" }, + "mini.pairs": { "branch": "main", "commit": "5c975d8f68dc1e11bf4b20ced71e7987ed782513" }, + "mini.surround": { "branch": "main", "commit": "c52aa751daf62d4a9e6ee24c4a91882ef6842f99" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "7aad1bf3f6b849cbf108e02c55ad4d701cb4d33a" }, + "neotest": { "branch": "master", "commit": "420288eb84d228986131d3e6ac1d099514bc502c" }, "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, - "neotest-vitest": { "branch": "main", "commit": "ae774282a592b872e84ffdcc5b4d11fc991eca7b" }, - "nerdy.nvim": { "branch": "main", "commit": "1ad36242f40a8fd95ae5711258540a07a5dabb51" }, - "nui.nvim": { "branch": "main", "commit": "756c59f46057cd2d43619cd3a6d4e01b2aa60295" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" }, - "nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "a5fc69240869c0fee8ff176bc9e4efdf8bdfb596" }, - "nvim-lint": { "branch": "master", "commit": "e824adb9bc01647f71e55457353a68f0f37f9931" }, - "nvim-lspconfig": { "branch": "master", "commit": "e5e600232188ed9fb960f5df6bb06084ae8bf3ec" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-rulebook": { "branch": "main", "commit": "5502f021d1d381eb73bc9ee515056fb86a49fcdd" }, - "nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" }, - "nvim-treesitter": { "branch": "master", "commit": "c09932bd2de01dc9c01e870fe83060693c67de13" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b8b7e52c1517d401d7c519787d5dc4528c41291a" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, - "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, - "octo.nvim": { "branch": "master", "commit": "feae1e5519deebad3c59ee1d57d28aa22822f7c8" }, - "omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "4be2e8689067494ed7e5a4f1221adc31d1a07783" }, - "one-small-step-for-vimkind": { "branch": "main", "commit": "aaee281bdaa3141d9d0cdb3dec468532da61124f" }, - "oxocarbon.nvim": { "branch": "main", "commit": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2" }, + "neotest-python": { "branch": "master", "commit": "2e83d2bc00acbcc1fd529dbf0a0e677cabfe6b50" }, + "neotest-vitest": { "branch": "main", "commit": "6965a714793d9d156dadbe734c99b3a307f65c61" }, + "nerdy.nvim": { "branch": "main", "commit": "7d256222fda0031feae405f14d7a9414c7b6529f" }, + "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" }, + "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" }, + "nvim-dap-python": { "branch": "master", "commit": "3dffa58541d1f52c121fe58ced046268c838d802" }, + "nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" }, + "nvim-lint": { "branch": "master", "commit": "5697e6cb9588b70e260e4cc1f833ebb0bdc07617" }, + "nvim-lspconfig": { "branch": "master", "commit": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98" }, + "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" }, + "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, + "nvim-rulebook": { "branch": "main", "commit": "c317b4b7f96003f0773ef48e546a36c86dcd5dd6" }, + "nvim-snippets": { "branch": "main", "commit": "8810c044f76c7ab5fdf9e258090f1f5dac8b1c5d" }, + "nvim-spectre": { "branch": "master", "commit": "50e96602153f14c913e1969aaf9720e080394eb3" }, + "nvim-treesitter": { "branch": "master", "commit": "73fb37ed77b18ac357ca8e6e35835a8db6602332" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" }, + "nvim-ts-autotag": { "branch": "main", "commit": "62db4b3054ec6847e5cb189b4dea452ce0c7ad7f" }, + "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, + "octo.nvim": { "branch": "master", "commit": "5646539320cd62af6ff28f48ec92aeb724c68e18" }, + "one-small-step-for-vimkind": { "branch": "main", "commit": "0dd306e68bf79b38cc01b15c22047e6a867df7de" }, "perfanno.nvim": { "branch": "master", "commit": "b138718bf4289b429dc81cadaf80ace8221c647b" }, - "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, - "qmk.nvim": { "branch": "main", "commit": "67c1a94b10f7266ac01b0a2431dade70693edba9" }, - "rose-pine": { "branch": "main", "commit": "a29b09d15a9ef5cd575fbe5ae2a3cfb854876caf" }, - "sqlite.lua": { "branch": "master", "commit": "40701b6151f8883980c1548647116de39b763540" }, - "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" }, - "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "qmk.nvim": { "branch": "main", "commit": "cfa6cecae362d23778cd97317d33ab12671e157c" }, + "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope-undo.nvim": { "branch": "main", "commit": "d3afc1c105535a90caec092ce27a113f77ba7b84" }, - "telescope.nvim": { "branch": "master", "commit": "dc1ea28cc2a02cd1cebb9d80e967807d668f78f8" }, + "telescope.nvim": { "branch": "master", "commit": "4aed63995a69e343b068c7469491a8d1592c339f" }, "tree-sitter-caddy": { "branch": "master", "commit": "65b60437983933d00809c8927e7d8a29ca26dfa3" }, - "tree-sitter-hyprlang": { "branch": "master", "commit": "fc1d331586e4da2b5f5bcfa89d630ebafe66458b" }, - "tree-sitter-just": { "branch": "main", "commit": "43f2c5efb96e51bbd8e64284662911b60849df00" }, - "treesj": { "branch": "main", "commit": "60e27280030f9cd8dfb6ceb335922c6ff76682cc" }, - "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, - "vim-startuptime": { "branch": "master", "commit": "308b0088a864c4711a96e45b6734cf9294074f65" }, + "tree-sitter-just": { "branch": "main", "commit": "fd814fc6c579f68c2a642f5e0268cf69daae92d7" }, + "treesj": { "branch": "main", "commit": "e1e82ab4237619d342c7102c9f13d4b9833bfd39" }, + "venv-selector.nvim": { "branch": "main", "commit": "6a1b15eb35bbb827b6db428055087e2dbf32838f" }, "wezterm-types": { "branch": "main", "commit": "1518752906ba3fac0060d9efab6e4d3ec15d4b5a" }, - "yanky.nvim": { "branch": "main", "commit": "7c5cbf0122ff2dfbb6a92f14885894f65949cc8b" } + "yanky.nvim": { "branch": "main", "commit": "396ff7ed952a69549f299c7b6f64615a89836733" } } \ No newline at end of file diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index b886d77b..053387bd 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -2,16 +2,16 @@ "extras": [ "lazyvim.plugins.extras.dap.core", "lazyvim.plugins.extras.test.core", - "lazyvim.plugins.extras.coding.codeium", "lazyvim.plugins.extras.coding.copilot", - "lazyvim.plugins.extras.coding.native_snippets", + "lazyvim.plugins.extras.coding.mini-surround", "lazyvim.plugins.extras.coding.yanky", "lazyvim.plugins.extras.dap.nlua", - "lazyvim.plugins.extras.editor.trouble-v3", + "lazyvim.plugins.extras.editor.dial", + "lazyvim.plugins.extras.editor.mini-diff", "lazyvim.plugins.extras.formatting.prettier", "lazyvim.plugins.extras.lang.json", "lazyvim.plugins.extras.lang.markdown", - "lazyvim.plugins.extras.lang.omnisharp", + "lazyvim.plugins.extras.lang.python", "lazyvim.plugins.extras.lang.tailwind", "lazyvim.plugins.extras.lang.typescript", "lazyvim.plugins.extras.lang.yaml", @@ -20,11 +20,11 @@ "lazyvim.plugins.extras.ui.mini-animate", "lazyvim.plugins.extras.util.dot", "lazyvim.plugins.extras.util.mini-hipatterns", - "lazyvim.plugins.extras.vscode" + "lazyvim.plugins.extras.editor.trouble-v3" ], "news": { - "NEWS.md": "2123", - "doc/news.txt": "24277" + "NEWS.md": "4964", + "doc/news.txt": "2502" }, - "version": 2 + "version": 4 } \ No newline at end of file diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index 9190cef0..1bc0f468 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -14,7 +14,7 @@ local function navigate(dir) local win = vim.api.nvim_get_current_win() vim.cmd.wincmd(dir) local pane = vim.env.WEZTERM_PANE - if pane and win == vim.api.nvim_get_current_win() then + if vim.system and pane and win == vim.api.nvim_get_current_win() then local pane_dir = nav[dir] vim.system({ "wezterm", "cli", "activate-pane-direction", pane_dir }, { text = true }, function(p) if p.code ~= 0 then diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 147f472e..6d1132d5 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -29,6 +29,7 @@ vim.keymap.set = function(mode, lhs, rhs, opts) end vim.g.lazyvim_python_lsp = "basedpyright" +vim.g.lazyvim_python_ruff = "ruff" if vim.fn.has("win32") == 1 then LazyVim.terminal.setup("pwsh") end diff --git a/nvim/lua/plugins/coding.lua b/nvim/lua/plugins/coding.lua index 2118acf3..713aacff 100644 --- a/nvim/lua/plugins/coding.lua +++ b/nvim/lua/plugins/coding.lua @@ -10,62 +10,6 @@ return { cmd = "IncRename", config = true, }, - - -- { - -- "echasnovski/mini.bracketed", - -- event = "BufReadPost", - -- enabled = false, - -- config = function() - -- local bracketed = require("mini.bracketed") - -- bracketed.setup({ - -- file = { suffix = "" }, - -- window = { suffix = "" }, - -- quickfix = { suffix = "" }, - -- yank = { suffix = "" }, - -- treesitter = { suffix = "n" }, - -- }) - -- end, - -- }, - - -- better increase/descrease - { - "monaqa/dial.nvim", - -- stylua: ignore - keys = { - { "", function() return require("dial.map").inc_normal() end, expr = true, desc = "Increment" }, - { "", function() return require("dial.map").dec_normal() end, expr = true, desc = "Decrement" }, - }, - config = function() - local augend = require("dial.augend") - require("dial.config").augends:register_group({ - default = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.date.alias["%Y/%m/%d"], - augend.constant.alias.bool, - augend.semver.alias.semver, - augend.constant.new({ elements = { "let", "const" } }), - augend.constant.new({ elements = { "True", "False" } }), - }, - }) - end, - }, - - -- { - -- "simrat39/symbols-outline.nvim", - -- keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - -- cmd = "SymbolsOutline", - -- opts = {}, - -- }, - - { - "nvim-cmp", - dependencies = { "hrsh7th/cmp-emoji" }, - opts = function(_, opts) - table.insert(opts.sources, { name = "emoji" }) - end, - }, - { "Wansmer/treesj", keys = { @@ -73,18 +17,4 @@ return { }, opts = { use_default_keymaps = false, max_join_length = 150 }, }, - - { - "cshuaimin/ssr.nvim", - keys = { - { - "sR", - function() - require("ssr").open() - end, - mode = { "n", "x" }, - desc = "Structural Replace", - }, - }, - }, } diff --git a/nvim/lua/plugins/colorscheme.lua b/nvim/lua/plugins/colorscheme.lua index 456f77b7..aa0bfdbf 100644 --- a/nvim/lua/plugins/colorscheme.lua +++ b/nvim/lua/plugins/colorscheme.lua @@ -1,10 +1,6 @@ return { - { "shaunsingh/oxocarbon.nvim" }, - { "ellisonleao/gruvbox.nvim" }, - { "rose-pine/neovim", name = "rose-pine" }, { "tokyonight.nvim", - priority = 1000, opts = function() return { style = "moon", @@ -21,36 +17,9 @@ return { "startuptime", "Outline", }, - on_colors = function(c) - -- local hsluv = require("tokyonight.hsluv") - -- local function randomColor(color) - -- if color ~= "NONE" then - -- local hsl = hsluv.hex_to_hsluv(color) - -- hsl[1] = math.random(0, 360) - -- return hsluv.hsluv_to_hex(hsl) - -- end - -- return color - -- end - -- local function set(colors) - -- if type(colors) == "table" then - -- for k, v in pairs(colors) do - -- if type(v) == "string" then - -- colors[k] = randomColor(v) - -- elseif type(v) == "table" then - -- set(v) - -- end - -- end - -- end - -- end - -- set(c) - end, on_highlights = function(hl, c) - hl.CursorLineNr = { fg = c.orange, bold = true } - -- hl.LineNr = { fg = c.orange, bold = true } - hl.LineNrAbove = { fg = c.fg_gutter } - hl.LineNrBelow = { fg = c.fg_gutter } local prompt = "#2d3149" - hl.TelescopeNormal = { bg = c.bg_dark, fg = c.fg_dark } + hl.TelescopeNormal = { bg = c.bg_dark, fg = c.fg } hl.TelescopeBorder = { bg = c.bg_dark, fg = c.bg_dark } hl.TelescopePromptNormal = { bg = prompt } hl.TelescopePromptBorder = { bg = prompt, fg = prompt } diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 9a977349..df16842a 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -1,37 +1,20 @@ +---@diagnostic disable: missing-fields return { -- neodev { "folke/neodev.nvim", opts = { - debug = true, - experimental = { - pathStrict = true, - }, library = { runtime = "~/projects/neovim/runtime/", }, }, }, - -- tools - { - "williamboman/mason.nvim", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { - "stylua", - "selene", - "luacheck", - "shellcheck", - "shfmt", - }) - end, - }, - -- lsp servers { "neovim/nvim-lspconfig", opts = { - inlay_hints = { enabled = true }, + diagnostics = { virtual_text = { prefix = "icons" } }, capabilities = { workspace = { didChangeWatchedFiles = { @@ -53,92 +36,12 @@ return { return require("lspconfig.util").root_pattern(".git")(...) end, }, - tsserver = { - -- root_dir = function(...) - -- return require("lspconfig.util").root_pattern(".git")(...) - -- end, - single_file_support = false, - settings = { - typescript = { - inlayHints = { - includeInlayParameterNameHints = "literal", - includeInlayParameterNameHintsWhenArgumentMatchesName = false, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = false, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - }, - }, - javascript = { - inlayHints = { - includeInlayParameterNameHints = "all", - includeInlayParameterNameHintsWhenArgumentMatchesName = false, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - }, - }, - }, - }, - -- svelte = {}, html = {}, - -- gopls = {}, - marksman = {}, - -- pyright = { - -- enabled = false, - -- }, - -- rust_analyzer = { - -- settings = { - -- ["rust-analyzer"] = { - -- procMacro = { enable = true }, - -- cargo = { allFeatures = true }, - -- checkOnSave = { - -- command = "clippy", - -- extraArgs = { "--no-deps" }, - -- }, - -- }, - -- }, - -- }, - yamlls = { - settings = { - yaml = { - keyOrdering = false, - }, - }, - }, lua_ls = { - -- enabled = false, - -- cmd = { "/home/folke/projects/lua-language-server/bin/lua-language-server" }, single_file_support = true, settings = { Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - workspaceWord = true, - callSnippet = "Both", - }, - misc = { - parameters = { - -- "--log-level=trace", - }, - }, hover = { expandAlias = false }, - hint = { - enable = true, - setType = false, - paramType = true, - paramName = "Disable", - semicolon = "Disable", - arrayIndex = "Disable", - }, - doc = { - privateName = { "^_" }, - }, type = { castNumberToInteger = true, }, @@ -165,27 +68,10 @@ return { }, unusedLocalExclude = { "_*" }, }, - format = { - enable = true, - defaultConfig = { - indent_style = "space", - indent_size = "2", - continuation_indent_size = "2", - }, - }, }, }, }, - vimls = {}, }, - setup = {}, - }, - }, - - { - "neovim/nvim-lspconfig", - opts = { - diagnostics = { virtual_text = { prefix = "icons" } }, }, }, @@ -194,19 +80,14 @@ return { optional = true, opts = { formatters_by_ft = { - ["markdown"] = { { "prettierd", "prettier" }, "markdownlint" }, - ["markdown.mdx"] = { { "prettierd", "prettier" } }, ["javascript"] = { "dprint", { "prettierd", "prettier" } }, ["javascriptreact"] = { "dprint" }, ["typescript"] = { "dprint", { "prettierd", "prettier" } }, ["typescriptreact"] = { "dprint" }, }, formatters = { - shfmt = { - prepend_args = { "-i", "2", "-ci" }, - }, dprint = { - condition = function(self, ctx) + condition = function(_, ctx) return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1] end, }, @@ -218,7 +99,6 @@ return { opts = { linters_by_ft = { lua = { "selene", "luacheck" }, - markdown = { "markdownlint" }, }, linters = { selene = { diff --git a/nvim/lua/plugins/noice.lua b/nvim/lua/plugins/noice.lua deleted file mode 100644 index e6ff3711..00000000 --- a/nvim/lua/plugins/noice.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - "folke/noice.nvim", - opts = function(_, opts) - table.insert(opts.routes, { - filter = { - event = "notify", - find = "No information available", - }, - opts = { skip = true }, - }) - local focused = true - vim.api.nvim_create_autocmd("FocusGained", { - callback = function() - focused = true - end, - }) - vim.api.nvim_create_autocmd("FocusLost", { - callback = function() - focused = false - end, - }) - table.insert(opts.routes, 1, { - filter = { - ["not"] = { - event = "lsp", - kind = "progress", - }, - cond = function() - return not focused - end, - }, - view = "notify_send", - opts = { stop = false }, - }) - - opts.commands = { - all = { - -- options for the message history that you get with `:Noice` - view = "split", - opts = { enter = true, format = "details" }, - filter = {}, - }, - } - -- opts.status = { lsp_progress = { event = "lsp", kind = "progress" } } - - vim.api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function(event) - vim.schedule(function() - require("noice.text.markdown").keys(event.buf) - end) - end, - }) - end, -} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index ed814006..e37ed3c8 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,15 +1,6 @@ return { { "telescope.nvim", - dependencies = { - { - "debugloop/telescope-undo.nvim", - keys = { { "U", "Telescope undo" } }, - config = function() - require("telescope").load_extension("undo") - end, - }, - }, keys = { { "fp", diff --git a/nvim/lua/plugins/tmp.lua b/nvim/lua/plugins/tmp.lua index ed8d2c7c..2d3ab38c 100644 --- a/nvim/lua/plugins/tmp.lua +++ b/nvim/lua/plugins/tmp.lua @@ -1,13 +1,56 @@ --- vim.keymap.set("n", "w", "lua vim.notify('hi')", { desc = "foooo" }) --- vim.keymap.set("n", ";", ":") -vim.schedule(function() - -- dd(require("null-ls")) -end) return { + { + "folke/trouble.nvim", + opts = { debug = true }, + }, + { + "fei6409/log-highlight.nvim", + event = "BufRead *.log", + opts = {}, + }, + -- { + -- enabled = false, + -- "nvimdev/indentmini.nvim", + -- opts = { + -- exclude = { + -- "help", + -- "alpha", + -- "dashboard", + -- "neo-tree", + -- "Trouble", + -- "trouble", + -- "lazy", + -- "mason", + -- "notify", + -- "toggleterm", + -- "lazyterm", + -- }, + -- }, + -- event = "LazyFile", + -- }, + { + "t-troebst/perfanno.nvim", + opts = function() + local util = require("perfanno.util") + local hl = vim.api.nvim_get_hl(0, { name = "Normal" }) + local bg = string.format("#%06x", hl.bg) + local fg = "#dc2626" + return { + line_highlights = util.make_bg_highlights(bg, fg, 10), + vt_highlight = util.make_fg_highlight(fg), + } + end, + cmd = "PerfLuaProfileStart", + }, + { + "akinsho/bufferline.nvim", + opts = { + options = { + separator_style = "slope", + }, + }, + }, { "justinsgithub/wezterm-types" }, - -- { "LazyVim/LazyVim", dev = false }, - -- { "folke/tokyonight.nvim", dev = false }, - { "echasnovski/mini.align", opts = {}, @@ -23,56 +66,9 @@ return { { "ci", "Nerdy", desc = "Pick Icon" }, }, }, - { - "echasnovski/mini.pick", - cmd = "Pick", - opts = {}, - }, - -- { "stevearc/aerial.nvim", dev = true }, - -- { - -- "echasnovski/nvim", - -- name = "mini.dev", - -- submodules = false, - -- config = function() - -- require("mini-dev.pick").setup() - -- end, - -- init = function() - -- vim.api.nvim_create_user_command("Pick", function(cmd) - -- require("mini-dev.pick").builtin[cmd.args]() - -- end, { - -- nargs = "?", - -- complete = function(_, line) - -- local prefix = vim.split(vim.trim(line), "%s+")[2] or "" - -- ---@param key string - -- return vim.tbl_filter(function(key) - -- return key:find(prefix, 1, true) == 1 - -- end, vim.tbl_keys(require("mini-dev.pick").builtin)) - -- end, - -- }) - -- end, - -- }, - { - "AckslD/muren.nvim", - event = { - { "BufNewFile", "BufAdd" }, - }, - opts = { - patterns_width = 60, - patterns_height = 20, - options_width = 40, - preview_height = 24, - }, - cmd = "MurenToggle", - }, - -- { "ggandor/leap.nvim" }, - -- { "3rd/image.nvim", opts = {}, ft = "markdown", lazy = false, enabled = true }, { "folke/flash.nvim", enabled = true, - init = function() - -- vim.keymap.set("n", "x", "lua require('flash').jump()") - -- vim.opt.keymap = "emoji" - end, ---@type Flash.Config opts = { -- labels = "#abcdef", diff --git a/nvim/lua/plugins/tools.lua b/nvim/lua/plugins/tools.lua index cef42cbd..21e3afdd 100644 --- a/nvim/lua/plugins/tools.lua +++ b/nvim/lua/plugins/tools.lua @@ -1,42 +1,15 @@ return { - { "pwntester/octo.nvim", opts = {}, cmd = "Octo" }, - - -- markdown preview + -- { "pwntester/octo.nvim", opts = {}, cmd = "Octo" }, + -- + -- -- better diffing -- { - -- "toppair/peek.nvim", - -- build = "deno task --quiet build:fast", - -- keys = { - -- { - -- "cp", - -- ft = "markdown", - -- function() - -- local peek = require("peek") - -- if peek.is_open() then - -- peek.close() - -- else - -- peek.open() - -- end - -- end, - -- desc = "Peek (Markdown Preview)", - -- }, - -- }, - -- opts = { theme = "light" }, + -- "sindrets/diffview.nvim", + -- cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" }, + -- opts = {}, + -- keys = { { "gd", "DiffviewOpen", desc = "DiffView" } }, -- }, - -- better diffing - { - "sindrets/diffview.nvim", - cmd = { "DiffviewOpen", "DiffviewClose", "DiffviewToggleFiles", "DiffviewFocusFiles" }, - opts = {}, - keys = { { "gd", "DiffviewOpen", desc = "DiffView" } }, - }, - - { - "jackMort/ChatGPT.nvim", - cmd = { "ChatGPTActAs", "ChatGPT" }, - opts = {}, - }, { "codethread/qmk.nvim", ft = "dts", diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index cd191726..7b20cb8e 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -1,6 +1,4 @@ return { - -- { "nvim-treesitter/playground", cmd = "TSPlaygroundToggle" }, - { "nvim-treesitter/nvim-treesitter", opts = function(_, opts) @@ -29,4 +27,30 @@ return { }) end, }, + { "IndianBoy42/tree-sitter-just", ft = "just", opts = {} }, + { + "https://github.com/Samonitari/tree-sitter-caddy", + dependencies = { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + require("nvim-treesitter.parsers").get_parser_configs().caddy = { + install_info = { + url = "https://github.com/Samonitari/tree-sitter-caddy", + files = { "src/parser.c", "src/scanner.c" }, + branch = "master", + }, + filetype = "caddy", + } + + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "caddy" }) + vim.filetype.add({ + pattern = { + ["Caddyfile"] = "caddy", + }, + }) + end, + }, + event = "BufRead Caddyfile", + }, } diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua index 8e151111..1f4ebb22 100644 --- a/nvim/lua/plugins/ui.lua +++ b/nvim/lua/plugins/ui.lua @@ -1,110 +1,69 @@ return { + { + "folke/noice.nvim", + opts = function(_, opts) + opts.debug = false - -- floating winbar - -- { - -- "b0o/incline.nvim", - -- event = "BufReadPre", - -- -- enabled = false, - -- config = function() - -- local colors = require("tokyonight.colors").setup() - -- require("incline").setup({ - -- highlight = { - -- groups = { - -- InclineNormal = { guibg = "#FC56B1", guifg = colors.black }, - -- InclineNormalNC = { guifg = "#FC56B1", guibg = colors.black }, - -- }, - -- }, - -- window = { margin = { vertical = 0, horizontal = 1 } }, - -- render = function(props) - -- local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t") - -- local icon, color = require("nvim-web-devicons").get_icon_color(filename) - -- return { { icon, guifg = color }, { " " }, { filename } } - -- end, - -- }) - -- end, - -- }, + table.insert(opts.routes, { + filter = { + event = "notify", + find = "No information available", + }, + opts = { skip = true }, + }) + local focused = true + vim.api.nvim_create_autocmd("FocusGained", { + callback = function() + focused = true + end, + }) + vim.api.nvim_create_autocmd("FocusLost", { + callback = function() + focused = false + end, + }) - -- auto-resize windows - { - "anuvyklack/windows.nvim", - enabled = false, - event = "WinNew", - dependencies = { - { "anuvyklack/middleclass" }, - { "anuvyklack/animation.nvim", enabled = false }, - }, - keys = { { "m", "WindowsMaximize", desc = "Zoom" } }, - config = function() - vim.o.winwidth = 5 - vim.o.equalalways = false - require("windows").setup({ - animation = { enable = false, duration = 150 }, + table.insert(opts.routes, 1, { + filter = { + ["not"] = { + event = "lsp", + kind = "progress", + }, + cond = function() + return not focused + end, + }, + view = "notify_send", + opts = { stop = false }, + }) + + vim.api.nvim_create_autocmd("FileType", { + pattern = "markdown", + callback = function(event) + vim.schedule(function() + require("noice.text.markdown").keys(event.buf) + end) + end, }) end, }, - -- scrollbar - -- { "lewis6991/satellite.nvim", opts = {}, event = "VeryLazy", enabled = false }, - -- { - -- "echasnovski/mini.map", - -- main = "mini.map", - -- event = "VeryLazy", - -- enabled = false, - -- config = function() - -- local map = require("mini.map") - -- map.setup({ - -- integrations = { - -- map.gen_integration.builtin_search(), - -- map.gen_integration.gitsigns(), - -- map.gen_integration.diagnostic(), - -- }, - -- }) - -- map.open() - -- end, - -- }, + -- auto-resize windows -- { - -- "petertriho/nvim-scrollbar", - -- event = "BufReadPost", + -- "anuvyklack/windows.nvim", -- enabled = false, - -- config = function() - -- local scrollbar = require("scrollbar") - -- local colors = require("tokyonight.colors").setup() - -- scrollbar.setup({ - -- handle = { color = colors.bg_highlight }, - -- excluded_filetypes = { "prompt", "TelescopePrompt", "noice", "notify" }, - -- marks = { - -- Search = { color = colors.orange }, - -- Error = { color = colors.error }, - -- Warn = { color = colors.warning }, - -- Info = { color = colors.info }, - -- Hint = { color = colors.hint }, - -- Misc = { color = colors.purple }, - -- }, - -- }) - -- end, - -- }, - - -- style windows with different colorschemes - -- { - -- "folke/styler.nvim", - -- event = "VeryLazy", - -- opts = { - -- themes = { - -- -- markdown = { colorscheme = "catppuccin" }, - -- help = { colorscheme = "catppuccin", background = "dark" }, - -- }, + -- event = "WinNew", + -- dependencies = { + -- { "anuvyklack/middleclass" }, + -- { "anuvyklack/animation.nvim", enabled = false }, -- }, - -- }, - - -- silly drops - -- { - -- "folke/drop.nvim", - -- enabled = false, - -- event = "VeryLazy", + -- keys = { { "m", "WindowsMaximize", desc = "Zoom" } }, -- config = function() - -- math.randomseed(os.time()) - -- -- local theme = ({ "stars", "snow" })[math.random(1, 3)] - -- require("drop").setup({ theme = "spring" }) + -- vim.o.winwidth = 5 + -- vim.o.equalalways = false + -- require("windows").setup({ + -- animation = { enable = false, duration = 150 }, + -- }) -- end, -- }, @@ -118,7 +77,7 @@ return { end, }) - ---@type table + ---@type table local mutagen = {} local function mutagen_status() @@ -128,14 +87,37 @@ return { updated = 0, total = 0, enabled = vim.fs.find("mutagen.yml", { path = cwd, upward = true })[1] ~= nil, + status = {}, } local now = vim.uv.now() -- timestamp in milliseconds if mutagen[cwd].enabled and (mutagen[cwd].updated + 10000 < now) then - local sessions = vim.tbl_filter(function(line) - return line:match("^Name: %S*") - end, vim.fn.systemlist("mutagen project list")) + ---@type {name:string, status:string, idle:boolean}[] + local sessions = {} + local lines = vim.fn.systemlist("mutagen project list") + local status = {} + local name = nil + for _, line in ipairs(lines) do + local n = line:match("^Name: (.*)") + if n then + name = n + end + local s = line:match("^Status: (.*)") + if s then + table.insert(sessions, { + name = name, + status = s, + idle = s == "Watching for changes", + }) + end + end + for _, session in ipairs(sessions) do + if not session.idle then + table.insert(status, session.name .. ": " .. session.status) + end + end mutagen[cwd].updated = now mutagen[cwd].total = #sessions + mutagen[cwd].status = status if #sessions == 0 then vim.notify("Mutagen is not running", vim.log.levels.ERROR, { title = "Mutagen" }) end @@ -150,14 +132,54 @@ return { return mutagen_status().enabled end, color = function() - return mutagen_status().total == 0 and error_color or ok_color + return (mutagen_status().total == 0 or mutagen_status().status[1]) and error_color or ok_color end, function() - local total = mutagen_status().total - return (total == 0 and "󰋘 " or "󰋙 ") .. total + local s = mutagen_status() + local msg = s.total + if #s.status > 0 then + msg = msg .. " | " .. table.concat(s.status, " | ") + end + return (s.total == 0 and "󰋘 " or "󰋙 ") .. msg end, }) + -- local keys = {} + -- local in_mapping = false + -- + -- vim.api.nvim_create_autocmd("SafeState", { + -- callback = function() + -- in_mapping = false + -- end, + -- }) + -- + -- vim.on_key(function(_, key) + -- if not key then + -- return + -- end + -- -- local unsafe = not vim.fn.state():find("S") + -- local m = vim.fn.state():find("[moS]") + -- -- if in_mapping and not m then + -- -- in_mapping = false + -- -- return + -- -- end + -- if m and not in_mapping then + -- in_mapping = true + -- keys = {} + -- end + -- if in_mapping then + -- table.insert(keys, key) + -- require("lualine").refresh() + -- vim.cmd.redraw() + -- end + -- end) + -- + -- table.insert(opts.sections.lualine_x, { + -- function() + -- return table.concat(keys, "") + -- end, + -- }) + -- local count = 0 -- table.insert(opts.sections.lualine_x, { -- function()