From 870ea55cfb0f4e65ac5271935707e7164b07d2a8 Mon Sep 17 00:00:00 2001 From: wenqian Date: Fri, 31 May 2024 17:46:57 +0800 Subject: [PATCH 01/24] Update crates.nvim option name from `src` to `completion` (#1272) The https://github.com/Saecki/crates.nvim/pull/120 updated `src` option to `completion`. --- lua/modules/configs/lang/crates.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/configs/lang/crates.lua b/lua/modules/configs/lang/crates.lua index e77c222b2..ee1d88075 100644 --- a/lua/modules/configs/lang/crates.lua +++ b/lua/modules/configs/lang/crates.lua @@ -75,7 +75,7 @@ return function() loading = " " .. icons.misc.Watch, }, }, - src = { + completion = { insert_closing_quote = true, text = { prerelease = " " .. icons.diagnostics.Warning_alt .. "pre-release ", From 6a93df7e40f7e095fa746fda062a129c61a6d149 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 01:51:27 +0000 Subject: [PATCH 02/24] chore(lockfile): auto update lazy-lock.json --- lazy-lock.json | 54 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index bce5af9fa..1028a4ede 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -21,60 +21,60 @@ "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, "crates.nvim": { "branch": "main", "commit": "d556c00d60c9421c913ee54ff690df2a34f6264e" }, "csv.vim": { "branch": "master", "commit": "962f88787ec6873eba1c7dbbd81d2723f1ee3c4b" }, - "diffview.nvim": { "branch": "main", "commit": "1ec7b56b959dab18f7030f541c33ae60e18a6f88" }, + "diffview.nvim": { "branch": "main", "commit": "3afa6a053f680e9f1329c4a151db988a482306cd" }, "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, "flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" }, - "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, - "fzf": { "branch": "master", "commit": "99bd6de5415dccec4b1b21121224116bbfbc462f" }, + "friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" }, + "fzf": { "branch": "master", "commit": "124cd70710cb7c94ef2282773494bb0d727598d8" }, "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, - "gitsigns.nvim": { "branch": "main", "commit": "cdfcd9d39d23c46ae9a040de2c6a8b8bf868746e" }, + "gitsigns.nvim": { "branch": "main", "commit": "75dc649106827183547d3bedd4602442340d2f7f" }, "glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" }, - "go.nvim": { "branch": "master", "commit": "1423d5d0820eeefc97d6cdaf3ae8b554676619cc" }, - "guihua.lua": { "branch": "master", "commit": "5b45e29629eb1136c82870a5ebe55747ffebe79b" }, + "go.nvim": { "branch": "master", "commit": "8f8ab4b968d08bd70ecda1f2909fb5e6177452ca" }, + "guihua.lua": { "branch": "master", "commit": "a53b76514ad42d92a821d75d712ef71e71898fcf" }, "hop.nvim": { "branch": "master", "commit": "036462a345792279c58f2f6445756efab706f04a" }, "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, - "lazy.nvim": { "branch": "main", "commit": "24fa2a97085ca8a7220b5b078916f81e316036fd" }, + "lazy.nvim": { "branch": "main", "commit": "eab487c2520f0fe9e54eb5e3ea0606e20512492e" }, "local-highlight.nvim": { "branch": "master", "commit": "ae3ada3a332128b1036c84c8587b9069891c63da" }, "lsp-format-modifications.nvim": { "branch": "main", "commit": "006d4cd88f4f09fdc4375fcb75dd5b7d981a723b" }, "lsp_signature.nvim": { "branch": "master", "commit": "8528ff659a2a7a463c0c51383bf7ecf219714413" }, - "lspsaga.nvim": { "branch": "main", "commit": "0e2e116ade87034b2983ba0d5460af731fb1fc28" }, + "lspsaga.nvim": { "branch": "main", "commit": "4e9d6162863d2f532751db91a1193cfe1f3a4361" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, - "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "mason.nvim": { "branch": "main", "commit": "0fb4e56837f13b81a972fcc0554be1327b39061e" }, "mini.align": { "branch": "main", "commit": "68a8d3205f0e7ce1bded057f4a851f42ef8fc584" }, - "neoconf.nvim": { "branch": "main", "commit": "4e204e0d423e70293b81ba1655ed17e1f3c97986" }, + "neoconf.nvim": { "branch": "main", "commit": "f1fd38d61d11f3b1b3e7dc75dc667f79cf2fa58b" }, "neodim": { "branch": "master", "commit": "9477da03b93f1984a81fee3b92e6ac7c6ada6aa4" }, - "neoscroll.nvim": { "branch": "master", "commit": "c9e5e8f284ec9b969ebfadcc91118726be67e55a" }, - "none-ls.nvim": { "branch": "main", "commit": "60f5f80686f5a272ed3281a7d4962cb54dc5348e" }, + "neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" }, + "none-ls.nvim": { "branch": "main", "commit": "f5b960a73418249aebcdae3455de320360509253" }, "nvim-bqf": { "branch": "main", "commit": "7751b6ef9fbc3907478eaf23e866c4316a2ed1b4" }, "nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" }, "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-dap": { "branch": "master", "commit": "922ebc75c2fa9305e36402fbd8c984c8638770a0" }, - "nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" }, - "nvim-lspconfig": { "branch": "master", "commit": "b972e7154bc94ab4ecdbb38c8edbccac36f83996" }, + "nvim-dap": { "branch": "master", "commit": "09b54e03d43d967c062a7d5b1da445f04e6f3113" }, + "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, + "nvim-lspconfig": { "branch": "master", "commit": "710a8fa7379db32199545f30ea01dd8446b9302f" }, "nvim-nio": { "branch": "master", "commit": "632024157d01e8bc48fd7df6a7de8ffe3fdd4f3a" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-scrollview": { "branch": "main", "commit": "9257c3f3ebf7608a8711caf44f878d87cd40395d" }, - "nvim-spectre": { "branch": "master", "commit": "5690ea46baf08bbc1623980012e14b6239ce582e" }, - "nvim-tree.lua": { "branch": "master", "commit": "517e4fbb9ef3c0986da7047f44b4b91a2400f93c" }, + "nvim-spectre": { "branch": "master", "commit": "366f46fdd4a1593cc237aea13d5ef113739a472c" }, + "nvim-tree.lua": { "branch": "master", "commit": "5a87ffe35c4739ffb6b62052572583ad277a20ae" }, "nvim-treehopper": { "branch": "master", "commit": "13559079e33665a310d9ccf0e43f4e9bb9f337e2" }, - "nvim-treesitter": { "branch": "master", "commit": "245da4eb2e52d14b034bbbedec9671e997ede764" }, + "nvim-treesitter": { "branch": "master", "commit": "b7d50e59b1b2990b3ce8761d4cf595f4b71c87e2" }, "nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" }, - "nvim-ts-autotag": { "branch": "main", "commit": "8ae54b90e36ef1fc5267214b30c2cbff71525fe4" }, + "nvim-ts-autotag": { "branch": "main", "commit": "bcf3146864262ef2d3c877beba3e222b5c73780d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" }, "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, "paint.nvim": { "branch": "main", "commit": "6ce64212804f425073c61ab0d9c2b034f0435260" }, - "persisted.nvim": { "branch": "main", "commit": "b77d244a77a46013fbf7e59d45d84d58df294dc1" }, + "persisted.nvim": { "branch": "main", "commit": "2b4f192aca7d6665066c4fe94b25e98d657811aa" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "849803e0a687c6ef7c9a0d305bd4d441017b8abf" }, - "rustaceanvim": { "branch": "master", "commit": "e306c742bd7f7183e371cd91268b72d9db1bbae0" }, - "smart-splits.nvim": { "branch": "master", "commit": "c29547c7f144adc3387f2717626422e6b0027a08" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "0f314613125fdd7c85faaee3c87051611d883253" }, + "rustaceanvim": { "branch": "master", "commit": "2fa45427c01ded4d3ecca72e357f8a60fd8e46d4" }, + "smart-splits.nvim": { "branch": "master", "commit": "1064164ed25fd266dfb9cfe5c456617a2b2aceaa" }, "smartyank.nvim": { "branch": "master", "commit": "d9e078fe08d6466e37ea45ac446a9f60e6866789" }, "sniprun": { "branch": "master", "commit": "9006d4af4f7016523f8619ae1526ab4e7f0df785" }, "suda.vim": { "branch": "master", "commit": "b97fab52f9cdeabe2bbb5eb98d82356899f30829" }, @@ -83,14 +83,14 @@ "telescope-live-grep-args.nvim": { "branch": "master", "commit": "4122e146d199c0d6d1cfb359c76bc1250d522460" }, "telescope-undo.nvim": { "branch": "main", "commit": "95b61c01ea3a4c9e8747731148e905bbcf0ccaee" }, "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, - "telescope.nvim": { "branch": "master", "commit": "4c96370cf93e2ba287548da12d673442d0ffecc3" }, + "telescope.nvim": { "branch": "master", "commit": "dfa230be84a044e7f546a6c2b0a403c739732b86" }, "todo-comments.nvim": { "branch": "main", "commit": "e1549807066947818113a7d7ed48f637e49620d3" }, "toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" }, - "trouble.nvim": { "branch": "main", "commit": "a8264a65a0b894832ea642844f5b7c30112c458f" }, + "trouble.nvim": { "branch": "main", "commit": "d7f69ff5638cf1864cabac54ade1b1694adfe085" }, "vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" }, "vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" }, - "vim-matchup": { "branch": "master", "commit": "ff3bea611696f5cfdfe61a939149daadff41f2af" }, + "vim-matchup": { "branch": "master", "commit": "1535a769d5dca851fe7d41b0be95f7c7203a4bef" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "which-key.nvim": { "branch": "main", "commit": "4b7167f8fb2dba3d01980735e3509e172c024c29" }, "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } } \ No newline at end of file From 239df8224fc0f4f2421daa437bb6f87477bd12e3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 1 Jun 2024 02:40:38 +0000 Subject: [PATCH 03/24] chore(lockfile): auto update flake.lock --- flake.lock | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index d864abbba..ef96466e1 100644 --- a/flake.lock +++ b/flake.lock @@ -24,11 +24,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1715865404, + "narHash": "sha256-/GJvTdTpuDjNn84j82cU6bXztE0MSkdnTWClUCRub78=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "8dc45382d5206bd292f9c2768b8058a8fd8311d9", "type": "github" }, "original": { @@ -62,11 +62,11 @@ ] }, "locked": { - "lastModified": 1714377222, - "narHash": "sha256-UsDsjWCKlWn8vbXi8Zza9Hkq3xyk8fpvFNo2VM5S74E=", + "lastModified": 1717097707, + "narHash": "sha256-HC5vJ3oYsjwsCaSbkIPv80e4ebJpNvFKQTBOGlHvjLs=", "owner": "nix-community", "repo": "home-manager", - "rev": "2af7c78b7bb9cf18406a193eba13ef9f99388f49", + "rev": "0eb314b4f0ba337e88123e0b1e57ef58346aafd9", "type": "github" }, "original": { @@ -93,29 +93,23 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", - "type": "github" + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" } }, "nixpkgs_2": { "locked": { - "lastModified": 1714280680, - "narHash": "sha256-eNTZCX/vK/BQOpY+6n5a6oGxBBe7qfSbtcppepCLAAQ=", + "lastModified": 1717112898, + "narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9516f3c963708933abe984df94a925af38916237", + "rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", "type": "github" }, "original": { From a27f8f173bb5775c4b7b53bdfa14ceab9259fa63 Mon Sep 17 00:00:00 2001 From: Mohu Date: Thu, 6 Jun 2024 19:53:00 +0800 Subject: [PATCH 04/24] chore: use vim.o in place of vim.api.nvim_get_option_value. (#1269) Signed-off-by: ayamir --- lua/core/event.lua | 2 +- lua/modules/configs/completion/null-ls.lua | 2 +- lua/modules/configs/ui/lualine.lua | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/core/event.lua b/lua/core/event.lua index 5e6afabdf..2ef32b51b 100644 --- a/lua/core/event.lua +++ b/lua/core/event.lua @@ -40,7 +40,7 @@ vim.api.nvim_create_autocmd("BufEnter", { local layout = vim.api.nvim_call_function("winlayout", {}) if layout[1] == "leaf" - and vim.api.nvim_get_option_value("filetype", { buf = vim.api.nvim_win_get_buf(layout[2]) }) == "NvimTree" + and vim.bo[vim.api.nvim_win_get_buf(layout[2])].filetype == "NvimTree" and layout[3] == nil then vim.api.nvim_command([[confirm quit]]) diff --git a/lua/modules/configs/completion/null-ls.lua b/lua/modules/configs/completion/null-ls.lua index 9179da8a7..ff2efab17 100644 --- a/lua/modules/configs/completion/null-ls.lua +++ b/lua/modules/configs/completion/null-ls.lua @@ -49,7 +49,7 @@ return function() -- Setup usercmd to register/deregister available source(s) local function _gen_completion() local sources_cont = null_ls.get_source({ - filetype = vim.api.nvim_get_option_value("filetype", { scope = "local" }), + filetype = vim.bo.filetype, }) local completion_items = {} for _, server in pairs(sources_cont) do diff --git a/lua/modules/configs/ui/lualine.lua b/lua/modules/configs/ui/lualine.lua index 2d8401ede..cf653a012 100644 --- a/lua/modules/configs/ui/lualine.lua +++ b/lua/modules/configs/ui/lualine.lua @@ -163,7 +163,7 @@ return function() lsp = { function() - local buf_ft = vim.api.nvim_get_option_value("filetype", { scope = "local" }) + local buf_ft = vim.bo.filetype local clients = vim.lsp.get_clients() local lsp_lists = {} local available_servers = {} @@ -201,7 +201,7 @@ return function() return venv end - if vim.api.nvim_get_option_value("filetype", { scope = "local" }) == "python" then + if vim.bo.filetype == "python" then local venv = os.getenv("CONDA_DEFAULT_ENV") if venv then return icons.misc.PyEnv .. env_cleanup(venv) @@ -219,7 +219,7 @@ return function() tabwidth = { function() - return icons.ui.Tab .. vim.api.nvim_get_option_value("tabstop", { scope = "local" }) + return icons.ui.Tab .. vim.bo.tabstop end, padding = 1, }, From 0278b2d51e8e7960162b6412e681bd3d15983b8b Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:49:17 +0800 Subject: [PATCH 05/24] fix(0.10): minor cleanup (#1276) Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- LICENSE | 0 lua/modules/configs/editor/ts-context.lua | 5 ++--- lua/modules/configs/ui/lualine.lua | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) mode change 100755 => 100644 LICENSE diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/lua/modules/configs/editor/ts-context.lua b/lua/modules/configs/editor/ts-context.lua index 5ad119668..ba96e0312 100644 --- a/lua/modules/configs/editor/ts-context.lua +++ b/lua/modules/configs/editor/ts-context.lua @@ -5,9 +5,8 @@ return function() min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. line_numbers = true, multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line - trim_scope = "inner", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline' - -- HACK: to make use of `ts-context` in `glance`, set zindex to 50.(glance zindex is 45) - zindex = 50, + zindex = 50, -- Ensure compatibility with Glance's preview window }) end diff --git a/lua/modules/configs/ui/lualine.lua b/lua/modules/configs/ui/lualine.lua index cf653a012..39e4b8911 100644 --- a/lua/modules/configs/ui/lualine.lua +++ b/lua/modules/configs/ui/lualine.lua @@ -164,7 +164,7 @@ return function() lsp = { function() local buf_ft = vim.bo.filetype - local clients = vim.lsp.get_clients() + local clients = vim.lsp.get_clients({ buffer = vim.api.nvim_get_current_buf() }) local lsp_lists = {} local available_servers = {} if next(clients) == nil then From d249c862238f045321f9995c320e50621b1d394c Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:49:44 +0800 Subject: [PATCH 06/24] feat(scripts): update frequently used functions (#1277) I recently refactored my frequently used commands and thought it would be great to also port that here lol Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- scripts/install.ps1 | 6 +++--- scripts/install.sh | 34 ++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 600ac358e..d5b6354cb 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -8,9 +8,9 @@ Set-StrictMode -Version 3.0 $ErrorActionPreference = "Stop" # Exit when command fails # global-scope vars +$USE_SSH = $True $REQUIRED_NVIM_VERSION = [version]'0.10.0' $REQUIRED_NVIM_VERSION_LEGACY = [version]'0.9.0' -$USE_SSH = $True # package mgr vars $choco_package_matrix = @{ "gcc" = "mingw"; "git" = "git"; "nvim" = "neovim"; "make" = "make"; "sudo" = "psutils"; "node" = "nodejs"; "pip" = "python3"; "fzf" = "fzf"; "rg" = "ripgrep"; "go" = "go"; "curl" = "curl"; "wget" = "wget"; "tree-sitter" = "tree-sitter"; "ruby" = "ruby"; "rustc" = "rust-ms" } @@ -20,9 +20,9 @@ $installer_pkg_matrix = @{ "NodeJS" = "npm"; "Python" = "pip"; "Ruby" = "gem" } # env vars $env:XDG_CONFIG_HOME ??= $env:LOCALAPPDATA $env:CCPACK_MGR ??= 'unknown' +$env:CCLONE_ATTR ??= 'undef' $env:CCLONE_BRANCH ??= 'main' $env:CCLONE_BRANCH_LEGACY ??= '0.8' -$env:CCLONE_ATTR ??= 'undef' $env:CCDEST_DIR ??= "$env:XDG_CONFIG_HOME\nvim" $env:CCBACKUP_DIR = "$env:CCDEST_DIR" + "_backup-" + (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmss") @@ -58,7 +58,7 @@ function info_ext ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [str } function warn ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [string]$Msg) { - Write-Host "Warning" -ForegroundColor Yellow -NoNewline; Write-Host ": $(_chomp -Str $Msg)"; + Write-Host "Warning:" -ForegroundColor Yellow -NoNewline; Write-Host " $(_chomp -Str $Msg)"; } function warn_ext ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [string]$Msg) { diff --git a/scripts/install.sh b/scripts/install.sh index 71e9d9514..48956bbd6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -4,15 +4,15 @@ # Allow `[[ -n "$(command)" ]]`, `func "$(command)"`, pipes, etc. # shellcheck disable=SC2312 -set -u +set -uo pipefail -# global vars -DEST_DIR="${HOME}/.config/nvim" -BACKUP_DIR="${DEST_DIR}_backup-$(date +%Y%m%dT%H%M%S)" -CLONE_ATTR=("--progress") +# global-scope vars REQUIRED_NVIM_VERSION=0.10.0 REQUIRED_NVIM_VERSION_LEGACY=0.9.0 USE_SSH=1 +CLONE_ATTR=("--progress") +DEST_DIR="${HOME}/.config/nvim" +BACKUP_DIR="${DEST_DIR}_backup-$(date +%Y%m%dT%H%M%S)" abort() { printf "%s\n" "$@" >&2 @@ -31,7 +31,7 @@ if [[ -n "${CI-}" && -n "${INTERACTIVE-}" ]]; then abort "Cannot run force-interactive mode in CI." fi -# string formatters +# String formatters if [[ -t 1 ]]; then tty_escape() { printf "\033[%sm" "$1"; } else @@ -41,6 +41,8 @@ fi tty_mkbold() { tty_escape "1;$1"; } tty_underline="$(tty_escape "4;39")" tty_yellow="$(tty_escape "0;33")" +tty_magenta="$(tty_mkbold 35)" +tty_green="$(tty_mkbold 32)" tty_blue="$(tty_mkbold 34)" tty_red="$(tty_mkbold 31)" tty_bold="$(tty_mkbold 39)" @@ -82,7 +84,7 @@ info_ext() { } warn() { - printf "${tty_yellow}Warning${tty_reset}: %s\n" "$(chomp "$1")" + printf "${tty_yellow}Warning:${tty_reset} %s\n" "$(chomp "$1")" } warn_ext() { @@ -98,7 +100,7 @@ getc() { } ring_bell() { - # Use the shell's audible bell. + # Use the shell's audible bell if [[ -t 1 ]]; then printf "\a" fi @@ -106,13 +108,12 @@ ring_bell() { wait_for_user() { local c - echo + printf "\n" echo "Press ${tty_bold}RETURN${tty_reset}/${tty_bold}ENTER${tty_reset} to continue or any other key to abort..." getc c # we test for \r and \n because some stuff does \r instead - if ! [[ "${c}" == $'\r' || "${c}" == $'\n' ]]; then - echo "${tty_red}Aborted.${tty_reset}" - exit 1 + if ! [[ "$c" == $'\r' || "$c" == $'\n' ]]; then + abort "${tty_red}Aborted.${tty_reset}" fi } @@ -121,9 +122,10 @@ version_ge() { } prompt_confirm() { + local choice while true; do - read -r -p "$1 [Y/n]: " USR_CHOICE - case "${USR_CHOICE}" in + read -r -p "$1 [Y/n]: " choice + case "$choice" in [yY][eE][sS] | [yY]) return 1 ;; @@ -131,10 +133,10 @@ prompt_confirm() { return 0 ;; *) - if [[ -z "${USR_CHOICE}" ]]; then + if [[ -z "$choice" ]]; then return 1 fi - printf "${tty_red}%s\n\n${tty_reset}" "Invalid input! Please enter one of: '[y/yes] / [n/no]'" + printf "${tty_red}%s\n\n${tty_reset}" "Input invalid! Please enter one of the following: '[y/yes]' or '[n/no]'." ;; esac done From fd464262da4001d2f0c9237536237670f2873cc2 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:50:31 +0800 Subject: [PATCH 07/24] feat(docs): support v0.10 (#1278) * feat(docs): support v0.10 Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fix instructions Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 12 ++++++------ .github/ISSUE_TEMPLATE/custom_config.yml | 10 +++++----- .github/ISSUE_TEMPLATE/lsp_issue_report.yml | 12 ++++++------ README.md | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5c0f3fff4..d4f8280d8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -7,7 +7,7 @@ body: value: | _Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve! > [!IMPORTANT] - > The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. + > The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. - type: checkboxes id: is-latest-commit attributes: @@ -38,7 +38,7 @@ body: attributes: label: "Neovim version" description: "Paste the output of `nvim --version` here" - placeholder: "NVIM v0.10.0-dev-873+g71ad771ea" + placeholder: "NVIM v0.11.0-dev-194+g6c7677e5d" validations: required: true - type: input @@ -69,16 +69,16 @@ body: description: "Which branch are you currently on? If you are not sure, check the output of `git rev-parse --abbrev-ref HEAD`" options: - main (Default/Latest) - - 0.8 (Legacy) - - 0.7 (Deprecated) - - 0.10 (Nightly) + - 0.9 (Legacy) + - 0.8 (Deprecated) + - 0.11 (Nightly) validations: required: true - type: dropdown id: fetch-pref attributes: label: "Fetch Preferences" - description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/core/settings.lua`" + description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/user/settings.lua`" options: - SSH (use_ssh = true) - HTTPS (use_ssh = false) diff --git a/.github/ISSUE_TEMPLATE/custom_config.yml b/.github/ISSUE_TEMPLATE/custom_config.yml index d3dc98dd2..6b48fcd50 100644 --- a/.github/ISSUE_TEMPLATE/custom_config.yml +++ b/.github/ISSUE_TEMPLATE/custom_config.yml @@ -7,7 +7,7 @@ body: value: | _Before requesting:_ Make sure you've read through our [Wiki: Usage](https://github.com/ayamir/nvimdots/wiki/Usage) before you start to add things to nvimdots! > [!IMPORTANT] - > The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. + > The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. - type: checkboxes id: is-latest-commit attributes: @@ -30,7 +30,7 @@ body: attributes: label: "Neovim version" description: "Paste the output of `nvim --version` here" - placeholder: "NVIM v0.10.0-dev-873+g71ad771ea" + placeholder: "NVIM v0.11.0-dev-194+g6c7677e5d" validations: required: true - type: dropdown @@ -40,9 +40,9 @@ body: description: "This issue template mainly targets `main` branch. Check the output of `git rev-parse --abbrev-ref HEAD` if you're not sure." options: - main (Default/Latest) - - 0.8 (Legacy) - - 0.7 (Deprecated) - - 0.10 (Nightly) + - 0.9 (Legacy) + - 0.8 (Deprecated) + - 0.11 (Nightly) validations: required: true diff --git a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml index 519b0e6de..f18124c55 100644 --- a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml +++ b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml @@ -7,7 +7,7 @@ body: value: | _Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve! > [!IMPORTANT] - > The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. + > The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. - type: checkboxes id: is-latest-commit attributes: @@ -38,7 +38,7 @@ body: attributes: label: "Neovim version" description: "Paste the output of `nvim --version` here" - placeholder: "NVIM v0.10.0-dev-873+g71ad771ea" + placeholder: "NVIM v0.11.0-dev-194+g6c7677e5d" validations: required: true - type: input @@ -69,16 +69,16 @@ body: description: "Which branch are you currently on? If you are not sure, check the output of `git rev-parse --abbrev-ref HEAD`" options: - main (Default/Latest) - - 0.8 (Legacy) - - 0.7 (Deprecated) - - 0.10 (Nightly) + - 0.9 (Legacy) + - 0.8 (Deprecated) + - 0.11 (Nightly) validations: required: true - type: dropdown id: fetch-pref attributes: label: "Fetch Preferences" - description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/core/settings.lua`" + description: "In what way do you fetch resources? If you are not sure, check the value of `use_ssh` in `lua/user/settings.lua`" options: - SSH (use_ssh = true) - HTTPS (use_ssh = false) diff --git a/README.md b/README.md index 05390439a..9b0303d7f 100644 --- a/README.md +++ b/README.md @@ -42,17 +42,17 @@ Branch info:
-| Branch | Supported neovim version | +| Branch | Supported Neovim version | | :----: | :----------------------: | -| main | nvim 0.9 stable | -| 0.10 | nvim 0.10 nightly | +| main | nvim 0.10 stable | +| 0.11 | nvim 0.11 nightly | +| 0.9 | nvim 0.9 | | 0.8 | nvim 0.8 | -| 0.7 | nvim 0.7 |
> [!IMPORTANT] -> The `0.10` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. +> The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. We currently manage plugins using [lazy.nvim](https://github.com/folke/lazy.nvim). From f2863806554a77624ba81686c981eeb01b577651 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Fri, 7 Jun 2024 19:26:50 +0800 Subject: [PATCH 08/24] fix(scripts): typo Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- README.md | 14 +++++++------- scripts/install.ps1 | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9b0303d7f..0026d621a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@
NeoVim Version Capability @@ -36,7 +36,7 @@ ## 🪷 Introduction -This repo hosts our [NeoVim](https://neovim.io/) configuration for Linux [(with NixOS support)](#nixos-support), macOS, and Windows. `init.lua` is the config entry point. +This repo hosts our [Neovim](https://neovim.io/) configuration for Linux [(with NixOS support)](#nixos-support), macOS, and Windows. `init.lua` is the config entry point. Branch info: @@ -45,14 +45,14 @@ Branch info: | Branch | Supported Neovim version | | :----: | :----------------------: | | main | nvim 0.10 stable | -| 0.11 | nvim 0.11 nightly | +| 0.11 | nvim 0.11 nightly | | 0.9 | nvim 0.9 | | 0.8 | nvim 0.8 | > [!IMPORTANT] -> The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. +> The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. We currently manage plugins using [lazy.nvim](https://github.com/folke/lazy.nvim). @@ -61,14 +61,14 @@ Chinese introduction is [here](https://zhuanlan.zhihu.com/p/382092667). ### 🎐 Features - **Fast.** Less than **30ms** to start (Depends on SSD and CPU, tested on Zephyrus G14 2022 version). -- **Simple.** Run out of the box. +- **Simple.** Runs out of the box. - **Modern.** Pure `lua` config. - **Modular.** Easy to customize. - **Powerful.** Full functionality to code. ## 🏗 How to Install -Just run the following interactive bootstrap command, and you're good to go 👍 +Simply run the following interactive bootstrap command, and you should be all set 👍 - **Windows** _(Note: This script REQUIRES `pwsh` > `v7.1`)_ @@ -204,7 +204,7 @@ It's strongly recommended to read [Wiki: Prerequisites](https://github.com/ayami ## 📜 License -This NeoVim configuration is released under the MIT license, which grants the following permissions: +This Neovim configuration is released under the MIT license, which grants the following permissions: - Commercial use - Distribution diff --git a/scripts/install.ps1 b/scripts/install.ps1 index d5b6354cb..184291208 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -22,7 +22,7 @@ $env:XDG_CONFIG_HOME ??= $env:LOCALAPPDATA $env:CCPACK_MGR ??= 'unknown' $env:CCLONE_ATTR ??= 'undef' $env:CCLONE_BRANCH ??= 'main' -$env:CCLONE_BRANCH_LEGACY ??= '0.8' +$env:CCLONE_BRANCH_LEGACY ??= '0.9' $env:CCDEST_DIR ??= "$env:XDG_CONFIG_HOME\nvim" $env:CCBACKUP_DIR = "$env:CCDEST_DIR" + "_backup-" + (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmss") From f8bc12b8caad20dca9a006a41366e18b0a1ecd66 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:38:37 +0800 Subject: [PATCH 09/24] fixup! fix(scripts): typo --- scripts/install.ps1 | 14 +++++++------- scripts/install.sh | 4 +--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 184291208..910abc8e5 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -26,9 +26,9 @@ $env:CCLONE_BRANCH_LEGACY ??= '0.9' $env:CCDEST_DIR ??= "$env:XDG_CONFIG_HOME\nvim" $env:CCBACKUP_DIR = "$env:CCDEST_DIR" + "_backup-" + (Get-Date).ToUniversalTime().ToString("yyyyMMddTHHmmss") -function _abort ([Parameter(Mandatory = $True)] [string]$Msg,[Parameter(Mandatory = $True)] [string]$Type,[Parameter(Mandatory = $False)] [string]$Info_msg) { - if ($Info_msg -ne $null) { - Write-Host $Info_msg +function _abort ([Parameter(Mandatory = $True)] [string]$Msg,[Parameter(Mandatory = $True)] [string]$Type,[Parameter(Mandatory = $False)] [string]$ExtMsg) { + if ($ExtMsg -ne $null) { + Write-Host $ExtMsg } Write-Error -Message "Error: $Msg" -Category $Type exit 1 @@ -157,7 +157,7 @@ function query_pack { info -Msg " [Detected] We'll use 'Chocolatey' as the default package mgr." $env:CCPACK_MGR = 'choco' } else { - _abort -Msg "Required executable not found." -Type "NotInstalled" -Info_msg @' + _abort -Msg "Required executable not found." -Type "NotInstalled" -ExtMsg @' You must install a modern package manager before installing this Nvim config. Available choices are: - Chocolatey @@ -292,7 +292,7 @@ function clone_repo ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [s safe_execute -WithCmd { git clone --progress -b "$env:CCLONE_BRANCH_LEGACY" "$env:CCLONE_ATTR" $WithURL "$env:CCDEST_DIR" } } else { warn -Msg "You have outdated Nvim installed (< $REQUIRED_NVIM_VERSION_LEGACY)." - _abort -Msg "This Neovim distribution is no longer supported." -Type "NotImplemented" -Info_msg @" + _abort -Msg "This Neovim distribution is no longer supported." -Type "NotImplemented" -ExtMsg @" You have a legacy Neovim distribution installed. Please make sure you have nvim v$REQUIRED_NVIM_VERSION_LEGACY installed at the very least. @@ -330,7 +330,7 @@ function _main { # Check dependencies if (-not (check_in_path -WithName "nvim")) { - _abort -Msg "Required executable not found." -Type "NotInstalled" -Info_msg @' + _abort -Msg "Required executable not found." -Type "NotInstalled" -ExtMsg @' You must install Neovim before installing this Nvim config. See: https://github.com/neovim/neovim/wiki/Installing-Neovim ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ @@ -340,7 +340,7 @@ You must install Neovim before installing this Nvim config. See: } if (-not (check_in_path -WithName "git")) { - _abort -Msg "Required executable not found." -Type "NotInstalled" -Info_msg @' + _abort -Msg "Required executable not found." -Type "NotInstalled" -ExtMsg @' You must install Git before installing this Nvim config. See: https://git-scm.com/ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ diff --git a/scripts/install.sh b/scripts/install.sh index 48956bbd6..0d1e113bb 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -41,8 +41,6 @@ fi tty_mkbold() { tty_escape "1;$1"; } tty_underline="$(tty_escape "4;39")" tty_yellow="$(tty_escape "0;33")" -tty_magenta="$(tty_mkbold 35)" -tty_green="$(tty_mkbold 32)" tty_blue="$(tty_mkbold 34)" tty_red="$(tty_mkbold 31)" tty_bold="$(tty_mkbold 39)" @@ -177,7 +175,7 @@ clone_repo() { elif check_nvim_version "${REQUIRED_NVIM_VERSION_LEGACY}"; then warn "You have outdated Nvim installed (< ${REQUIRED_NVIM_VERSION})." info "Automatically redirecting you to the latest compatible version..." - execute "git" "clone" "-b" "${REQUIRED_NVIM_VERSION_LEGACY}" "${CLONE_ATTR[@]}" "$1" "${DEST_DIR}" + execute "git" "clone" "-b" "0.9" "${CLONE_ATTR[@]}" "$1" "${DEST_DIR}" else warn "You have outdated Nvim installed (< ${REQUIRED_NVIM_VERSION_LEGACY})." abort "$( From 59bc46ba1c8ee3dce4cf767efdb412da46388c5c Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Fri, 7 Jun 2024 21:04:48 +0800 Subject: [PATCH 10/24] feat(README): supports `0.9` -> `0.10` Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0026d621a..c8c20d666 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Neovim Version Capability + src="https://img.shields.io/badge/Supports%20Nvim-v0.10-A6D895?style=for-the-badge&colorA=363A4F&logo=neovim&logoColor=D9E0EE"> Date: Fri, 7 Jun 2024 21:43:15 +0800 Subject: [PATCH 11/24] chore: cleanup Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/core/event.lua | 2 +- lua/core/init.lua | 11 ----------- lua/core/options.lua | 2 +- lua/modules/configs/editor/autotag.lua | 9 --------- lua/modules/configs/lang/crates-keymap.lua | 1 - lua/modules/plugins/tool.lua | 3 ++- lua/modules/utils/init.lua | 1 - 7 files changed, 4 insertions(+), 25 deletions(-) diff --git a/lua/core/event.lua b/lua/core/event.lua index 2ef32b51b..25d9eb466 100644 --- a/lua/core/event.lua +++ b/lua/core/event.lua @@ -6,7 +6,7 @@ function autocmd.nvim_create_augroups(definitions) vim.api.nvim_command("augroup " .. group_name) vim.api.nvim_command("autocmd!") for _, def in ipairs(definition) do - local command = table.concat(vim.iter({ "autocmd", def }):flatten(), " ") + local command = table.concat(vim.iter({ "autocmd", def }):flatten(math.huge):totable(), " ") vim.api.nvim_command(command) end vim.api.nvim_command("augroup END") diff --git a/lua/core/init.lua b/lua/core/init.lua index 646ca9645..a6ebc62cc 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -145,16 +145,6 @@ You're recommended to install PowerShell for better experience.]], end end -local _v0_10_workarounds = function() - local ok, watchfile = pcall(require, "vim.lsp._watchfiles") - if ok then - -- Disable lsp watcher - watchfile._watchfunc = function() - return function() end - end - end -end - local load_core = function() createdir() disable_distribution_plugins() @@ -164,7 +154,6 @@ local load_core = function() neovide_config() clipboard_config() shell_config() - _v0_10_workarounds() require("core.options") require("core.mapping") diff --git a/lua/core/options.lua b/lua/core/options.lua index b3b3e0295..8ee07be5f 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -120,7 +120,7 @@ local function load_options() end for name, value in pairs(require("modules.utils").extend_config(global_local, "user.options")) do - vim.o[name] = value + vim.api.nvim_set_option_value(name, value, {}) end end diff --git a/lua/modules/configs/editor/autotag.lua b/lua/modules/configs/editor/autotag.lua index 0071263f9..42dcd973f 100644 --- a/lua/modules/configs/editor/autotag.lua +++ b/lua/modules/configs/editor/autotag.lua @@ -1,18 +1,9 @@ return function() require("modules.utils").load_plugin("nvim-ts-autotag", { opts = { - -- Defaults enable_close = true, -- Auto close tags enable_rename = true, -- Auto rename pairs of tags enable_close_on_slash = false, -- Auto close on trailing ct"] = map_callback(function() crates.toggle() diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua index 2d8b9555d..e0e70fd5e 100644 --- a/lua/modules/plugins/tool.lua +++ b/lua/modules/plugins/tool.lua @@ -4,7 +4,7 @@ tool["tpope/vim-fugitive"] = { lazy = true, cmd = { "Git", "G" }, } --- only for fcitx5 user who uses non-English language during coding +-- This is specifically for fcitx5 users who code in languages other than English -- tool["pysan3/fcitx5.nvim"] = { -- lazy = true, -- event = "BufReadPost", @@ -14,6 +14,7 @@ tool["tpope/vim-fugitive"] = { tool["Bekaboo/dropbar.nvim"] = { lazy = false, dependencies = { + "nvim-tree/nvim-web-devicons", "nvim-telescope/telescope-fzf-native.nvim", }, } diff --git a/lua/modules/utils/init.lua b/lua/modules/utils/init.lua index 4161752f1..c2c9fd53e 100644 --- a/lua/modules/utils/init.lua +++ b/lua/modules/utils/init.lua @@ -121,7 +121,6 @@ end ---@param background string @The background color to blend with ---@param alpha number|string @Number between 0 and 1 for blending amount. function M.blend(foreground, background, alpha) - ---@diagnostic disable-next-line: cast-local-type alpha = type(alpha) == "string" and (tonumber(alpha, 16) / 0xff) or alpha local bg = hex_to_rgb(background) local fg = hex_to_rgb(foreground) From 9be7ffedd1e5f59dd911e0de70d9cfdf9fcd8ae4 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Sat, 8 Jun 2024 01:43:05 +0800 Subject: [PATCH 12/24] fix(lualine): ensure all components are properly aligned Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/ui/lualine.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/modules/configs/ui/lualine.lua b/lua/modules/configs/ui/lualine.lua index 39e4b8911..64c14371f 100644 --- a/lua/modules/configs/ui/lualine.lua +++ b/lua/modules/configs/ui/lualine.lua @@ -265,6 +265,7 @@ return function() colored = true, icon_only = false, icon = { align = "left" }, + padding = { left = 2, right = 1 }, }, components.file_status, vim.tbl_extend("force", components.separator, { From f6ebc056c255869e27750b0773c4c5c798692559 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:58:40 +0800 Subject: [PATCH 13/24] unlock rustaceanvim Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/plugins/lang.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/plugins/lang.lua b/lua/modules/plugins/lang.lua index 6877b0f0a..2cfc3974d 100644 --- a/lua/modules/plugins/lang.lua +++ b/lua/modules/plugins/lang.lua @@ -18,7 +18,7 @@ lang["ray-x/go.nvim"] = { lang["mrcjkb/rustaceanvim"] = { lazy = true, ft = "rust", - version = "^4", + version = "*", init = require("lang.rust"), dependencies = { "nvim-lua/plenary.nvim" }, } From 593c90618751b06dc440a938c3ecfba2c84a2506 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:40:24 +0800 Subject: [PATCH 14/24] feat(lsp): be protective Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/completion/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/configs/completion/lsp.lua b/lua/modules/configs/completion/lsp.lua index be60436db..ba3c5a873 100644 --- a/lua/modules/configs/completion/lsp.lua +++ b/lua/modules/configs/completion/lsp.lua @@ -19,5 +19,5 @@ return function() pcall(require, "user.configs.lsp") - vim.api.nvim_command([[LspStart]]) -- Start LSPs + pcall(vim.cmd.LspStart) -- Start LSPs end From a50a90e562d8525ee7f89f20b27fbf1c47be3282 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:55:22 +0800 Subject: [PATCH 15/24] fix: `neovim` -> `Neovim` Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/custom_config.yml | 2 +- .github/ISSUE_TEMPLATE/lsp_issue_report.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d4f8280d8..4906f93c9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -7,7 +7,7 @@ body: value: | _Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve! > [!IMPORTANT] - > The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. + > The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. - type: checkboxes id: is-latest-commit attributes: diff --git a/.github/ISSUE_TEMPLATE/custom_config.yml b/.github/ISSUE_TEMPLATE/custom_config.yml index 6b48fcd50..6a95d3903 100644 --- a/.github/ISSUE_TEMPLATE/custom_config.yml +++ b/.github/ISSUE_TEMPLATE/custom_config.yml @@ -7,7 +7,7 @@ body: value: | _Before requesting:_ Make sure you've read through our [Wiki: Usage](https://github.com/ayamir/nvimdots/wiki/Usage) before you start to add things to nvimdots! > [!IMPORTANT] - > The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. + > The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. - type: checkboxes id: is-latest-commit attributes: diff --git a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml index f18124c55..09978612c 100644 --- a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml +++ b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml @@ -7,7 +7,7 @@ body: value: | _Before reporting:_ Search [existing issues](https://github.com/ayamir/nvimdots/issues) and check the [FAQ](https://github.com/ayamir/nvimdots/wiki/Issues). Thank you for helping us improve! > [!IMPORTANT] - > The `0.11` branch is intended for nightly neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. + > The `0.11` branch is intended for nightly Neovim builds and is **not** stable. It typically harbors subtle issues scattered throughout. Therefore, refrain from submitting issues if you happen to encounter them. They will be closed directly unless a viable solution is proposed or included. - type: checkboxes id: is-latest-commit attributes: From a55678e8594c42511d72f685ce208bf79c57de7c Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 10 Jun 2024 00:23:59 +0800 Subject: [PATCH 16/24] Revert "fix(lualine): ensure all components are properly aligned" This reverts commit 9be7ffedd1e5f59dd911e0de70d9cfdf9fcd8ae4. --- lua/modules/configs/ui/lualine.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/modules/configs/ui/lualine.lua b/lua/modules/configs/ui/lualine.lua index 64c14371f..39e4b8911 100644 --- a/lua/modules/configs/ui/lualine.lua +++ b/lua/modules/configs/ui/lualine.lua @@ -265,7 +265,6 @@ return function() colored = true, icon_only = false, icon = { align = "left" }, - padding = { left = 2, right = 1 }, }, components.file_status, vim.tbl_extend("force", components.separator, { From e11310b0c2d14549bd47ce16b0b506a89cecb77e Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:57:35 +0800 Subject: [PATCH 17/24] feat: support new options (#1279) Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/core/options.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/core/options.lua b/lua/core/options.lua index 8ee07be5f..f79004ca2 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -17,8 +17,8 @@ local function load_options() clipboard = "unnamedplus", cmdheight = 1, -- 0, 1, 2 cmdwinheight = 5, - complete = ".,w,b,k", - completeopt = "menuone,noselect", + complete = ".,w,b,k,kspell", + completeopt = "menuone,noselect,popup", concealcursor = "niv", conceallevel = 0, cursorcolumn = true, @@ -70,6 +70,7 @@ local function load_options() signcolumn = "yes", smartcase = true, smarttab = true, + smoothscroll = true, splitbelow = true, splitkeep = "screen", splitright = true, From e8976c8cdf81ab22a935abbd6d93349b91705f54 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:59:49 +0800 Subject: [PATCH 18/24] feat(trouble)!: v3 support (#1281) * feat(trouble)!: v3 support This PR includes the following changes: - *REMOVED* all features unrelated to the original purpose of trouble.nvim, such as LSP References (Glance.nvim covers this) and qf-list preview (bqf handles this). - Added a custom mapping for searching project diagnostics. This is slightly different from workspace diagnostics: one is defined by the language server itself (e.g., see LuaLS's documentation on workspace diagnostics), while the other is determined with assistance from Project.nvim. - General cleanup: I deliberately excluded LspKind support from our config this time bc imho it's a feature we likely won't use and supporting it is a real hassle. Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fixup! Missing one option * fix: invoke `utils.load_plugin` Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/keymap/tool.lua | 19 +++---- lua/modules/configs/tool/trouble.lua | 75 +++++++++++---------------- lua/modules/configs/ui/catppuccin.lua | 1 + 3 files changed, 37 insertions(+), 58 deletions(-) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index a77f0b54f..50eead580 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -63,24 +63,19 @@ local plug_map = { :with_desc("git: Toggle lazygit"), -- Plugin: trouble - ["n|gt"] = map_cr("TroubleToggle"):with_noremap():with_silent():with_desc("lsp: Toggle trouble list"), - ["n|ll"] = map_cr("TroubleToggle lsp_references") + ["n|gt"] = map_cr("Trouble diagnostics toggle"):with_noremap():with_silent():with_desc("lsp: Toggle trouble list"), + ["n|lw"] = map_cr("Trouble diagnostics toggle") :with_noremap() :with_silent() - :with_desc("lsp: Show lsp references"), - ["n|ld"] = map_cr("TroubleToggle document_diagnostics") - :with_noremap() - :with_silent() - :with_desc("lsp: Show document diagnostics"), - ["n|lw"] = map_cr("TroubleToggle workspace_diagnostics") + :with_desc("lsp: Show workspace diagnostics"), + ["n|lp"] = map_cr("Trouble project_diagnostics toggle") :with_noremap() :with_silent() - :with_desc("lsp: Show workspace diagnostics"), - ["n|lq"] = map_cr("TroubleToggle quickfix") + :with_desc("lsp: Show project diagnostics"), + ["n|ld"] = map_cr("Trouble diagnostics toggle filter.buf=0") :with_noremap() :with_silent() - :with_desc("lsp: Show quickfix list"), - ["n|lL"] = map_cr("TroubleToggle loclist"):with_noremap():with_silent():with_desc("lsp: Show loclist"), + :with_desc("lsp: Show document diagnostics"), -- Plugin: telescope ["n|"] = map_callback(function() diff --git a/lua/modules/configs/tool/trouble.lua b/lua/modules/configs/tool/trouble.lua index 386af479a..6a9bbfcb0 100644 --- a/lua/modules/configs/tool/trouble.lua +++ b/lua/modules/configs/tool/trouble.lua @@ -1,55 +1,38 @@ return function() local icons = { - ui = require("modules.utils.icons").get("ui"), - diagnostics = require("modules.utils.icons").get("diagnostics"), + ui = require("modules.utils.icons").get("ui", true), } require("modules.utils").load_plugin("trouble", { - position = "bottom", -- position of the list can be: bottom, top, left, right - height = 10, -- height of the trouble list when position is top or bottom - width = 50, -- width of the list when position is left or right - icons = true, -- use devicons for filenames - mode = "document_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" - fold_open = icons.ui.ArrowOpen, -- icon used for open folds - fold_closed = icons.ui.ArrowClosed, -- icon used for closed folds - group = true, -- group results by file - padding = true, -- add an extra new line on top of the list - action_keys = { - -- key mappings for actions in the trouble list - -- map to {} to remove a mapping, for example: - -- close = {}, - close = "q", -- close the list - cancel = "", -- cancel the preview and get back to your last window / buffer / cursor - refresh = "r", -- manually refresh - jump = { "", "" }, -- jump to the diagnostic or open / close folds - open_split = { "" }, -- open buffer in new split - open_vsplit = { "" }, -- open buffer in new vsplit - open_tab = { "" }, -- open buffer in new tab - jump_close = { "o" }, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location - close_folds = { "zM", "zm" }, -- close all folds - open_folds = { "zR", "zr" }, -- open all folds - toggle_fold = { "zA", "za" }, -- toggle fold of current file - previous = "k", -- preview item - next = "j", -- next item + auto_open = false, + auto_close = false, + auto_jump = false, + auto_preview = true, + auto_refresh = true, + focus = false, -- do not focus the window when opened + follow = true, + restore = true, + icons = { + indent = { + fold_open = icons.ui.ArrowOpen, + fold_closed = icons.ui.ArrowClosed, + }, + folder_closed = icons.ui.Folder, + folder_open = icons.ui.FolderOpen, }, - indent_lines = true, -- add an indent guide below the fold icons - auto_open = false, -- automatically open the list when you have diagnostics - auto_close = false, -- automatically close the list when you have no diagnostics - auto_preview = true, -- automatically preview the location of the diagnostic. to close preview and go back to last window - auto_fold = false, -- automatically fold a file trouble list at creation - auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result - signs = { - -- icons / text used for a diagnostic - error = icons.diagnostics.Error_alt, - warning = icons.diagnostics.Warning_alt, - hint = icons.diagnostics.Hint_alt, - information = icons.diagnostics.Information_alt, - other = icons.diagnostics.Question_alt, + modes = { + project_diagnostics = { + mode = "diagnostics", + filter = { + any = { + { + function(item) + return item.filename:find(vim.fn.getcwd(), 1, true) + end, + }, + }, + }, + }, }, - use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client }) end diff --git a/lua/modules/configs/ui/catppuccin.lua b/lua/modules/configs/ui/catppuccin.lua index b3a402394..c0a9048b1 100644 --- a/lua/modules/configs/ui/catppuccin.lua +++ b/lua/modules/configs/ui/catppuccin.lua @@ -146,6 +146,7 @@ return function() -- For trouble.nvim TroubleNormal = { bg = transparent_background and cp.none or cp.base }, + TroubleNormalNC = { bg = transparent_background and cp.none or cp.base }, -- For telescope.nvim TelescopeMatching = { fg = cp.lavender }, From b74c753d3ff26a8bd3adb881813c9fee03983b82 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:01:24 +0800 Subject: [PATCH 19/24] refactor: overhaul the icon library (#1282) This PR significantly updates the icon library by expanding its content, removing duplicates, and organizing icons into more cohesive groups. I've also created a custom Dropbar config that uses these icons and adds toggleterm support. * fix typo * Oops... Missing one icon * fix: invoke `utils.load_plugin` Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/completion/lspsaga.lua | 2 +- lua/modules/configs/tool/dropbar.lua | 109 +++++++++++++++++++++ lua/modules/plugins/tool.lua | 1 + lua/modules/utils/icons.lua | 67 +++++++------ 4 files changed, 150 insertions(+), 29 deletions(-) create mode 100644 lua/modules/configs/tool/dropbar.lua diff --git a/lua/modules/configs/completion/lspsaga.lua b/lua/modules/configs/completion/lspsaga.lua index c31f280b3..d389991be 100644 --- a/lua/modules/configs/completion/lspsaga.lua +++ b/lua/modules/configs/completion/lspsaga.lua @@ -148,7 +148,6 @@ return function() Method = { icons.kind.Method, "LspKindMethod" }, Module = { icons.kind.Module, "LspKindModule" }, Namespace = { icons.kind.Namespace, "LspKindNamespace" }, - Number = { icons.kind.Number, "LspKindNumber" }, Operator = { icons.kind.Operator, "LspKindOperator" }, Package = { icons.kind.Package, "LspKindPackage" }, Property = { icons.kind.Property, "LspKindProperty" }, @@ -159,6 +158,7 @@ return function() Array = { icons.type.Array, "LspKindArray" }, Boolean = { icons.type.Boolean, "LspKindBoolean" }, Null = { icons.type.Null, "LspKindNull" }, + Number = { icons.type.Number, "LspKindNumber" }, Object = { icons.type.Object, "LspKindObject" }, String = { icons.type.String, "LspKindString" }, -- ccls-specific icons. diff --git a/lua/modules/configs/tool/dropbar.lua b/lua/modules/configs/tool/dropbar.lua new file mode 100644 index 000000000..a02dcaf04 --- /dev/null +++ b/lua/modules/configs/tool/dropbar.lua @@ -0,0 +1,109 @@ +return function() + local icons = { + kind = require("modules.utils.icons").get("kind", true), + type = require("modules.utils.icons").get("type", true), + misc = require("modules.utils.icons").get("misc", true), + ui = require("modules.utils.icons").get("ui", true), + } + + require("modules.utils").load_plugin("dropbar", { + bar = { + hover = false, + truncate = true, + pick = { pivots = "etovxqpdygfblzhckisuran" }, + }, + sources = { + path = { + relative_to = function() + -- Only show the leaf filename in dropbar + return vim.fn.expand("%:p:h") + end, + }, + terminal = { + name = function(buf) + local name = vim.api.nvim_buf_get_name(buf) + local term = select(2, require("toggleterm.terminal").identify(name)) + -- Trying to "snag" a display name from toggleterm + if term then + return term.display_name or term.name + else + return name + end + end, + }, + }, + icons = { + enable = true, + kinds = { + use_devicons = true, + symbols = { + -- Type + Array = icons.type.Array, + Boolean = icons.type.Boolean, + Null = icons.type.Null, + Number = icons.type.Number, + Object = icons.type.Object, + String = icons.type.String, + Text = icons.type.String, + + -- Kind + BreakStatement = icons.kind.Break, + Call = icons.kind.Call, + CaseStatement = icons.kind.Case, + Class = icons.kind.Class, + Color = icons.kind.Color, + Constant = icons.kind.Constant, + Constructor = icons.kind.Constructor, + ContinueStatement = icons.kind.Continue, + Declaration = icons.kind.Declaration, + Delete = icons.kind.Delete, + DoStatement = icons.kind.Loop, + Enum = icons.kind.Enum, + EnumMember = icons.kind.EnumMember, + Event = icons.kind.Event, + Field = icons.kind.Field, + File = icons.kind.File, + ForStatement = icons.kind.Loop, + Function = icons.kind.Function, + Identifier = icons.kind.Variable, + Interface = icons.kind.Interface, + Keyword = icons.kind.Keyword, + List = icons.kind.List, + Lsp = icons.misc.LspAvailable, + Method = icons.kind.Method, + Module = icons.kind.Module, + Namespace = icons.kind.Namespace, + Operator = icons.kind.Operator, + Package = icons.kind.Package, + Pair = icons.kind.List, + Property = icons.kind.Property, + Reference = icons.kind.Reference, + Regex = icons.kind.Regex, + Repeat = icons.kind.Loop, + Scope = icons.kind.Statement, + Snippet = icons.kind.Snippet, + Statement = icons.kind.Statement, + Struct = icons.kind.Struct, + SwitchStatement = icons.kind.Switch, + Type = icons.kind.Interface, + TypeParameter = icons.kind.TypeParameter, + Unit = icons.kind.Unit, + Value = icons.kind.Value, + Variable = icons.kind.Variable, + WhileStatement = icons.kind.Loop, + + -- Microsoft-specific icons + Folder = icons.kind.Folder, + + -- ccls-specific icons + Macro = icons.kind.Macro, + Terminal = icons.kind.Terminal, + }, + }, + ui = { + bar = { separator = "  " }, + menu = { indicator = icons.ui.ArrowClosed }, + }, + }, + }) +end diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua index e0e70fd5e..33fb33424 100644 --- a/lua/modules/plugins/tool.lua +++ b/lua/modules/plugins/tool.lua @@ -13,6 +13,7 @@ tool["tpope/vim-fugitive"] = { -- } tool["Bekaboo/dropbar.nvim"] = { lazy = false, + config = require("tool.dropbar"), dependencies = { "nvim-tree/nvim-web-devicons", "nvim-telescope/telescope-fzf-native.nvim", diff --git a/lua/modules/utils/icons.lua b/lua/modules/utils/icons.lua index 2b24b3cdb..eab8da2c7 100644 --- a/lua/modules/utils/icons.lua +++ b/lua/modules/utils/icons.lua @@ -2,10 +2,16 @@ local icons = {} local data = { kind = { + Break = "󰙧", + Call = "󰃷", + Case = "󰬶", Class = "󰠱", Color = "󰏘", Constant = "󰏿", Constructor = "", + Continue = "󰞘", + Declaration = "󰙠", + Delete = "󱟁", Enum = "", EnumMember = "", Event = "", @@ -14,30 +20,35 @@ local data = { Folder = "󰉋", Fragment = "", Function = "󰊕", - Interface = "", Implementation = "", + Interface = "", Keyword = "󰌋", + List = "󰅪", + Loop = "󰑖", Method = "󰆧", Module = "", Namespace = "󰌗", - Number = "", Operator = "󰆕", Package = "", Property = "󰜢", Reference = "", + Regex = "", Snippet = "", + Statement = "󰅩", Struct = "", + Switch = "", Text = "󰉿", TypeParameter = "󰅲", Undefined = "", Unit = "", Value = "󰎠", Variable = "", - -- ccls-specific icons. - TypeAlias = "", + -- ccls-specific icons + Macro = "", Parameter = "", StaticMethod = "", - Macro = "", + Terminal = "", + TypeAlias = "", }, type = { Array = "󰅪", @@ -92,6 +103,7 @@ local data = { CodeAction = "󰌵", Comment = "󰅺", Dashboard = "", + DoubleSeparator = "󰄾", Emoji = "󰱫", EmptyFolder = "", EmptyFolderOpen = "", @@ -107,8 +119,6 @@ local data = { Keyboard = "", Left = "", List = "", - Square = "", - SymlinkFolder = "", Lock = "󰍁", Modified = "✥", Modified_alt = "", @@ -125,12 +135,13 @@ local data = { RootFolderOpened = "", Search = "󰍉", Separator = "", - DoubleSeparator = "󰄾", SignIn = "", SignOut = "", Sort = "", Spell = "󰓆", + Square = "", Symlink = "", + SymlinkFolder = "", Tab = "", Table = "", Telescope = "", @@ -142,7 +153,7 @@ local data = { Information = "", Question = "", Hint = "󰌵", - -- Holo version + -- Hollow version Error_alt = "󰅚", Warning_alt = "󰀪", Information_alt = "", @@ -150,37 +161,28 @@ local data = { Hint_alt = "󰌶", }, misc = { + Add = "+", + Added = "", Campass = "󰀹", Code = "", Gavel = "", + Ghost = "󰊠", Glass = "󰂖", + Lego = "", + LspAvailable = "󱜙", + ManUp = "", + Neovim = "", NoActiveLsp = "󱚧", PyEnv = "󰢩", Squirrel = "", Tag = "", Tree = "", - Watch = "", - Lego = "", - LspAvailable = "󱜙", Vbar = "│", - Add = "+", - Added = "", - Ghost = "󰊠", - ManUp = "", - Neovim = "", Vim = "", + Watch = "", }, cmp = { - Codeium = "", - TabNine = "", - Copilot = "", - Copilot_alt = "", - -- Add source-specific icons here - buffer = "", - cmp_tabnine = "", - codeium = "", - copilot = "", - copilot_alt = "", + buffer = "󰉿", latex_symbols = "", luasnip = "󰃐", nvim_lsp = "", @@ -191,6 +193,15 @@ local data = { tmux = "", treesitter = "", undefined = "", + -- Add source-specific icons here + codeium = "", + Codeium = "", + copilot = "", + copilot_alt = "", + Copilot = "", + Copilot_alt = "", + TabNine = "", + cmp_tabnine = "", }, dap = { Breakpoint = "󰝥", @@ -211,7 +222,7 @@ local data = { ---Get a specific icon set. ---@param category "kind"|"type"|"documents"|"git"|"ui"|"diagnostics"|"misc"|"cmp"|"dap" ----@param add_space? boolean @Add trailing space after the icon. +---@param add_space? boolean @Add trailing whitespace after the icon. function icons.get(category, add_space) if add_space then return setmetatable({}, { From f639f8776856d94bb13aed6caf4094c8f70bf808 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:01:43 +0800 Subject: [PATCH 20/24] feat(lsp): correctly configure diagnostic-signs (#1280) Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/completion/lspsaga.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lua/modules/configs/completion/lspsaga.lua b/lua/modules/configs/completion/lspsaga.lua index d389991be..162cdda2c 100644 --- a/lua/modules/configs/completion/lspsaga.lua +++ b/lua/modules/configs/completion/lspsaga.lua @@ -10,17 +10,17 @@ return function() } local function set_sidebar_icons() - -- Set icons for sidebar. - local diagnostic_icons = { - Error = icons.diagnostics.Error_alt, - Warn = icons.diagnostics.Warning_alt, - Info = icons.diagnostics.Information_alt, - Hint = icons.diagnostics.Hint_alt, - } - for type, icon in pairs(diagnostic_icons) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl }) - end + -- Set icons for sidebar + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = icons.diagnostics.Error_alt, + [vim.diagnostic.severity.WARN] = icons.diagnostics.Warning_alt, + [vim.diagnostic.severity.INFO] = icons.diagnostics.Information_alt, + [vim.diagnostic.severity.HINT] = icons.diagnostics.Hint_alt, + }, + }, + }) end set_sidebar_icons() From 2da7aedcf002f0b6bf12c2530576d9230fd05683 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:44:21 +0800 Subject: [PATCH 21/24] feat: disable more plugins for RO (buf|file)types (#1284) Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/completion/copilot.lua | 8 +++++- lua/modules/configs/editor/autoclose.lua | 18 ++++++++++++- lua/modules/configs/editor/bigfile.lua | 2 +- lua/modules/configs/tool/nvim-tree.lua | 23 ++++++++++++++-- lua/modules/configs/ui/indent-blankline.lua | 29 ++++++++++++--------- lua/modules/configs/ui/neodim.lua | 23 +++++++++++++++- lua/modules/configs/ui/scrollview.lua | 12 ++++++++- lua/modules/configs/ui/todo.lua | 17 +++++++++++- 8 files changed, 112 insertions(+), 20 deletions(-) diff --git a/lua/modules/configs/completion/copilot.lua b/lua/modules/configs/completion/copilot.lua index 96de94fd1..a6ea78c2a 100644 --- a/lua/modules/configs/completion/copilot.lua +++ b/lua/modules/configs/completion/copilot.lua @@ -14,8 +14,14 @@ return function() enabled = false, }, filetypes = { + ["bigfile"] = false, ["dap-repl"] = false, - ["big_file_disabled_ft"] = false, + ["fugitive"] = false, + ["fugitiveblame"] = false, + ["git"] = false, + ["gitcommit"] = false, + ["log"] = false, + ["toggleterm"] = false, }, }) end, 100) diff --git a/lua/modules/configs/editor/autoclose.lua b/lua/modules/configs/editor/autoclose.lua index d5e9b0d46..a43888f49 100644 --- a/lua/modules/configs/editor/autoclose.lua +++ b/lua/modules/configs/editor/autoclose.lua @@ -16,8 +16,24 @@ return function() ["'"] = { escape = true, close = true, pair = "''", disabled_filetypes = { "rust" } }, }, options = { - disabled_filetypes = { "big_file_disabled_ft" }, disable_when_touch = false, + disabled_filetypes = { + "alpha", + "bigfile", + "checkhealth", + "dap-repl", + "diff", + "help", + "log", + "notify", + "NvimTree", + "Outline", + "qf", + "TelescopePrompt", + "toggleterm", + "undotree", + "vimwiki", + }, }, }) end diff --git a/lua/modules/configs/editor/bigfile.lua b/lua/modules/configs/editor/bigfile.lua index c260a4432..28071772a 100644 --- a/lua/modules/configs/editor/bigfile.lua +++ b/lua/modules/configs/editor/bigfile.lua @@ -3,7 +3,7 @@ return function() name = "ftdetect", opts = { defer = true }, disable = function() - vim.api.nvim_set_option_value("filetype", "big_file_disabled_ft", { scope = "local" }) + vim.api.nvim_set_option_value("filetype", "bigfile", { scope = "local" }) end, } diff --git a/lua/modules/configs/tool/nvim-tree.lua b/lua/modules/configs/tool/nvim-tree.lua index 3f6f64112..fcf5288ce 100644 --- a/lua/modules/configs/tool/nvim-tree.lua +++ b/lua/modules/configs/tool/nvim-tree.lua @@ -126,8 +126,27 @@ return function() enable = true, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", exclude = { - filetype = { "notify", "qf", "diff", "fugitive", "fugitiveblame" }, - buftype = { "terminal", "help" }, + buftype = { + "help", + "nofile", + "prompt", + "quickfix", + "terminal", + }, + filetype = { + "dap-repl", + "diff", + "fugitive", + "fugitiveblame", + "git", + "notify", + "NvimTree", + "Outline", + "qf", + "TelescopePrompt", + "toggleterm", + "undotree", + }, }, }, }, diff --git a/lua/modules/configs/ui/indent-blankline.lua b/lua/modules/configs/ui/indent-blankline.lua index 1f55ea3a9..0f7b52d07 100644 --- a/lua/modules/configs/ui/indent-blankline.lua +++ b/lua/modules/configs/ui/indent-blankline.lua @@ -63,32 +63,37 @@ return function() }, }, exclude = { + buftypes = { + "help", + "nofile", + "prompt", + "quickfix", + "terminal", + }, filetypes = { "", -- for all buffers without a file type - "aerial", "alpha", - "big_file_disabled_ft", - "dashboard", - "dotooagenda", - "flutterToolsOutline", + "bigfile", + "checkhealth", + "dap-repl", + "diff", "fugitive", + "fugitiveblame", "git", "gitcommit", "help", - "json", "log", "markdown", + "notify", "NvimTree", - "peekaboo", - "startify", + "Outline", + "qf", "TelescopePrompt", - "todoist", - "txt", + "text", + "toggleterm", "undotree", "vimwiki", - "vista", }, - buftypes = { "terminal", "nofile", "quickfix", "prompt" }, }, }) end diff --git a/lua/modules/configs/ui/neodim.lua b/lua/modules/configs/ui/neodim.lua index 17a5b262c..08ee94d66 100644 --- a/lua/modules/configs/ui/neodim.lua +++ b/lua/modules/configs/ui/neodim.lua @@ -11,6 +11,27 @@ return function() underline = false, }, priority = 80, - disable = { "big_file_disabled_ft" }, + disable = { + "alpha", + "bigfile", + "checkhealth", + "dap-repl", + "diff", + "fugitive", + "fugitiveblame", + "git", + "gitcommit", + "help", + "log", + "notify", + "NvimTree", + "Outline", + "qf", + "TelescopePrompt", + "text", + "toggleterm", + "undotree", + "vimwiki", + }, }) end diff --git a/lua/modules/configs/ui/scrollview.lua b/lua/modules/configs/ui/scrollview.lua index d3a821d53..ef11b5992 100644 --- a/lua/modules/configs/ui/scrollview.lua +++ b/lua/modules/configs/ui/scrollview.lua @@ -3,12 +3,22 @@ return function() require("modules.utils").load_plugin("scrollview", { mode = "virtual", - excluded_filetypes = { "NvimTree", "terminal", "nofile", "aerial" }, winblend = 0, signs_on_startup = { "diagnostics", "folds", "marks", "search", "spell" }, diagnostics_error_symbol = icons.diagnostics.Error, diagnostics_warn_symbol = icons.diagnostics.Warning, diagnostics_info_symbol = icons.diagnostics.Information, diagnostics_hint_symbol = icons.diagnostics.Hint, + excluded_filetypes = { + "alpha", + "fugitive", + "git", + "notify", + "NvimTree", + "Outline", + "TelescopePrompt", + "toggleterm", + "undotree", + }, }) end diff --git a/lua/modules/configs/ui/todo.lua b/lua/modules/configs/ui/todo.lua index bbd8af4b8..ebdef8ee3 100644 --- a/lua/modules/configs/ui/todo.lua +++ b/lua/modules/configs/ui/todo.lua @@ -30,7 +30,22 @@ return function() after = "", comments_only = true, max_line_len = 500, - exclude = { "big_file_disabled_ft", "checkhealth" }, + exclude = { + "alpha", + "bigfile", + "checkhealth", + "dap-repl", + "diff", + "help", + "log", + "notify", + "NvimTree", + "Outline", + "qf", + "TelescopePrompt", + "toggleterm", + "undotree", + }, }, colors = { error = { "DiagnosticError", "ErrorMsg", "#DC2626" }, From 281930a05b8fbc391866b1b04fd106b8cde23498 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:56:50 +0800 Subject: [PATCH 22/24] fix(alpha): cannot cast `string` to `integer` for winheight (#1285) iirc this is deprecated Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/ui/alpha.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/configs/ui/alpha.lua b/lua/modules/configs/ui/alpha.lua index c84dbcf06..73a489c12 100644 --- a/lua/modules/configs/ui/alpha.lua +++ b/lua/modules/configs/ui/alpha.lua @@ -113,7 +113,7 @@ return function() local head_butt_padding = 2 local occu_height = #dashboard.section.header.val + 2 * #dashboard.section.buttons.val + head_butt_padding - local header_padding = math.max(0, math.ceil((vim.fn.winheight("$") - occu_height) * 0.25)) + local header_padding = math.max(0, math.ceil((vim.fn.winheight(0) - occu_height) * 0.25)) local foot_butt_padding = 1 dashboard.config.layout = { From 2e848272b1564720dc0e4cad2d1726f09a956099 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:09:21 +0800 Subject: [PATCH 23/24] feat(ibl): support per-language indent config (#1287) * feat(ibl): support per-language indent config Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fixup! feat(ibl): support per-language indent config --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/ui/indent-blankline.lua | 498 ++++++++++++++++++-- 1 file changed, 458 insertions(+), 40 deletions(-) diff --git a/lua/modules/configs/ui/indent-blankline.lua b/lua/modules/configs/ui/indent-blankline.lua index 0f7b52d07..987b6fdec 100644 --- a/lua/modules/configs/ui/indent-blankline.lua +++ b/lua/modules/configs/ui/indent-blankline.lua @@ -1,4 +1,414 @@ return function() + -- This list delineates the per-language nodes used for guiding |ibl| in highlighting the current scope + -- It is extracted from each language's `indents.scm` file + -- NOTE: Only a subset of the supported programming languages is included + -- If your preferred language isn't listed, you can add it to the user config + local nodes = { + bibtex = { + "entry", + }, + c = { + "case_statement", + "compound_literal_expression", + "enumerator_list", + "field_declaration_list", + "initializer_list", + "init_declarator", + }, + cmake = { + "block_def", + "foreach_loop", + "function_def", + "if_condition", + "macro_def", + "normal_command", + "while_loop", + }, + cpp = { + "case_statement", + "compound_literal_expression", + "condition_clause", + "enumerator_list", + "field_declaration_list", + "field_initializer_list", + "init_declarator", + "initializer_list", + "namespace_definition", + }, + css = { + "block", + "declaration", + }, + d = { + "aggregate_body", + "block_statement", + "case_statement", + "expression_statement", + "function_body", + "parameters", + "scope_statement", + "template_parameters", + }, + dart = { + "arguments", + "class_body", + "formal_parameter", + "formal_parameter_list", + "function_body", + "function_expression_body", + "initializers", + "list_literal", + "return_statement", + "switch_block", + }, + ecma = { + "arguments", + "array", + "binary_expression", + "call_expression", + "class_body", + "export_clause", + "formal_parameters", + "named_imports", + "object", + "object_pattern", + "parenthesized_expression", + "return_statement", + "switch_case", + "switch_default", + "switch_statement", + "template_substitution", + "ternary_expression", + }, + elixir = { + "arguments", + "block", + "do_block", + "list", + "map", + "tuple", + }, + firrtl = { + "memory", + }, + fortran = { + "derived_type_definition", + "do_loop_statement", + "enum", + "function", + "if_statement", + "module", + "program", + "subroutine", + "where_statement", + }, + go = { + "call_expression", + "communication_case", + "const_declaration", + "default_case", + "expression_case", + "import_declaration", + "literal_value", + "parameter_list", + "struct_type", + "type_case", + "type_declaration", + "var_declaration", + }, + html = { + "start_tag", + }, + java = { + "annotation_argument_list", + "annotation_type_body", + "argument_list", + "array_initializer", + "class_body", + "constructor_body", + "element_value_array_initializer", + "enum_body", + "formal_parameters", + "interface_body", + "method_invocation", + "switch_block", + }, + javascript = { + "arguments", + "array", + "binary_expression", + "call_expression", + "class_body", + "export_clause", + "formal_parameters", + "jsx_expression", + "jsx_self_closing_element", + "named_imports", + "object", + "object_pattern", + "parenthesized_expression", + "return_statement", + "switch_case", + "switch_default", + "switch_statement", + "template_substitution", + "ternary_expression", + }, + julia = { + "assignment", + "call_expression", + "compound_statement", + "comprehension_expression", + "for_binding", + "if_statement", + "matrix_expression", + "parenthesized_expression", + "struct_definition", + "tuple_expression", + "vector_expression", + }, + linkerscript = { + "memory_command", + "output_section", + "phdrs_command", + "sections_command", + }, + lua = { + "arguments", + "field", + "method_index_expression", + "return_statement", + "table_constructor", + }, + matlab = { + "class_definition", + "enumeration", + "events", + "for_statement", + "if_statement", + "methods", + "properties", + "switch_statement", + "try_statement", + "while_statement", + }, + ninja = { + "build", + "pool", + "rule", + }, + pascal = { + "arrInitializer", + "block", + "declArgs", + "declClass", + "declConsts", + "declProc", + "declTypes", + "declUses", + "declVars", + "defaultValue", + "exprArgs", + "exprBrackets", + "exprParens", + "exprSubscript", + "recInitializer", + "statement", + }, + php = { + "arguments", + "array_creation_expression", + "binary_expression", + "case_statement", + "compound_statement", + "declaration_list", + "default_statement", + "enum_declaration_list", + "formal_parameters", + "match_block", + "member_call_expression", + "parenthesized_expression", + "return_statement", + "switch_block", + }, + python = { + "binary_operator", + "case_clause", + "concatenated_string", + "for_statement", + "generator_expression", + "if_statement", + "import_from_statement", + "lambda", + "list_pattern", + "match_statement", + "parenthesized_expression", + "try_statement", + "tuple_pattern", + "while_statement", + "with_statement", + }, + query = { + "list", + "predicate", + }, + r = { + "brace_list", + "call", + "paren_list", + "pipe", + "special", + }, + readline = { + "conditional_construct", + }, + ruby = { + "argument_list", + "array", + "assignment", + "begin", + "call", + "case", + "for", + "hash", + "if", + "module", + "parenthesized_statements", + "singleton_class", + "singleton_method", + "unless", + "until", + "while", + }, + rust = { + "arguments", + "array_expression", + "assignment_expression", + "call_expression", + "enum_variant_list", + "field_declaration_list", + "macro_definition", + "match_block", + "mod_item", + "ordered_field_declaration_list", + "parameters", + "struct_expression", + "struct_pattern", + "token_repetition", + "token_tree", + "trait_item", + "tuple_expression", + "tuple_pattern", + "tuple_struct_pattern", + "tuple_type", + "use_list", + "where_clause", + }, + sql = { + "case", + "column_definitions", + "cte", + "insert", + "select", + "subquery", + "when_clause", + }, + ssh_config = { + "host_declaration", + "match_declaration", + }, + swift = { + "array_literal", + "array_type", + "assignment", + "call_expression", + "class_body", + "computed_getter", + "computed_property", + "computed_setter", + "control_transfer_statement", + "deinit_declaration", + "dictionary_literal", + "dictionary_type", + "didset_clause", + "enum_class_body", + "init_declaration", + "lambda_literal", + "protocol_body", + "subscript_declaration", + "tuple_expression", + "tuple_type", + "type_parameters", + "willset_clause", + "willset_didset_block", + }, + tablegen = { + "assert", + "value_suffix", + }, + tcl = { + "braced_word_simple", + "command", + "command_substitution", + "conditional", + "foreach", + "namespace", + "procedure", + "try", + "while", + }, + teal = { + "record_declaration", + "function_body", + "table_constructor", + "return_statement", + "while_statement", + }, + textproto = { + "message_list", + "message_value", + "scalar_list", + }, + toml = { + "array", + "inline_table", + }, + typescript = { + "arguments", + "array", + "binary_expression", + "call_expression", + "class_body", + "enum_declaration", + "export_clause", + "formal_parameters", + "interface_declaration", + "named_imports", + "object", + "object_pattern", + "object_type", + "parenthesized_expression", + "return_statement", + "switch_case", + "switch_default", + "switch_statement", + "template_substitution", + "ternary_expression", + }, + vue = { + "start_tag", + }, + xml = { + "element", + }, + zig = { + "Block", + "ContainerDecl", + "InitList", + "SwitchExpr", + }, + } + require("modules.utils").load_plugin("ibl", { enabled = true, debounce = 200, @@ -19,46 +429,54 @@ return function() priority = 1000, include = { node_type = { - ["*"] = { - "argument_list", - "arguments", - "assignment_statement", - "Block", - "class", - "ContainerDecl", - "dictionary", - "do_block", - "do_statement", - "element", - "except", - "FnCallArguments", - "for", - "for_statement", - "function", - "function_declaration", - "function_definition", - "if_statement", - "IfExpr", - "IfStatement", - "import", - "InitList", - "list_literal", - "method", - "object", - "ParamDeclList", - "repeat_statement", - "selector", - "SwitchExpr", - "table", - "table_constructor", - "try", - "tuple", - "type", - "var", - "while", - "while_statement", - "with", - }, + angular = nodes.html, + arduino = nodes.cpp, + astro = nodes.html, + bibtex = nodes.bibtex, + c = nodes.c, + cmake = nodes.cmake, + cpp = nodes.cpp, + css = nodes.css, + cuda = nodes.cpp, + d = nodes.d, + dart = nodes.dart, + ecma = nodes.ecma, + elixir = nodes.elixir, + firrtl = nodes.firrtl, + fortran = nodes.fortran, + glsl = nodes.c, + go = nodes.go, + hlsl = nodes.cpp, + html = nodes.html, + java = nodes.java, + javascript = nodes.javascript, + julia = nodes.julia, + linkerscript = nodes.linkerscript, + lua = nodes.lua, + luau = nodes.lua, + matlab = nodes.matlab, + ninja = nodes.ninja, + objc = nodes.c, + pascal = nodes.pascal, + php = nodes.php, + python = nodes.python, + query = nodes.query, + r = nodes.r, + readline = nodes.readline, + ruby = nodes.ruby, + rust = nodes.rust, + sql = nodes.sql, + ssh_config = nodes.ssh_config, + swift = nodes.swift, + tablegen = nodes.tablegen, + tcl = nodes.tcl, + teal = nodes.teal, + textproto = nodes.textproto, + toml = nodes.toml, + typescript = nodes.typescript, + vue = nodes.vue, + xml = nodes.xml, + zig = nodes.zig, }, }, }, From 086bb81a82ffa78812c23e68363ded7b7a305006 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Thu, 13 Jun 2024 09:39:01 +0800 Subject: [PATCH 24/24] feat(ibl): more language nodes (#1288) * feat(ibl): more language nodes Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * feat(ibl): even more language nodes Signed-off-by: Charles Chiu * chore(ibl): sorting Signed-off-by: Charles Chiu --------- Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Signed-off-by: Charles Chiu Co-authored-by: Charles Chiu --- lua/modules/configs/ui/indent-blankline.lua | 61 +++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/lua/modules/configs/ui/indent-blankline.lua b/lua/modules/configs/ui/indent-blankline.lua index 987b6fdec..169a56f29 100644 --- a/lua/modules/configs/ui/indent-blankline.lua +++ b/lua/modules/configs/ui/indent-blankline.lua @@ -61,6 +61,10 @@ return function() "return_statement", "switch_block", }, + dot = { + "block", + "attr_list", + }, ecma = { "arguments", "array", @@ -102,6 +106,23 @@ return function() "subroutine", "where_statement", }, + gleam = { + "anonymous_function", + "assert", + "case", + "constant", + "external_function", + "function", + "import", + "let", + "list", + "constant", + "function", + "type_definition", + "type_alias", + "todo", + "tuple", + }, go = { "call_expression", "communication_case", @@ -118,6 +139,7 @@ return function() }, html = { "start_tag", + "self_closing_tag", }, java = { "annotation_argument_list", @@ -167,6 +189,11 @@ return function() "tuple_expression", "vector_expression", }, + just = { + "external_command", + "recipe", + "string", + }, linkerscript = { "memory_command", "output_section", @@ -197,6 +224,20 @@ return function() "pool", "rule", }, + ocaml = { + "application_expression", + "do_clause", + "external", + "field_expression", + "if_expression", + "list_expression", + "parenthesized_expression", + "record_declaration", + "record_expression", + "try_expression", + "type_binding", + "value_specification", + }, pascal = { "arrInitializer", "block", @@ -304,6 +345,13 @@ return function() "use_list", "where_clause", }, + scss = { + "block", + "declaration", + "each_statement", + "mixin_statement", + "while_statement", + }, sql = { "case", "column_definitions", @@ -364,6 +412,12 @@ return function() "return_statement", "while_statement", }, + terraform = { + "block", + "function_call", + "object", + "tuple", + }, textproto = { "message_list", "message_value", @@ -440,23 +494,28 @@ return function() cuda = nodes.cpp, d = nodes.d, dart = nodes.dart, + dot = nodes.dot, ecma = nodes.ecma, elixir = nodes.elixir, firrtl = nodes.firrtl, fortran = nodes.fortran, glsl = nodes.c, + gleam = nodes.gleam, go = nodes.go, hlsl = nodes.cpp, html = nodes.html, java = nodes.java, javascript = nodes.javascript, julia = nodes.julia, + just = nodes.just, linkerscript = nodes.linkerscript, lua = nodes.lua, luau = nodes.lua, matlab = nodes.matlab, ninja = nodes.ninja, objc = nodes.c, + ocaml = nodes.ocaml, + ocaml_interface = nodes.ocaml, pascal = nodes.pascal, php = nodes.php, python = nodes.python, @@ -465,12 +524,14 @@ return function() readline = nodes.readline, ruby = nodes.ruby, rust = nodes.rust, + scss = nodes.scss, sql = nodes.sql, ssh_config = nodes.ssh_config, swift = nodes.swift, tablegen = nodes.tablegen, tcl = nodes.tcl, teal = nodes.teal, + terraform = nodes.terraform, textproto = nodes.textproto, toml = nodes.toml, typescript = nodes.typescript,