diff --git a/README.md b/README.md index b93c1ddff..4caf7d73e 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,12 @@ It's strongly recommended to read [Wiki: Prerequisites](https://github.com/ayami


+

+ Code Action + Code Action +

+
+

Debugging Debugging @@ -160,13 +166,13 @@ It's strongly recommended to read [Wiki: Prerequisites](https://github.com/ayami

- Lazygit + Lazygit Lazygit with built-in Terminal


- Legendary + Command quickref Command quickref

diff --git a/init.lua b/init.lua index 67663da8a..15445091f 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,3 @@ if not vim.g.vscode then require("core") - -- Release note end diff --git a/lazy-lock.json b/lazy-lock.json index 38cb1508d..db2183e97 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,92 +1,362 @@ { - "Comment.nvim": { "branch": "master", "commit": "e1fe53117aab24c378d5e6deaad786789c360123" }, - "LuaSnip": { "branch": "master", "commit": "fcdaa4313305fe20d928551134c1ec2266e7af2a" }, - "accelerated-jk.nvim": { "branch": "main", "commit": "8fb5dad4ccc1811766cebf16b544038aeeb7806f" }, - "alpha-nvim": { "branch": "main", "commit": "1838ae926e8d49fe5330d1498ee8289ae2c340bc" }, - "auto-session": { "branch": "main", "commit": "8a7dbcd718086877c7d75d6f36615b34674cad4b" }, - "autoclose.nvim": { "branch": "main", "commit": "c4db42ffc0edbd244502be951c142df0c8a7e582" }, - "better-escape.nvim": { "branch": "master", "commit": "7031dc734add47bb71c010e0551829fa5799375f" }, - "bigfile.nvim": { "branch": "main", "commit": "a34e42616c20bfd52943ed5d6632bb28d22b057e" }, - "bufferline.nvim": { "branch": "main", "commit": "32d74d5d044f7cc89892d4781a83d55ee4ed552a" }, - "catppuccin": { "branch": "main", "commit": "cc517bdcb66a0f8dee90bab10ccdd651fa967bbe" }, - "clever-f.vim": { "branch": "master", "commit": "6a3ac5e3688598af9411ab741737f98c47370c22" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, - "cmp-tmux": { "branch": "main", "commit": "984772716f66d8ee88535a6bf3f94c4b4e1301f5" }, - "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, - "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, - "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "copilot-cmp": { "branch": "master", "commit": "c2cdb3c0f5078b0619055af192295830a7987790" }, - "copilot.lua": { "branch": "master", "commit": "653bbdc44cd569a5fd0617e5a9d3df2b1359e230" }, - "crates.nvim": { "branch": "main", "commit": "3648f8787656d7572740560331553abdaa8cb982" }, - "csv.vim": { "branch": "master", "commit": "15ff93edf5b26c466affbb356e0696b7d6a3b499" }, - "diffview.nvim": { "branch": "main", "commit": "15861892ce62d8f4ab6e72bc4ff5b829f994430a" }, - "edge": { "branch": "master", "commit": "358cb6688ac577470a4eafcb53bdd63899dfc937" }, - "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "focus.nvim": { "branch": "master", "commit": "3d9df42aa4f9b572348418207b752f81adea09a5" }, - "friendly-snippets": { "branch": "main", "commit": "2bb3958e1fe0a613e028f3c6fd2d2923fc23bd0c" }, - "fzy-lua-native": { "branch": "master", "commit": "45148b3f70d244e8b8b5db60df447a2b7ac2de9d" }, - "gitsigns.nvim": { "branch": "main", "commit": "c18b7ca0b5b50596722f3a1572eb9b8eb520c0f1" }, - "hop.nvim": { "branch": "v2", "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" }, - "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, - "knap": { "branch": "main", "commit": "8c083d333b8a82421a521539eb1c450b06c90eb6" }, - "lazy.nvim": { "branch": "main", "commit": "b382495d512fbc6dadbeac8b806efc72db7130e8" }, - "lsp_signature.nvim": { "branch": "master", "commit": "7a26ebaa7e36aa2aefa6c1994b2b866c96de32e6" }, - "lspsaga.nvim": { "branch": "main", "commit": "01b9633aefd010f272d6c7e3d8293c44fcfe7696" }, - "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c55d18f3947562e699d34d89681edbf9f0e250d3" }, - "mason-null-ls.nvim": { "branch": "main", "commit": "54d702020bf94e4eefd357f0b738317af30217eb" }, - "mason.nvim": { "branch": "main", "commit": "08b2fd308e0107eab9f0b59d570b69089fd0b522" }, - "neodim": { "branch": "master", "commit": "89c16fccccfdb5b7e6ad3a6e8286736debc11705" }, - "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, - "nord.nvim": { "branch": "master", "commit": "fab04b2dd4b64f4b1763b9250a8824d0b5194b8f" }, - "null-ls.nvim": { "branch": "main", "commit": "77e53bc3bac34cc273be8ed9eb9ab78bcf67fa48" }, - "nvim-bufdel": { "branch": "main", "commit": "96c4f7ab053ddab0025bebe5f7c71e4795430e47" }, - "nvim-cmp": { "branch": "main", "commit": "3ac8d6cd29c74ff482d8ea47d45e5081bfc3f5ad" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-dap": { "branch": "master", "commit": "56118cee6af15cb9ddba9d080880949d8eeb0c9f" }, - "nvim-dap-ui": { "branch": "master", "commit": "4ce7b97dd8f50b4f672948a34bf8f3a56214fdb8" }, - "nvim-lspconfig": { "branch": "master", "commit": "10142ff298f5fc3f8bf9d277c806593401b0fd06" }, - "nvim-notify": { "branch": "master", "commit": "f3024b912073774111202f5fa6518b0cd2a74432" }, - "nvim-scrollview": { "branch": "main", "commit": "4a04039b80c270f6bd2075935cd3c7943f6ad140" }, - "nvim-tree.lua": { "branch": "master", "commit": "b1e074d2b52d45c8327b5b43a498b3d7e6c93b97" }, - "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "nvim-treesitter": { "branch": "master", "commit": "f2778bd1a28b74adf5b1aa51aa57da85adfa3d16" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "35a60f093fa15a303874975f963428a5cd24e4a0" }, - "nvim-ts-autotag": { "branch": "main", "commit": "40615e96075c743ef47aaf9de966dc348bec6459" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" }, - "nvim-ts-rainbow": { "branch": "master", "commit": "840039440e012ad798ef31349b93a5d4365023ff" }, - "nvim-web-devicons": { "branch": "master", "commit": "e283ab937e0197b37ec5d8013e49495193407324" }, - "paint.nvim": { "branch": "main", "commit": "6ce64212804f425073c61ab0d9c2b034f0435260" }, - "plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" }, - "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, - "rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" }, - "smartyank.nvim": { "branch": "master", "commit": "7e3905578f646503525b2f7018b8afd17861018c" }, - "sniprun": { "branch": "master", "commit": "83791b87a8ede5275a2c060605bf1fec782205cc" }, - "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" }, - "sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" }, - "suda.vim": { "branch": "master", "commit": "08abd39dfe1cee681b8ce3e7321da5fa03e045c1" }, - "tabout.nvim": { "branch": "master", "commit": "0d275c8d25f32457e67b5c66d6ae43f26a61bce5" }, - "telescope-frecency.nvim": { "branch": "master", "commit": "0a4a521471141ae3c94ff0ebcffcaff3c3aad147" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" }, - "telescope-live-grep-args.nvim": { "branch": "master", "commit": "0f75ea809c46af8997c64f49c52e3c641d887885" }, - "telescope-undo.nvim": { "branch": "main", "commit": "231b5ebb4328d2768c830c9a8d1b9c696116848d" }, - "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, - "telescope.nvim": { "branch": "master", "commit": "40c31fdde93bcd85aeb3447bb3e2a3208395a868" }, - "toggleterm.nvim": { "branch": "main", "commit": "26f16d3bab1761d0d11117a8e431faba11a1b865" }, - "trouble.nvim": { "branch": "main", "commit": "2173dffe91fc0914b3b833c6a2f6fe1d3fac2e17" }, - "vim-cool": { "branch": "master", "commit": "80536b9f2e23292708a64f2e7bcf5e596f9faf24" }, - "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "5f0d280b517cacb16f59316659966c7ca5e2bea2" }, - "vim-go": { "branch": "master", "commit": "2a874910a242fd4a5da021ea32fb1cde3b69f79b" }, - "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, - "vim-matchup": { "branch": "master", "commit": "b8eca3b588e41e0bb1b3ae200fae88183b91a76d" }, - "vim-pencil": { "branch": "master", "commit": "6d70438a8886eaf933c38a7a43a61adb0a7815ed" }, - "which-key.nvim": { "branch": "main", "commit": "5a6c954a5a46023c19acc03a8b6d7c3e57964fc5" }, - "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } + "Comment.nvim": { + "branch": "master", + "commit": "c8043290f2d77f61025494d839d88e414608c460" + }, + "LuaSnip": { + "branch": "master", + "commit": "51ebb4b6637290e1b8e0fb0d6f38b605d3c24940" + }, + "accelerated-jk.nvim": { + "branch": "main", + "commit": "8fb5dad4ccc1811766cebf16b544038aeeb7806f" + }, + "alpha-nvim": { + "branch": "main", + "commit": "1838ae926e8d49fe5330d1498ee8289ae2c340bc" + }, + "auto-session": { + "branch": "main", + "commit": "e3234c489397b46a2b7949d6169d61b69a30c015" + }, + "autoclose.nvim": { + "branch": "main", + "commit": "2321727fd10a6b34624723bc4747d8c09c10b7a4" + }, + "better-escape.nvim": { + "branch": "master", + "commit": "7031dc734add47bb71c010e0551829fa5799375f" + }, + "bigfile.nvim": { + "branch": "main", + "commit": "a34e42616c20bfd52943ed5d6632bb28d22b057e" + }, + "bufferline.nvim": { + "branch": "main", + "commit": "02d795081e6a24ec1fd506c513491543793d0780" + }, + "catppuccin": { + "branch": "refactor/syntax-highlighting", + "commit": "c0f7432052a837c6295a7770e39fdc07ede3305c" + }, + "clever-f.vim": { + "branch": "master", + "commit": "6a3ac5e3688598af9411ab741737f98c47370c22" + }, + "cmp-buffer": { + "branch": "main", + "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" + }, + "cmp-latex-symbols": { + "branch": "main", + "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" + }, + "cmp-nvim-lsp": { + "branch": "main", + "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" + }, + "cmp-nvim-lua": { + "branch": "main", + "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" + }, + "cmp-path": { + "branch": "main", + "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" + }, + "cmp-spell": { + "branch": "master", + "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" + }, + "cmp-tmux": { + "branch": "main", + "commit": "984772716f66d8ee88535a6bf3f94c4b4e1301f5" + }, + "cmp-treesitter": { + "branch": "master", + "commit": "c8e3a74b51597d69d240085a258636972ce98e15" + }, + "cmp-under-comparator": { + "branch": "master", + "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" + }, + "cmp_luasnip": { + "branch": "master", + "commit": "18095520391186d634a0045dacaa346291096566" + }, + "copilot-cmp": { + "branch": "master", + "commit": "c2cdb3c0f5078b0619055af192295830a7987790" + }, + "copilot.lua": { + "branch": "master", + "commit": "77e3a4907928f0813024e573b882dc879dfc0c6b" + }, + "crates.nvim": { + "branch": "main", + "commit": "3648f8787656d7572740560331553abdaa8cb982" + }, + "csv.vim": { + "branch": "master", + "commit": "15ff93edf5b26c466affbb356e0696b7d6a3b499" + }, + "diffview.nvim": { + "branch": "main", + "commit": "86bf6182e2ea767c21711de8a3c396d9b635d970" + }, + "edge": { + "branch": "master", + "commit": "358cb6688ac577470a4eafcb53bdd63899dfc937" + }, + "fidget.nvim": { + "branch": "main", + "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" + }, + "focus.nvim": { + "branch": "master", + "commit": "3d9df42aa4f9b572348418207b752f81adea09a5" + }, + "friendly-snippets": { + "branch": "main", + "commit": "0dd6114bea08276d9111d58c5dce5e256bbc8921" + }, + "fzy-lua-native": { + "branch": "master", + "commit": "45148b3f70d244e8b8b5db60df447a2b7ac2de9d" + }, + "gitsigns.nvim": { + "branch": "main", + "commit": "f868d82a36f7f7f5e110eb0a9659993984f59875" + }, + "hop.nvim": { + "branch": "v2", + "commit": "90db1b2c61b820e230599a04fedcd2679e64bd07" + }, + "indent-blankline.nvim": { + "branch": "master", + "commit": "7075d7861f7a6bbf0de0298c83f8a13195e6ec01" + }, + "lazy.nvim": { + "branch": "main", + "commit": "f145e6f42a56306c5536e9efbfe41f7efbec285d" + }, + "lsp_signature.nvim": { + "branch": "master", + "commit": "17ff7a405fea8376b015b8ea7910d2e59958bf68" + }, + "lspsaga.nvim": { + "branch": "main", + "commit": "c475ace5b8882631b351ef7c3e8078ca9ebbb751" + }, + "lualine.nvim": { + "branch": "master", + "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" + }, + "markdown-preview.nvim": { + "branch": "master", + "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" + }, + "mason-lspconfig.nvim": { + "branch": "main", + "commit": "f0ce33f4794a2364eb08d09d09380e8b04ec5e6a" + }, + "mason-null-ls.nvim": { + "branch": "main", + "commit": "54d702020bf94e4eefd357f0b738317af30217eb" + }, + "mason.nvim": { + "branch": "main", + "commit": "7d7efc738e08fc5bee822857db45cb6103f0b0c1" + }, + "neodim": { + "branch": "master", + "commit": "89c16fccccfdb5b7e6ad3a6e8286736debc11705" + }, + "neoscroll.nvim": { + "branch": "master", + "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" + }, + "nord.nvim": { + "branch": "master", + "commit": "fab04b2dd4b64f4b1763b9250a8824d0b5194b8f" + }, + "null-ls.nvim": { + "branch": "main", + "commit": "c89333e034a8daba654ebfcf9a4ec9f87765f01e" + }, + "nvim-bufdel": { + "branch": "main", + "commit": "96c4f7ab053ddab0025bebe5f7c71e4795430e47" + }, + "nvim-cmp": { + "branch": "main", + "commit": "fc0f694af1a742ada77e5b1c91ff405c746f4a26" + }, + "nvim-colorizer.lua": { + "branch": "master", + "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" + }, + "nvim-dap": { + "branch": "master", + "commit": "7c1d47cf7188fc31acdf951f9eee22da9d479152" + }, + "nvim-dap-ui": { + "branch": "master", + "commit": "c020f660b02772f9f3d11f599fefad3268628a9e" + }, + "nvim-lspconfig": { + "branch": "master", + "commit": "bf19509314e4fa85b5320f74a00db00e33e492c0" + }, + "nvim-notify": { + "branch": "master", + "commit": "f3024b912073774111202f5fa6518b0cd2a74432" + }, + "nvim-scrollview": { + "branch": "main", + "commit": "3c0ecf0b7580fac121829e772b7a0280b87df3b0" + }, + "nvim-tree.lua": { + "branch": "master", + "commit": "e2a4c9d09d205ebe5f071264f43f73a0077c43a3" + }, + "nvim-treehopper": { + "branch": "master", + "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" + }, + "nvim-treesitter": { + "branch": "master", + "commit": "f84de0d6cd3199149c1c4c236b7267ce7b0775a2" + }, + "nvim-treesitter-context": { + "branch": "master", + "commit": "e2ea37627c0681421ccf4a3cf19d68bb958e1817" + }, + "nvim-treesitter-textobjects": { + "branch": "master", + "commit": "23e883b99228f8d438254e5ef8c897e5e60e75d1" + }, + "nvim-ts-autotag": { + "branch": "main", + "commit": "40615e96075c743ef47aaf9de966dc348bec6459" + }, + "nvim-ts-context-commentstring": { + "branch": "main", + "commit": "0bf8fbc2ca8f8cdb6efbd0a9e32740d7a991e4c3" + }, + "nvim-ts-rainbow": { + "branch": "master", + "commit": "85279555783702b4bed6518e4494ec96d1ae1dfe" + }, + "nvim-web-devicons": { + "branch": "master", + "commit": "2a125024a137677930efcfdf720f205504c97268" + }, + "paint.nvim": { + "branch": "main", + "commit": "6ce64212804f425073c61ab0d9c2b034f0435260" + }, + "plenary.nvim": { + "branch": "master", + "commit": "499e0743cf5e8075cd32af68baa3946a1c76adf1" + }, + "project.nvim": { + "branch": "main", + "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" + }, + "rust-tools.nvim": { + "branch": "master", + "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" + }, + "smartyank.nvim": { + "branch": "master", + "commit": "7e3905578f646503525b2f7018b8afd17861018c" + }, + "sniprun": { + "branch": "master", + "commit": "83791b87a8ede5275a2c060605bf1fec782205cc" + }, + "specs.nvim": { + "branch": "main", + "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" + }, + "sqlite.lua": { + "branch": "master", + "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" + }, + "suda.vim": { + "branch": "master", + "commit": "08abd39dfe1cee681b8ce3e7321da5fa03e045c1" + }, + "tabout.nvim": { + "branch": "master", + "commit": "0d275c8d25f32457e67b5c66d6ae43f26a61bce5" + }, + "telescope-frecency.nvim": { + "branch": "master", + "commit": "0a4a521471141ae3c94ff0ebcffcaff3c3aad147" + }, + "telescope-fzf-native.nvim": { + "branch": "main", + "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" + }, + "telescope-live-grep-args.nvim": { + "branch": "master", + "commit": "0f75ea809c46af8997c64f49c52e3c641d887885" + }, + "telescope-undo.nvim": { + "branch": "main", + "commit": "3dec002ea3e7952071d26fbb5d01e2038a58a554" + }, + "telescope-zoxide": { + "branch": "main", + "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" + }, + "telescope.nvim": { + "branch": "master", + "commit": "6d3fbffe426794296a77bb0b37b6ae0f4f14f807" + }, + "toggleterm.nvim": { + "branch": "main", + "commit": "cf146a267a6a7db62b1e2aff40414b20081048a1" + }, + "trouble.nvim": { + "branch": "main", + "commit": "23c1327b85bd51258f9f8bd8f77f024acef6de69" + }, + "vim-cool": { + "branch": "master", + "commit": "80536b9f2e23292708a64f2e7bcf5e596f9faf24" + }, + "vim-easy-align": { + "branch": "master", + "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" + }, + "vim-fugitive": { + "branch": "master", + "commit": "5f0d280b517cacb16f59316659966c7ca5e2bea2" + }, + "vim-go": { + "branch": "master", + "commit": "3289077b08b210aa88a890cb65e9538bd52364b6" + }, + "vim-illuminate": { + "branch": "master", + "commit": "a2907275a6899c570d16e95b9db5fd921c167502" + }, + "vim-matchup": { + "branch": "master", + "commit": "3625e099b09bff2db5f04082cb09ba679525980c" + }, + "vim-pencil": { + "branch": "master", + "commit": "6d70438a8886eaf933c38a7a43a61adb0a7815ed" + }, + "which-key.nvim": { + "branch": "main", + "commit": "e271c28118998c93a14d189af3395812a1aa646c" + }, + "wilder.nvim": { + "branch": "master", + "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" + } } diff --git a/lua/core/event.lua b/lua/core/event.lua index 324931808..36c633b27 100644 --- a/lua/core/event.lua +++ b/lua/core/event.lua @@ -114,11 +114,11 @@ function autocmd.load_autocmds() "*", [[if &cursorline && &filetype !~# '^\(dashboard\|clap_\)' && ! &pvw | setlocal nocursorline | endif]], }, - -- Force write shada on leaving nvim + -- Attempt to write shada when leaving nvim { "VimLeave", "*", - [[if has('nvim') | wshada! | else | wviminfo! | endif]], + [[if has('nvim') | wshada | else | wviminfo! | endif]], }, -- Check if file changed when its window is focus, more eager than 'autoread' { "FocusGained", "* checktime" }, diff --git a/lua/core/init.lua b/lua/core/init.lua index 6f8715be7..bf54ae19c 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -166,14 +166,14 @@ local clipboard_config = function() } elseif global.is_wsl then vim.g.clipboard = { - name = "psyank-wsl", + name = "win32yank-wsl", copy = { - ["+"] = "clip.exe", - ["*"] = "clip.exe", + ["+"] = "win32yank.exe -i --crlf", + ["*"] = "win32yank.exe -i --crlf", }, paste = { - ["+"] = [[powershell.exe -NoProfile -NoLogo -NonInteractive -Command [console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))]], - ["*"] = [[powershell.exe -NoProfile -NoLogo -NonInteractive -Command [console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))]], + ["+"] = "win32yank.exe -o --lf", + ["*"] = "win32yank.exe -o --lf", }, cache_enabled = 0, } diff --git a/lua/core/options.lua b/lua/core/options.lua index 74a56d43e..350ea00f0 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -59,7 +59,7 @@ local function load_options() ruler = true, scrolloff = 2, sessionoptions = "buffers,curdir,help,tabpages,winsize", - shada = "!,'300,<50,@100,s10,h", + shada = "!,'500,<50,@100,s10,h", shiftround = true, shiftwidth = 4, shortmess = "aoOTIcF", diff --git a/lua/core/settings.lua b/lua/core/settings.lua index af736989b..427da9311 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -9,9 +9,21 @@ settings["use_ssh"] = true ---@type boolean settings["format_on_save"] = true --- Set it to false if diagnostics virtual text is annoying for you +-- Set it to false if the notification after formatting is annoying. ---@type boolean -settings["diagnostics_virtual_text"] = true +settings["format_notify"] = true + +-- Set it to false if diagnostics virtual text is annoying. +-- If disabled, you may browse lsp diagnostics using trouble.nvim (press `gt` to toggle it). +---@type boolean +settings["diagnostics_virtual_text"] = false + +-- Set it to one of the values below if you want to change the visible severity level of lsp diagnostics. +-- Priority: `Error` > `Warning` > `Information` > `Hint`. +-- > e.g. if you set this option to `Warning`, only lsp warnings and errors will be shown. +-- NOTE: This entry only works when `diagnostics_virtual_text` is true. +---@type "Error"|"Warning"|"Information"|"Hint" +settings["diagnostics_level"] = "Hint" -- Set the format disabled directories here, files under these dirs won't be formatted on save. ---@type string[] @@ -51,22 +63,21 @@ settings["background"] = "dark" ---@type string settings["external_browser"] = "chrome-cli open" --- Filetypes in this list will skip lsp formatting if rhs is true +-- Filetypes in this list will skip lsp formatting if rhs is true. ---@type table settings["formatter_block_list"] = { lua = false, -- example } --- Servers in this list will skip setting formatting capabilities if rhs is true +-- Servers in this list will skip setting formatting capabilities if rhs is true. ---@type table settings["server_formatting_block_list"] = { lua_ls = true, tsserver = true, clangd = true, - pylsp = true, } --- Set the language servers that will be installed during bootstrap here +-- Set the language servers that will be installed during bootstrap here. -- check the below link for all the supported LSPs: -- https://github.com/neovim/nvim-lspconfig/tree/master/lua/lspconfig/server_configurations ---@type string[] @@ -80,13 +91,12 @@ settings["lsp_deps"] = { -- "gopls", } --- Set the general-purpose servers that will be installed during bootstrap here --- check the below link for all supported sources +-- Set the general-purpose servers that will be installed during bootstrap here. +-- Check the below link for all supported sources. -- in `code_actions`, `completion`, `diagnostics`, `formatting`, `hover` folders: -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins ---@type string[] settings["null_ls_deps"] = { - "black", "clang_format", "prettier", "rustfmt", diff --git a/lua/modules/configs/completion/cmp.lua b/lua/modules/configs/completion/cmp.lua index 4331b363b..72b46eb42 100644 --- a/lua/modules/configs/completion/cmp.lua +++ b/lua/modules/configs/completion/cmp.lua @@ -10,13 +10,13 @@ return function() local border = function(hl) return { - { "╭", hl }, + { "┌", hl }, { "─", hl }, - { "╮", hl }, + { "┐", hl }, { "│", hl }, - { "╯", hl }, + { "┘", hl }, { "─", hl }, - { "╰", hl }, + { "└", hl }, { "│", hl }, } end @@ -32,47 +32,18 @@ return function() return (diff < 0) end - local function cmp_format(opts) - opts = opts or {} - - return function(entry, vim_item) - if opts.before then - vim_item = opts.before(entry, vim_item) - end - - local kind_symbol = opts.symbol_map[vim_item.kind] or icons.kind.Undefined - local source_symbol = opts.symbol_map[entry.source.name] or icons.cmp.undefined - - vim_item.menu = " " .. source_symbol .. " |" - vim_item.kind = string.format(" 〔 %s %s 〕", kind_symbol, vim_item.kind) - - if opts.maxwidth ~= nil then - if opts.ellipsis_char == nil then - vim_item.abbr = string.sub(vim_item.abbr, 1, opts.maxwidth) - else - local label = vim_item.abbr - local truncated_label = vim.fn.strcharpart(label, 0, opts.maxwidth) - if truncated_label ~= label then - vim_item.abbr = truncated_label .. opts.ellipsis_char - end - end - end - return vim_item - end - end - local cmp = require("cmp") cmp.setup({ preselect = cmp.PreselectMode.Item, window = { completion = { - border = border("Normal"), - max_width = 80, - max_height = 20, + border = border("PmenuBorder"), + winhighlight = "Normal:Pmenu,CursorLine:PmenuSel,Search:PmenuSel", scrollbar = false, }, documentation = { border = border("CmpDocBorder"), + winhighlight = "Normal:CmpDoc", }, }, sorting = { @@ -96,19 +67,47 @@ return function() }, }, formatting = { - fields = { "menu", "abbr", "kind" }, + fields = { "abbr", "kind", "menu" }, format = function(entry, vim_item) - local kind_map = vim.tbl_deep_extend("force", icons.kind, icons.type, icons.cmp) - local kind = cmp_format({ - maxwidth = 50, - symbol_map = kind_map, - })(entry, vim_item) - return kind + local lspkind_icons = vim.tbl_deep_extend("force", icons.kind, icons.type, icons.cmp) + -- load lspkind icons + vim_item.kind = + string.format(" %s %s", lspkind_icons[vim_item.kind] or icons.cmp.undefined, vim_item.kind or "") + + vim_item.menu = setmetatable({ + cmp_tabnine = "[TN]", + copilot = "[CPLT]", + buffer = "[BUF]", + orgmode = "[ORG]", + nvim_lsp = "[LSP]", + nvim_lua = "[LUA]", + path = "[PATH]", + tmux = "[TMUX]", + treesitter = "[TS]", + luasnip = "[SNIP]", + spell = "[SPELL]", + }, { + __index = function() + return "[BTN]" -- builtin/unknown source names + end, + })[entry.source.name] + + local label = vim_item.abbr + local truncated_label = vim.fn.strcharpart(label, 0, 80) + if truncated_label ~= label then + vim_item.abbr = truncated_label .. "..." + end + + return vim_item end, }, matching = { disallow_partial_fuzzy_matching = false, }, + performance = { + async_budget = 1, + max_view_entries = 150, + }, -- You can set mappings if you want mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.confirm({ select = true, behavior = cmp.ConfirmBehavior.Replace }), @@ -143,21 +142,11 @@ return function() }, -- You should specify your *installed* sources. sources = { - { name = "nvim_lsp", max_item_count = 350 }, + { name = "nvim_lsp" }, { name = "nvim_lua" }, { name = "luasnip" }, { name = "path" }, - { - name = "treesitter", - entry_filter = function(entry) - local ignore_list = { - "Error", - "Comment", - } - local kind = entry:get_completion_item().cmp.kind_text - return not vim.tbl_contains(ignore_list, kind) - end, - }, + { name = "treesitter" }, { name = "spell" }, { name = "tmux" }, { name = "orgmode" }, diff --git a/lua/modules/configs/completion/formatting.lua b/lua/modules/configs/completion/formatting.lua index 4204e9ed5..d2af9c7e4 100644 --- a/lua/modules/configs/completion/formatting.lua +++ b/lua/modules/configs/completion/formatting.lua @@ -1,6 +1,7 @@ local M = {} local settings = require("core.settings") +local format_notify = settings.format_notify local disabled_workspaces = settings.format_disabled_dirs local format_on_save = settings.format_on_save local server_formatting_block_list = settings.server_formatting_block_list @@ -156,11 +157,13 @@ function M.format(opts) local result, err = client.request_sync("textDocument/formatting", params, timeout_ms, bufnr) if result and result.result then vim.lsp.util.apply_text_edits(result.result, bufnr, client.offset_encoding) - vim.notify( - string.format("[LSP] Format successfully with %s!", client.name), - vim.log.levels.INFO, - { title = "LSP Format Success" } - ) + if format_notify then + vim.notify( + string.format("[LSP] Format successfully with %s!", client.name), + vim.log.levels.INFO, + { title = "LSP Format Success" } + ) + end elseif err then vim.notify( string.format("[LSP][%s] %s", client.name, err), diff --git a/lua/modules/configs/completion/lsp.lua b/lua/modules/configs/completion/lsp.lua index 4130ac8a8..83ed37dc1 100644 --- a/lua/modules/configs/completion/lsp.lua +++ b/lua/modules/configs/completion/lsp.lua @@ -1,8 +1,11 @@ return function() + local diagnostics_virtual_text = require("core.settings").diagnostics_virtual_text + local diagnostics_level = require("core.settings").diagnostics_level + local nvim_lsp = require("lspconfig") local mason = require("mason") + local mason_registry = require("mason-registry") local mason_lspconfig = require("mason-lspconfig") - require("lspconfig.ui.windows").default_options.border = "single" local icons = { @@ -12,7 +15,7 @@ return function() mason.setup({ ui = { - border = "rounded", + border = "single", icons = { package_pending = icons.ui.Modified_alt, package_installed = icons.ui.Check, @@ -30,6 +33,66 @@ return function() }, }, }) + + local is_win = require("core.global").is_windows + + -- Additional plugins for pylsp + mason_registry:on( + "package:install:success", + vim.schedule_wrap(function(pkg) + if pkg.name ~= "python-lsp-server" then + return + end + + local venv = vim.fn.stdpath("data") .. "/mason/packages/python-lsp-server/venv" + local python = is_win and venv .. "/Scripts/python.exe" or venv .. "/bin/python" + local black = is_win and venv .. "/Scripts/black.exe" or venv .. "/bin/black" + local ruff = is_win and venv .. "/Scripts/ruff.exe" or venv .. "/bin/ruff" + require("plenary.job") + :new({ + command = python, + args = { + "-m", + "pip", + "install", + "-U", + "--disable-pip-version-check", + "python-lsp-black", + "python-lsp-ruff", + "pylsp-rope", + }, + cwd = venv, + env = { VIRTUAL_ENV = venv }, + on_exit = function() + if vim.fn.executable(black) == 1 and vim.fn.executable(ruff) == 1 then + vim.notify( + "Finished installing pylsp plugins", + vim.log.levels.INFO, + { title = "[lsp] Install Status" } + ) + else + vim.notify( + "Failed to install pylsp plugins. [Executable not found]", + vim.log.levels.ERROR, + { title = "[lsp] Install Failure" } + ) + end + end, + on_start = function() + vim.notify( + "Now installing pylsp plugins...", + vim.log.levels.INFO, + { title = "[lsp] Install Status", timeout = 6000 } + ) + end, + on_stderr = function(_, msg_stream) + vim.notify(msg_stream, vim.log.levels.ERROR, { title = "[lsp] Install Failure" }) + end, + }) + :start() + end) + ) + mason_lspconfig.setup({ ensure_installed = require("core.settings").lsp_deps, }) @@ -40,7 +103,9 @@ return function() vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { signs = true, underline = true, - virtual_text = require("core.settings").diagnostics_virtual_text, + virtual_text = diagnostics_virtual_text and { + severity_limit = diagnostics_level, + } or false, -- set update_in_insert to false bacause it was enabled by lspsaga update_in_insert = false, }) @@ -55,7 +120,7 @@ return function() hint_enable = true, hi_parameter = "Search", handler_opts = { - border = "rounded", + border = "single", }, }) end, @@ -92,7 +157,7 @@ return function() mason_lspconfig.setup_handlers({ mason_handler }) - -- Set lsps that are not supported by `mason.nvim` but supported by `nvim-lspconfig` here. + -- Setup lsps that are not supported by `mason.nvim` but supported by `nvim-lspconfig` here. if vim.fn.executable("dart") == 1 then local _opts = require("completion.servers.dartls") local final_opts = vim.tbl_deep_extend("keep", _opts, opts) diff --git a/lua/modules/configs/completion/null-ls.lua b/lua/modules/configs/completion/null-ls.lua index 9faf59816..d44e72051 100644 --- a/lua/modules/configs/completion/null-ls.lua +++ b/lua/modules/configs/completion/null-ls.lua @@ -6,9 +6,6 @@ return function() -- Please set additional flags for the supported servers here -- Don't specify any config here if you are using the default one. local sources = { - btns.formatting.black.with({ - extra_args = { "--fast" }, - }), btns.formatting.clang_format.with({ filetypes = { "c", "cpp" }, extra_args = require("completion.formatters.clang_format"), diff --git a/lua/modules/configs/completion/servers/clangd.lua b/lua/modules/configs/completion/servers/clangd.lua index c9d40b50f..c59a95f8a 100644 --- a/lua/modules/configs/completion/servers/clangd.lua +++ b/lua/modules/configs/completion/servers/clangd.lua @@ -23,24 +23,11 @@ local function switch_source_header_splitcmd(bufnr, splitcmd) end end -local function get_binary_path(binary) - local path = nil - if global.is_mac or global.is_linux then - path = vim.fn.trim(vim.fn.system("which " .. binary)) - elseif global.is_windows then - path = vim.fn.trim(vim.fn.system("where " .. binary)) - end - if vim.v.shell_error ~= 0 then - path = nil - end - return path -end - local function get_binary_path_list(binaries) local path_list = {} for _, binary in ipairs(binaries) do - local path = get_binary_path(binary) - if path then + local path = vim.fn.exepath(binary) + if path ~= "" then table.insert(path_list, path) end end @@ -55,6 +42,8 @@ return function(options) single_file_support = true, cmd = { "clangd", + "-j=12", + "--enable-config", "--background-index", "--pch-storage=memory", -- You MUST set this arg ↓ to your c/cpp compiler location (if not included)! @@ -64,6 +53,8 @@ return function(options) "--completion-style=detailed", "--header-insertion-decorators", "--header-insertion=iwyu", + "--limit-references=3000", + "--limit-results=270", }, commands = { ClangdSwitchSourceHeader = { diff --git a/lua/modules/configs/completion/servers/pylsp.lua b/lua/modules/configs/completion/servers/pylsp.lua new file mode 100644 index 000000000..eb83ccd14 --- /dev/null +++ b/lua/modules/configs/completion/servers/pylsp.lua @@ -0,0 +1,46 @@ +-- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/pylsp.lua +return { + cmd = { "pylsp" }, + filetypes = { "python" }, + settings = { + pylsp = { + plugins = { + -- Lint + ruff = { + enabled = true, + select = { + -- enable pycodestyle + "E", + -- enable pyflakes + "F", + }, + ignore = { + -- ignore E501 (line too long) + -- "E501", + -- ignore F401 (imported but unused) + -- "F401", + }, + extendSelect = { "I" }, + severities = { + -- Hint, Information, Warning, Error + F401 = "I", + E501 = "I", + }, + }, + flake8 = { enabled = false }, + pyflakes = { enabled = false }, + pycodestyle = { enabled = false }, + mccabe = { enabled = false }, + + -- Code refactor + rope = { enabled = true }, + + -- Formatting + black = { enabled = true }, + pyls_isort = { enabled = false }, + autopep8 = { enabled = false }, + yapf = { enabled = false }, + }, + }, + }, +} diff --git a/lua/modules/configs/tool/nvim-tree.lua b/lua/modules/configs/tool/nvim-tree.lua index d903ee868..d38d9a808 100644 --- a/lua/modules/configs/tool/nvim-tree.lua +++ b/lua/modules/configs/tool/nvim-tree.lua @@ -62,7 +62,7 @@ return function() show = { file = true, folder = true, - folder_arrow = false, + folder_arrow = true, git = true, }, padding = " ", @@ -81,10 +81,10 @@ return function() ignored = icons.git.Ignore, --◌ }, folder = { - -- arrow_open = "", - -- arrow_closed = "", - arrow_open = "", - arrow_closed = "", + arrow_open = icons.ui.ArrowOpen, + arrow_closed = icons.ui.ArrowClosed, + -- arrow_open = "", + -- arrow_closed = "", default = icons.ui.Folder, open = icons.ui.FolderOpen, empty = icons.ui.EmptyFolder, diff --git a/lua/modules/configs/tool/telescope.lua b/lua/modules/configs/tool/telescope.lua index df9e8dc84..1957e1e71 100644 --- a/lua/modules/configs/tool/telescope.lua +++ b/lua/modules/configs/tool/telescope.lua @@ -4,6 +4,14 @@ return function() require("telescope").setup({ defaults = { + vimgrep_arguments = { + "rg", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + }, initial_mode = "insert", prompt_prefix = " " .. icons.ui.Telescope .. " ", selection_caret = icons.ui.ChevronRight, @@ -11,22 +19,29 @@ return function() results_title = false, layout_strategy = "horizontal", path_display = { "absolute" }, - file_ignore_patterns = { ".git/", ".cache", "%.class", "%.pdf", "%.mkv", "%.mp4", "%.zip" }, + selection_strategy = "reset", + sorting_strategy = "ascending", + color_devicons = true, + file_ignore_patterns = { ".git/", ".cache", "build/", "%.class", "%.pdf", "%.mkv", "%.mp4", "%.zip" }, layout_config = { horizontal = { - preview_width = 0.5, + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8, + }, + vertical = { + mirror = false, }, + width = 0.85, + height = 0.92, + preview_cutoff = 120, }, file_previewer = require("telescope.previewers").vim_buffer_cat.new, grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, file_sorter = require("telescope.sorters").get_fuzzy_file, generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - }, - pickers = { - keymaps = { - theme = "dropdown", - }, + buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, }, extensions = { fzf = { diff --git a/lua/modules/configs/tool/toggleterm.lua b/lua/modules/configs/tool/toggleterm.lua index 19dd6a2dc..d8c2bc7ea 100644 --- a/lua/modules/configs/tool/toggleterm.lua +++ b/lua/modules/configs/tool/toggleterm.lua @@ -1,7 +1,4 @@ return function() - local colors = require("modules.utils").get_palette() - local floatborder_hl = require("modules.utils").hl_to_rgb("FloatBorder", false, colors.blue) - require("toggleterm").setup({ -- size can be a number or function which is passed the current terminal size = function(term) @@ -18,8 +15,14 @@ return function() vim.api.nvim_set_option_value("foldexpr", "0", { scope = "local" }) end, highlights = { + Normal = { + link = "Normal", + }, + NormalFloat = { + link = "NormalFloat", + }, FloatBorder = { - guifg = floatborder_hl, + link = "FloatBorder", }, }, open_mapping = false, -- [[]], diff --git a/lua/modules/configs/tool/wilder.lua b/lua/modules/configs/tool/wilder.lua index a45bba475..9206e98f5 100644 --- a/lua/modules/configs/tool/wilder.lua +++ b/lua/modules/configs/tool/wilder.lua @@ -1,6 +1,5 @@ return function() local wilder = require("wilder") - local colors = require("modules.utils").get_palette() local icons = { ui = require("modules.utils.icons").get("ui") } wilder.setup({ modes = { ":", "/", "?" } }) @@ -25,13 +24,12 @@ return function() ), }) - local match_hl = require("modules.utils").hl_to_rgb("String", false, colors.green) - local popupmenu_renderer = wilder.popupmenu_renderer(wilder.popupmenu_border_theme({ border = "rounded", highlights = { - border = "Title", -- highlight to use for the border - accent = wilder.make_hl("WilderAccent", "Pmenu", { { a = 0 }, { a = 0 }, { foreground = match_hl } }), + default = "Pmenu", + border = "PmenuBorder", -- highlight to use for the border + accent = wilder.make_hl("WilderAccent", "CmpItemAbbr", "CmpItemAbbrMatch"), }, empty_message = wilder.popupmenu_empty_message_with_spinner(), highlighter = wilder.lua_fzy_highlighter(), diff --git a/lua/modules/configs/ui/alpha.lua b/lua/modules/configs/ui/alpha.lua index 372213b14..82eba3baa 100644 --- a/lua/modules/configs/ui/alpha.lua +++ b/lua/modules/configs/ui/alpha.lua @@ -35,8 +35,8 @@ return function() cursor = 5, width = 50, align_shortcut = "right", - hl = "AlphaButton", - hl_shortcut = "AlphaAttr", + hl = "AlphaButtons", + hl_shortcut = "AlphaShortcut", } if nil == keybind then @@ -118,7 +118,7 @@ return function() end, }), } - dashboard.section.buttons.opts.hl = "AlphaButton" + dashboard.section.buttons.opts.hl = "AlphaButtons" local function footer() local stats = require("lazy").stats() diff --git a/lua/modules/configs/ui/catppuccin.lua b/lua/modules/configs/ui/catppuccin.lua index 5a6260e33..723e41bf3 100644 --- a/lua/modules/configs/ui/catppuccin.lua +++ b/lua/modules/configs/ui/catppuccin.lua @@ -1,5 +1,6 @@ return function() local transparent_background = require("core.settings").transparent_background + local clear = {} require("catppuccin").setup({ flavour = "mocha", -- Can be one of: latte, frappe, macchiato, mocha @@ -82,175 +83,74 @@ return function() symbols_outline = false, telekasten = false, telescope = true, - treesitter_context = false, + treesitter_context = true, ts_rainbow = true, vim_sneak = false, vimwiki = false, which_key = true, }, - color_overrides = { - mocha = { - rosewater = "#F5E0DC", - flamingo = "#F2CDCD", - mauve = "#DDB6F2", - pink = "#F5C2E7", - red = "#F28FAD", - maroon = "#E8A2AF", - peach = "#F8BD96", - yellow = "#FAE3B0", - green = "#ABE9B3", - blue = "#96CDFB", - sky = "#89DCEB", - teal = "#B5E8E0", - lavender = "#C9CBFF", - - text = "#D9E0EE", - subtext1 = "#BAC2DE", - subtext0 = "#A6ADC8", - overlay2 = "#C3BAC6", - overlay1 = "#988BA2", - overlay0 = "#6E6C7E", - surface2 = "#6E6C7E", - surface1 = "#575268", - surface0 = "#302D41", - - base = "#1E1E2E", - mantle = "#1A1826", - crust = "#161320", - }, - }, + color_overrides = {}, highlight_overrides = { - mocha = function(cp) + ---@param cp palette + all = function(cp) return { - -- For base configs. - NormalFloat = { fg = cp.text, bg = transparent_background and cp.none or cp.base }, + -- For base configs + NormalFloat = { fg = cp.text, bg = transparent_background and cp.none or cp.mantle }, + FloatBorder = { + fg = transparent_background and cp.blue or cp.mantle, + bg = transparent_background and cp.none or cp.mantle, + }, CursorLineNr = { fg = cp.green }, - Search = { bg = cp.surface1, fg = cp.pink, style = { "bold" } }, - IncSearch = { bg = cp.pink, fg = cp.surface1 }, - Keyword = { fg = cp.pink }, - Type = { fg = cp.blue }, - Typedef = { fg = cp.yellow }, - StorageClass = { fg = cp.red, style = { "italic" } }, - -- For native lsp configs. + -- For native lsp configs DiagnosticVirtualTextError = { bg = cp.none }, DiagnosticVirtualTextWarn = { bg = cp.none }, DiagnosticVirtualTextInfo = { bg = cp.none }, - DiagnosticVirtualTextHint = { fg = cp.rosewater, bg = cp.none }, - - DiagnosticHint = { fg = cp.rosewater }, - LspDiagnosticsDefaultHint = { fg = cp.rosewater }, - LspDiagnosticsHint = { fg = cp.rosewater }, - LspDiagnosticsVirtualTextHint = { fg = cp.rosewater }, - LspDiagnosticsUnderlineHint = { sp = cp.rosewater }, - - -- For fidget. + DiagnosticVirtualTextHint = { bg = cp.none }, + LspInfoBorder = { link = "FloatBorder" }, + + -- For mason.nvim + MasonNormal = { link = "NormalFloat" }, + + -- For nvim-cmp and wilder.nvim + Pmenu = { fg = cp.overlay2, bg = transparent_background and cp.none or cp.base }, + PmenuBorder = { fg = cp.surface1, bg = transparent_background and cp.none or cp.base }, + PmenuSel = { bg = cp.green, fg = cp.base }, + CmpItemAbbr = { fg = cp.overlay2 }, + CmpItemAbbrMatch = { fg = cp.blue, style = { "bold" } }, + CmpDoc = { link = "NormalFloat" }, + CmpDocBorder = { + fg = transparent_background and cp.surface1 or cp.mantle, + bg = transparent_background and cp.none or cp.mantle, + }, + + -- For fidget FidgetTask = { bg = cp.none, fg = cp.surface2 }, FidgetTitle = { fg = cp.blue, style = { "bold" } }, + -- For nvim-tree + NvimTreeRootFolder = { fg = cp.pink }, + NvimTreeIndentMarker = { fg = cp.surface0 }, + -- For trouble.nvim TroubleNormal = { bg = transparent_background and cp.none or cp.base }, - -- For lsp semantic tokens - ["@lsp.type.comment"] = { fg = cp.overlay0 }, - ["@lsp.type.enum"] = { link = "@type" }, - ["@lsp.type.property"] = { link = "@property" }, - ["@lsp.type.macro"] = { link = "@constant" }, - ["@lsp.typemod.function.defaultLibrary"] = { fg = cp.blue, style = { "bold", "italic" } }, - ["@lsp.typemod.function.defaultLibrary.c"] = { fg = cp.blue, style = { "bold" } }, - ["@lsp.typemod.function.defaultLibrary.cpp"] = { fg = cp.blue, style = { "bold" } }, - ["@lsp.typemod.method.defaultLibrary"] = { link = "@lsp.typemod.function.defaultLibrary" }, - ["@lsp.typemod.variable.defaultLibrary"] = { fg = cp.flamingo }, - - -- For treesitter. - ["@field"] = { fg = cp.rosewater }, - ["@property"] = { fg = cp.yellow }, - - ["@include"] = { fg = cp.teal }, - -- ["@operator"] = { fg = cp.sky }, - ["@keyword.operator"] = { fg = cp.sky }, - ["@punctuation.special"] = { fg = cp.maroon }, - - -- ["@float"] = { fg = cp.peach }, - -- ["@number"] = { fg = cp.peach }, - -- ["@boolean"] = { fg = cp.peach }, - - ["@constructor"] = { fg = cp.lavender }, - -- ["@constant"] = { fg = cp.peach }, - -- ["@conditional"] = { fg = cp.mauve }, - -- ["@repeat"] = { fg = cp.mauve }, - ["@exception"] = { fg = cp.peach }, - - ["@constant.builtin"] = { fg = cp.lavender }, - -- ["@function.builtin"] = { fg = cp.peach, style = { "italic" } }, - -- ["@type.builtin"] = { fg = cp.yellow, style = { "italic" } }, - ["@type.qualifier"] = { link = "@keyword" }, - ["@variable.builtin"] = { fg = cp.red, style = { "italic" } }, - - -- ["@function"] = { fg = cp.blue }, - ["@function.macro"] = { fg = cp.red, style = {} }, - ["@parameter"] = { fg = cp.rosewater }, - ["@keyword"] = { fg = cp.red, style = { "italic" } }, - ["@keyword.function"] = { fg = cp.maroon }, - ["@keyword.return"] = { fg = cp.pink, style = {} }, - - -- ["@text.note"] = { fg = cp.base, bg = cp.blue }, - -- ["@text.warning"] = { fg = cp.base, bg = cp.yellow }, - -- ["@text.danger"] = { fg = cp.base, bg = cp.red }, - -- ["@constant.macro"] = { fg = cp.mauve }, - - -- ["@label"] = { fg = cp.blue }, - ["@method"] = { fg = cp.blue, style = { "italic" } }, - ["@namespace"] = { fg = cp.rosewater, style = {} }, - - ["@punctuation.delimiter"] = { fg = cp.teal }, - ["@punctuation.bracket"] = { fg = cp.overlay2 }, - -- ["@string"] = { fg = cp.green }, - -- ["@string.regex"] = { fg = cp.peach }, - ["@type"] = { fg = cp.yellow }, - ["@variable"] = { fg = cp.text }, - ["@tag.attribute"] = { fg = cp.mauve, style = { "italic" } }, - ["@tag"] = { fg = cp.peach }, - ["@tag.delimiter"] = { fg = cp.maroon }, - ["@text"] = { fg = cp.text }, - - -- ["@text.uri"] = { fg = cp.rosewater, style = { "italic", "underline" } }, - -- ["@text.literal"] = { fg = cp.teal, style = { "italic" } }, - -- ["@text.reference"] = { fg = cp.lavender, style = { "bold" } }, - -- ["@text.title"] = { fg = cp.blue, style = { "bold" } }, - -- ["@text.emphasis"] = { fg = cp.maroon, style = { "italic" } }, - -- ["@text.strong"] = { fg = cp.maroon, style = { "bold" } }, - -- ["@string.escape"] = { fg = cp.pink }, - - -- ["@property.toml"] = { fg = cp.blue }, - -- ["@field.yaml"] = { fg = cp.blue }, - - -- ["@label.json"] = { fg = cp.blue }, - - ["@function.builtin.bash"] = { fg = cp.red, style = { "italic" } }, - ["@parameter.bash"] = { fg = cp.yellow, style = { "italic" } }, - - ["@field.lua"] = { fg = cp.lavender }, - ["@constructor.lua"] = { fg = cp.flamingo }, - ["@variable.builtin.lua"] = { fg = cp.flamingo, style = { "italic" } }, - - ["@constant.java"] = { fg = cp.teal }, - - ["@property.typescript"] = { fg = cp.lavender, style = { "italic" } }, - -- ["@constructor.typescript"] = { fg = cp.lavender }, - - -- ["@constructor.tsx"] = { fg = cp.lavender }, - -- ["@tag.attribute.tsx"] = { fg = cp.mauve }, - - ["@type.css"] = { fg = cp.lavender }, - ["@property.css"] = { fg = cp.yellow, style = { "italic" } }, - - ["@type.builtin.c"] = { fg = cp.yellow, style = {} }, - - ["@property.cpp"] = { fg = cp.text }, - ["@type.builtin.cpp"] = { fg = cp.yellow, style = {} }, - - -- ["@symbol"] = { fg = cp.flamingo }, + -- For telescope.nvim + TelescopeBorder = { fg = cp.mantle, bg = cp.mantle }, + TelescopePromptBorder = { fg = cp.surface0, bg = cp.surface0 }, + TelescopePromptNormal = { fg = cp.text, bg = cp.surface0 }, + TelescopePromptPrefix = { fg = cp.flamingo, bg = cp.surface0 }, + TelescopeNormal = { bg = cp.mantle }, + TelescopePreviewTitle = { fg = cp.base, bg = cp.green }, + TelescopePromptTitle = { fg = cp.base, bg = cp.red }, + TelescopeResultsTitle = { fg = cp.mantle, bg = cp.mantle }, + TelescopeSelection = { fg = cp.text, bg = cp.surface0 }, + TelescopeResultsDiffAdd = { fg = cp.green }, + TelescopeResultsDiffChange = { fg = cp.yellow }, + TelescopeResultsDiffDelete = { fg = cp.red }, + + -- For treesitter + ["@keyword.return"] = { fg = cp.pink, style = clear }, } end, }, diff --git a/lua/modules/configs/ui/neodim.lua b/lua/modules/configs/ui/neodim.lua index 5a8d0a31d..56f94fac1 100644 --- a/lua/modules/configs/ui/neodim.lua +++ b/lua/modules/configs/ui/neodim.lua @@ -1,5 +1,5 @@ return function() - local blend_color = require("modules.utils").hl_to_rgb("Normal", true) + local blend_color = require("modules.utils").gen_neodim_blend_attr() require("neodim").setup({ alpha = 0.45, diff --git a/lua/modules/plugins/completion.lua b/lua/modules/plugins/completion.lua index 3ed980d0d..241a2b7dc 100644 --- a/lua/modules/plugins/completion.lua +++ b/lua/modules/plugins/completion.lua @@ -42,7 +42,7 @@ completion["hrsh7th/nvim-cmp"] = { { "f3fora/cmp-spell" }, { "hrsh7th/cmp-buffer" }, { "kdheepak/cmp-latex-symbols" }, - { "ray-x/cmp-treesitter" }, + { "ray-x/cmp-treesitter", commit = "c8e3a74" }, -- { "tzachar/cmp-tabnine", build = "./install.sh", config = require("completion.tabnine") }, -- { -- "jcdickinson/codeium.nvim", diff --git a/lua/modules/plugins/ui.lua b/lua/modules/plugins/ui.lua index ccf085dee..0e0f67058 100644 --- a/lua/modules/plugins/ui.lua +++ b/lua/modules/plugins/ui.lua @@ -10,8 +10,9 @@ ui["akinsho/bufferline.nvim"] = { event = { "BufReadPost", "BufAdd", "BufNewFile" }, config = require("ui.bufferline"), } -ui["catppuccin/nvim"] = { +ui["Jint-lzxy/nvim"] = { lazy = false, + branch = "refactor/syntax-highlighting", name = "catppuccin", config = require("ui.catppuccin"), } diff --git a/lua/modules/utils/init.lua b/lua/modules/utils/init.lua index 1a5eae87c..1df349d68 100644 --- a/lua/modules/utils/init.lua +++ b/lua/modules/utils/init.lua @@ -195,11 +195,25 @@ function M.gen_alpha_hl() local colors = M.get_palette() vim.api.nvim_set_hl(0, "AlphaHeader", { fg = colors.blue, default = true }) - vim.api.nvim_set_hl(0, "AlphaButton", { fg = colors.green, default = true }) - vim.api.nvim_set_hl(0, "AlphaAttr", { fg = colors.pink, italic = true, default = true }) + vim.api.nvim_set_hl(0, "AlphaButtons", { fg = colors.green, default = true }) + vim.api.nvim_set_hl(0, "AlphaShortcut", { fg = colors.pink, italic = true, default = true }) vim.api.nvim_set_hl(0, "AlphaFooter", { fg = colors.yellow, default = true }) end +-- Generate blend_color for neodim. +function M.gen_neodim_blend_attr() + local trans_bg = require("core.settings").transparent_background + local appearance = require("core.settings").background + + if trans_bg and appearance == "dark" then + return "#000000" + elseif trans_bg and appearance == "light" then + return "#FFFFFF" + else + return M.hl_to_rgb("Normal", true) + end +end + ---Convert number (0/1) to boolean ---@param value number @The value to check ---@return boolean|nil @Returns nil if failed