From 12572d16d363a54728471fe23831d8ceb9676679 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Thu, 13 Apr 2023 16:53:02 +0800 Subject: [PATCH 01/18] perf(0.9): `stabilize.nvim` had been upstream to `0.9` --- lua/modules/plugins/editor.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lua/modules/plugins/editor.lua b/lua/modules/plugins/editor.lua index 0322b8be1..88fe34965 100644 --- a/lua/modules/plugins/editor.lua +++ b/lua/modules/plugins/editor.lua @@ -58,10 +58,6 @@ editor["RRethy/vim-illuminate"] = { event = { "CursorHold", "CursorHoldI" }, config = require("editor.vim-illuminate"), } -editor["luukvbaal/stabilize.nvim"] = { - lazy = true, - event = "BufReadPost", -} editor["romainl/vim-cool"] = { lazy = true, event = { "CursorMoved", "InsertEnter" }, From f9668aed9067316a3c4a2fc78c3a2a0953697ebe Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Thu, 13 Apr 2023 16:53:55 +0800 Subject: [PATCH 02/18] chore(project.nvim): update legacy code --- lua/modules/configs/tool/project.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/configs/tool/project.lua b/lua/modules/configs/tool/project.lua index 281f1a25e..153d023ee 100644 --- a/lua/modules/configs/tool/project.lua +++ b/lua/modules/configs/tool/project.lua @@ -3,7 +3,7 @@ return function() manual_mode = false, detection_methods = { "lsp", "pattern" }, patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" }, - ignore_lsp = { "efm", "copilot" }, + ignore_lsp = { "null-ls", "copilot" }, exclude_dirs = {}, show_hidden = false, silent_chdir = true, From bda4aacf4cbdda19e38f98f66eaf55b5cb95fdd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Thu, 13 Apr 2023 20:11:57 +0800 Subject: [PATCH 03/18] chore(README): update branch info --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3ab8f9e4c..b93c1ddff 100644 --- a/README.md +++ b/README.md @@ -38,14 +38,15 @@ This repo hosts my [NeoVim](https://neovim.io/) configuration for Linux, macOS, and Windows. `init.lua` is the config entry point. -It contains two branches: +Branch info:
-| Branch | Completion Solution | -| :----: | :------------------------: | -| main | config for nvim 0.8 stable | -| 0.7 | config for nvim 0.7 stable | +| Branch | Supported neovim version | +| :----: | :----------------------: | +| main | nvim 0.9 stable | +| 0.8 | nvim 0.8 | +| 0.7 | nvim 0.7 |
From fccf351385c08f7019afd9efd0adc0a9c2ebd2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Fri, 14 Apr 2023 00:07:33 +0800 Subject: [PATCH 04/18] chore(mapping): cleanup (#657) --- lua/core/mapping.lua | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/lua/core/mapping.lua b/lua/core/mapping.lua index 06af10ec9..ca58b0743 100644 --- a/lua/core/mapping.lua +++ b/lua/core/mapping.lua @@ -12,7 +12,7 @@ local core_map = { ["n|n"] = map_cmd("nzzzv"):with_noremap():with_desc("edit: Next search result"), ["n|N"] = map_cmd("Nzzzv"):with_noremap():with_desc("edit: Prev search result"), ["n|J"] = map_cmd("mzJ`z"):with_noremap():with_desc("edit: Join next line"), - ["n|"] = map_cmd("noh"):with_noremap():with_silent():with_desc("edit: Clear search highlight"), + ["n|"] = map_cr("noh"):with_noremap():with_silent():with_desc("edit: Clear search highlight"), ["n|"] = map_cmd("h"):with_noremap():with_desc("window: Focus left"), ["n|"] = map_cmd("l"):with_noremap():with_desc("window: Focus right"), ["n|"] = map_cmd("j"):with_noremap():with_desc("window: Focus down"), @@ -25,17 +25,17 @@ local core_map = { ["n|"] = map_cr("vertical resize +5"):with_silent():with_desc("window: Resize +5 vertically"), ["n|"] = map_cr("resize -2"):with_silent():with_desc("window: Resize -2 horizontally"), ["n|"] = map_cr("resize +2"):with_silent():with_desc("window: Resize +2 horizontally"), - ["n|"] = map_cmd(":wq"):with_desc("edit: Save file and quit"), - ["n|"] = map_cmd(":q!"):with_desc("edit: Force quit"), + ["n|"] = map_cr("wq"):with_desc("edit: Save file and quit"), + ["n|"] = map_cr("q!"):with_desc("edit: Force quit"), ["n|o"] = map_cr("setlocal spell! spelllang=en_us"):with_desc("edit: Toggle spell check"), ["n|+"] = map_cmd(""):with_noremap():with_silent():with_desc("edit: Increment"), ["n|-"] = map_cmd(""):with_noremap():with_silent():with_desc("edit: Decrement"), ["n|"] = map_cmd("gg0vG$"):with_noremap():with_silent():with_desc("edit: Select all"), - ["n|tn"] = map_cmd("tabnew"):with_noremap():with_silent():with_desc("tab: Create a new tab"), - ["n|tk"] = map_cmd("tabnext"):with_noremap():with_silent():with_desc("tab: Move to next tab"), - ["n|tj"] = map_cmd("tabprevious"):with_noremap():with_silent():with_desc("tab: Move to previous tab"), - ["n|to"] = map_cmd("tabonly"):with_noremap():with_silent():with_desc("tab: Only keep current tab"), - ["n|x"] = map_cmd("!chmod +x %"):with_silent():with_desc("file: chmod +x current file"), + ["x|"] = map_cmd("gg0vG$"):with_noremap():with_silent():with_desc("edit: Select all"), + ["n|tn"] = map_cr("tabnew"):with_noremap():with_silent():with_desc("tab: Create a new tab"), + ["n|tk"] = map_cr("tabnext"):with_noremap():with_silent():with_desc("tab: Move to next tab"), + ["n|tj"] = map_cr("tabprevious"):with_noremap():with_silent():with_desc("tab: Move to previous tab"), + ["n|to"] = map_cr("tabonly"):with_noremap():with_silent():with_desc("tab: Only keep current tab"), -- Insert mode ["i|"] = map_cmd("u"):with_noremap():with_desc("edit: Delete previous block"), ["i|"] = map_cmd(""):with_noremap():with_desc("edit: Move cursor to left"), @@ -60,10 +60,3 @@ local core_map = { } bind.nvim_load_mapping(core_map) - -vim.api.nvim_set_keymap( - "n", - "s", - "%s/\\<\\>//gI", - { noremap = true, silent = true, nowait = true, desc = "edit: Start replacment mode of current word" } -) From e533b2a836801a2ee18ca46b354c969124e88b08 Mon Sep 17 00:00:00 2001 From: Charles Chiu Date: Tue, 18 Apr 2023 13:25:21 +0800 Subject: [PATCH 05/18] fix(icon): update invalid cmp icon (#665) --- lua/modules/configs/completion/cmp.lua | 2 +- lua/modules/utils/icons.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/modules/configs/completion/cmp.lua b/lua/modules/configs/completion/cmp.lua index b47daeb07..b83b1843e 100644 --- a/lua/modules/configs/completion/cmp.lua +++ b/lua/modules/configs/completion/cmp.lua @@ -53,7 +53,7 @@ return function() 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) + vim_item.kind = string.format(" 〔 %s %s 〕", kind_symbol, vim_item.kind) if opts.maxwidth ~= nil then if opts.ellipsis_char == nil then diff --git a/lua/modules/utils/icons.lua b/lua/modules/utils/icons.lua index 945b4efaa..3d5703e67 100644 --- a/lua/modules/utils/icons.lua +++ b/lua/modules/utils/icons.lua @@ -163,13 +163,13 @@ local data = { cmp = { Codeium = "", TabNine = "", - Copilot = "", - Copilot_alt = "", + Copilot = "", -- Add source-specific icons here buffer = "", - cmp_tabnine = "", - codeium = "", + cmp_tabnine = "", + codeium = "", copilot = "", + copilot_alt = "", latex_symbols = "", luasnip = "", nvim_lsp = "", From f0fa437b349087b0adc3ed86e60564bf528721d2 Mon Sep 17 00:00:00 2001 From: Charles Chiu Date: Wed, 19 Apr 2023 12:12:06 +0800 Subject: [PATCH 06/18] chore/lspsaga_move (#667) --- lua/modules/plugins/completion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/plugins/completion.lua b/lua/modules/plugins/completion.lua index 187c93dbb..3ed980d0d 100644 --- a/lua/modules/plugins/completion.lua +++ b/lua/modules/plugins/completion.lua @@ -9,7 +9,7 @@ completion["neovim/nvim-lspconfig"] = { { "williamboman/mason.nvim" }, { "williamboman/mason-lspconfig.nvim" }, { - "glepnir/lspsaga.nvim", + "nvimdev/lspsaga.nvim", config = require("completion.lspsaga"), }, }, From 62417b10a73cd9d60d7253af16da96c0a93db4f5 Mon Sep 17 00:00:00 2001 From: Xie Zejian Date: Wed, 19 Apr 2023 16:42:10 +0800 Subject: [PATCH 07/18] fix: paint word boundary in python (#669) --- lua/modules/configs/ui/paint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/configs/ui/paint.lua b/lua/modules/configs/ui/paint.lua index 1fda36cb1..434355659 100644 --- a/lua/modules/configs/ui/paint.lua +++ b/lua/modules/configs/ui/paint.lua @@ -12,7 +12,7 @@ return function() }, { filter = { filetype = "python" }, - pattern = "%s*(%w+:)", + pattern = "%s*([_%w]+:)", hl = "Constant", }, }, From ecaba008ae53e66113f0938a0605416de4d3ec83 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Fri, 21 Apr 2023 10:36:20 +0800 Subject: [PATCH 08/18] fix(bufferline): `show_buffer_default_icon` is now deprecate --- lua/modules/configs/ui/bufferline.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/modules/configs/ui/bufferline.lua b/lua/modules/configs/ui/bufferline.lua index 3f6d081d0..96a7bfc83 100644 --- a/lua/modules/configs/ui/bufferline.lua +++ b/lua/modules/configs/ui/bufferline.lua @@ -14,13 +14,19 @@ return function() color_icons = true, show_buffer_icons = true, show_buffer_close_icons = true, - show_buffer_default_icon = true, show_close_icon = true, show_tab_indicators = true, enforce_regular_tabs = true, persist_buffer_sort = true, always_show_bufferline = true, separator_style = "thin", + get_element_icon = function(buf) + return require("nvim-web-devicons").get_icon( + buf.name, + vim.bo.filetype, + { default = true, strict = true } + ) + end, diagnostics = "nvim_lsp", diagnostics_indicator = function(count) return "(" .. count .. ")" From 6c6912bd78fcb2b672503580ceec5bed0c1e6d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Sat, 22 Apr 2023 23:52:03 +0800 Subject: [PATCH 09/18] feat(formatting): notify users for files under disabled dirs --- lua/modules/configs/completion/formatting.lua | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/lua/modules/configs/completion/formatting.lua b/lua/modules/configs/completion/formatting.lua index 66b7bbd5e..f095ac92e 100644 --- a/lua/modules/configs/completion/formatting.lua +++ b/lua/modules/configs/completion/formatting.lua @@ -15,7 +15,7 @@ vim.api.nvim_create_user_command("FormatterToggleFt", function(opts) vim.notify( string.format("[LSP] Formatter for [%s] has been recorded in list and disabled.", opts.args), vim.log.levels.WARN, - { title = "LSP Formatter Warning!" } + { title = "LSP Formatter Warning" } ) block_list[opts.args] = true else @@ -39,14 +39,17 @@ function M.enable_format_on_save(is_configured) group = "format_on_save", pattern = opts.pattern, callback = function() - require("completion.formatting").format({ timeout_ms = opts.timeout, filter = M.format_filter }) + require("completion.formatting").format({ + timeout_ms = opts.timeout, + filter = M.format_filter, + }) end, }) if not is_configured then vim.notify( "Successfully enabled format-on-save", vim.log.levels.INFO, - { title = "Settings modification success!" } + { title = "Settings modification success" } ) end end @@ -54,7 +57,11 @@ end function M.disable_format_on_save() pcall(vim.api.nvim_del_augroup_by_name, "format_on_save") if format_on_save then - vim.notify("Disabled format-on-save", vim.log.levels.INFO, { title = "Settings modification success!" }) + vim.notify( + "Successfully disabled format-on-save", + vim.log.levels.INFO, + { title = "Settings modification success" } + ) end end @@ -95,6 +102,14 @@ function M.format(opts) local cwd = vim.fn.getcwd() for i = 1, #disabled_workspaces do if cwd.find(cwd, disabled_workspaces[i]) ~= nil then + vim.notify( + string.format( + "[LSP] Formatting support for all files under [%s] has been disabled.", + disabled_workspaces[i] + ), + vim.log.levels.WARN, + { title = "LSP Formatter Warning" } + ) return end end @@ -122,7 +137,7 @@ function M.format(opts) vim.notify( "[LSP] Format request failed, no matching language servers.", vim.log.levels.WARN, - { title = "Formatting Failed!" } + { title = "Formatting Failed" } ) end @@ -136,7 +151,7 @@ function M.format(opts) vim.bo.filetype ), vim.log.levels.WARN, - { title = "LSP Formatter Warning!" } + { title = "LSP Formatter Warning" } ) return end @@ -145,15 +160,15 @@ function M.format(opts) 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), + string.format("[LSP] Format successfully with %s!", client.name), vim.log.levels.INFO, - { title = "LSP Format Success!" } + { title = "LSP Format Success" } ) elseif err then vim.notify( string.format("[LSP][%s] %s", client.name, err), vim.log.levels.ERROR, - { title = "LSP Format Error!" } + { title = "LSP Format Error" } ) end end From 75f4dc858a40fd9ffa27a0c37fc066d385188830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Sat, 22 Apr 2023 23:54:51 +0800 Subject: [PATCH 10/18] chore(formatting): rephrase messages --- lua/modules/configs/completion/formatting.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/modules/configs/completion/formatting.lua b/lua/modules/configs/completion/formatting.lua index f095ac92e..42dfe4c3d 100644 --- a/lua/modules/configs/completion/formatting.lua +++ b/lua/modules/configs/completion/formatting.lua @@ -103,10 +103,7 @@ function M.format(opts) for i = 1, #disabled_workspaces do if cwd.find(cwd, disabled_workspaces[i]) ~= nil then vim.notify( - string.format( - "[LSP] Formatting support for all files under [%s] has been disabled.", - disabled_workspaces[i] - ), + string.format("[LSP] Formatting support for all files under [%s] is disabled.", disabled_workspaces[i]), vim.log.levels.WARN, { title = "LSP Formatter Warning" } ) From e2cfef96a600cad56e46ce0c907d478f4fdb9324 Mon Sep 17 00:00:00 2001 From: Charles Chiu Date: Sun, 23 Apr 2023 23:04:09 +0800 Subject: [PATCH 11/18] fix(font-encoding): fix invalid characters on windows, fix #639 (#659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 冷酔閑吟 <50296129+Jint-lzxy@users.noreply.github.com> --- lua/core/init.lua | 29 +++++++++++++++++++++++++++++ lua/core/options.lua | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/lua/core/init.lua b/lua/core/init.lua index f63db01b5..80a6824ee 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -115,6 +115,34 @@ local clipboard_config = function() end end +local shell_config = function() + if global.is_windows then + if not (vim.fn.executable("pwsh") or vim.fn.executable("powershell")) then + vim.notify( + [[ +Failed to setup terminal config + +PowerShell is either not installed, missing from PATH, or not executable; +cmd.exe will be used instead for `:!` (shell bang) and toggleterm.nvim. + +You're recommended to install PowerShell for better experience.]], + vim.log.levels.WARN, + { title = "[core] Runtime error" } + ) + return + end + + local basecmd = "-NoLogo -MTA -ExecutionPolicy RemoteSigned" + local ctrlcmd = "-Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8" + vim.api.nvim_set_option_value("shell", vim.fn.executable("pwsh") and "pwsh" or "powershell", {}) + vim.api.nvim_set_option_value("shellcmdflag", string.format("%s %s;", basecmd, ctrlcmd), {}) + vim.api.nvim_set_option_value("shellredir", "-RedirectStandardOutput %s -NoNewWindow -Wait", {}) + vim.api.nvim_set_option_value("shellpipe", "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode", {}) + vim.api.nvim_set_option_value("shellquote", nil, {}) + vim.api.nvim_set_option_value("shellxquote", nil, {}) + end +end + local load_core = function() createdir() disable_distribution_plugins() @@ -122,6 +150,7 @@ local load_core = function() neovide_config() clipboard_config() + shell_config() require("core.options") require("core.mapping") diff --git a/lua/core/options.lua b/lua/core/options.lua index 4b968b155..48648e39f 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -125,7 +125,7 @@ local function load_options() -- Fix sqlite3 missing-lib issue on Windows if global.is_windows then -- Download the DLLs form https://www.sqlite.org/download.html - vim.g.sqlite_clib_path = global.home .. "/Documents/sqlite-dll-win64-x64-3400100/sqlite3.dll" + vim.g.sqlite_clib_path = global.home .. "/Documents/sqlite-dll-win64-x64-3400200/sqlite3.dll" end end From f2f3c2c60b9768815fc28f47e53d5562b032065a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:05:29 +0800 Subject: [PATCH 12/18] pref: unify code style for PowerShell commands --- lua/core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/core/init.lua b/lua/core/init.lua index 80a6824ee..7411191cf 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -133,7 +133,7 @@ You're recommended to install PowerShell for better experience.]], end local basecmd = "-NoLogo -MTA -ExecutionPolicy RemoteSigned" - local ctrlcmd = "-Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8" + local ctrlcmd = "-Command [console]::InputEncoding = [console]::OutputEncoding = [System.Text.Encoding]::UTF8" vim.api.nvim_set_option_value("shell", vim.fn.executable("pwsh") and "pwsh" or "powershell", {}) vim.api.nvim_set_option_value("shellcmdflag", string.format("%s %s;", basecmd, ctrlcmd), {}) vim.api.nvim_set_option_value("shellredir", "-RedirectStandardOutput %s -NoNewWindow -Wait", {}) From 4e56030323b12db70cfee724e194a7122606f78a Mon Sep 17 00:00:00 2001 From: Charles Chiu Date: Tue, 25 Apr 2023 10:37:44 +0800 Subject: [PATCH 13/18] perf: better guidance to `Discussions` and `Wiki` (#680) --- .github/ISSUE_TEMPLATE/bug_report.yml | 5 +++-- .github/ISSUE_TEMPLATE/config.yml | 7 +++++++ .github/ISSUE_TEMPLATE/lsp_issue_report.yml | 5 +++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5ba7d5db8..385f0152e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug Report description: File a bug report -labels: [bug] +labels: [ bug ] body: - type: markdown attributes: @@ -59,7 +59,8 @@ 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.7 (Legacy) + - 0.8 (Legacy) + - 0.7 (deprecated) validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0086358db..df53e0c40 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,8 @@ blank_issues_enabled: true +contact_links: + - name: GitHub Discussions + url: https://github.com/ayamir/nvimdots/discussions + about: When you have questions that are not bug reports or feature requests + - name: GitHub Wiki + url: https://github.com/ayamir/nvimdots/wiki + about: Make sure you have check our documentation first, to be explicite, the `FAQ`. diff --git a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml index 2b51f27dc..00156d24f 100644 --- a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml +++ b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml @@ -1,6 +1,6 @@ name: LSP Issue description: File a bug report related to LSPs -labels: [bug, lsp] +labels: [ bug, lsp ] body: - type: markdown attributes: @@ -59,7 +59,8 @@ 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.7 (Legacy) + - 0.8 (Legacy) + - 0.7 (Deprecated) validations: required: true - type: dropdown From e679eae9713d8a1aab792324cc77f94a4e2f2912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 25 Apr 2023 19:32:17 +0800 Subject: [PATCH 14/18] pref(ISSUE_TEMPLATE): fix typos and format with prettier --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- .github/ISSUE_TEMPLATE/config.yml | 8 ++++---- .github/ISSUE_TEMPLATE/lsp_issue_report.yml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 385f0152e..b3051463a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug Report description: File a bug report -labels: [ bug ] +labels: [bug] body: - type: markdown attributes: @@ -60,7 +60,7 @@ body: options: - main (Default/Latest) - 0.8 (Legacy) - - 0.7 (deprecated) + - 0.7 (Deprecated) validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index df53e0c40..75ee6b713 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ -blank_issues_enabled: true +blank_issues_enabled: false contact_links: - name: GitHub Discussions - url: https://github.com/ayamir/nvimdots/discussions - about: When you have questions that are not bug reports or feature requests + url: https://github.com/ayamir/nvimdots/discussions/new/choose + about: Any issue that does not fall into the above categories shall go here. - name: GitHub Wiki url: https://github.com/ayamir/nvimdots/wiki - about: Make sure you have check our documentation first, to be explicite, the `FAQ`. + about: Make sure you have checked our documentation first. To be explicit, the "Issues" section. diff --git a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml index 00156d24f..6c7db3d5d 100644 --- a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml +++ b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml @@ -1,6 +1,6 @@ name: LSP Issue description: File a bug report related to LSPs -labels: [ bug, lsp ] +labels: [bug, lsp] body: - type: markdown attributes: From 24c9bef9807d13e6dabdcfac8453408b7498911d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 25 Apr 2023 19:42:07 +0800 Subject: [PATCH 15/18] fixup! pref(ISSUE_TEMPLATE): fix typos and format with prettier --- .github/ISSUE_TEMPLATE/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 75ee6b713..f091d5377 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ -blank_issues_enabled: false +blank_issues_enabled: true contact_links: - name: GitHub Discussions url: https://github.com/ayamir/nvimdots/discussions/new/choose - about: Any issue that does not fall into the above categories shall go here. + about: Any issue that does not fall into the above categories shall go here - name: GitHub Wiki url: https://github.com/ayamir/nvimdots/wiki - about: Make sure you have checked our documentation first. To be explicit, the "Issues" section. + about: Make sure you have checked our documentation first. To be explicit, the "Issues" section From a5c8d330dde138eaaec4a18a64dee9c6b5aaa8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 25 Apr 2023 20:11:25 +0800 Subject: [PATCH 16/18] feat(scripts): abort for nvim v0.7 and its antecedent --- scripts/install.ps1 | 19 +++++++++++++------ scripts/install.sh | 20 ++++++++++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/scripts/install.ps1 b/scripts/install.ps1 index cd124c346..953849c53 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -59,6 +59,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)"; } + function warn_ext ([Parameter(Mandatory = $True)][ValidateNotNullOrEmpty()] [string]$Msg) { Write-Host " $(_chomp -Str $Msg)" } @@ -313,7 +314,7 @@ function _main { # Check dependencies if (-not (check_in_path -WithName "nvim")) { _abort -Msg "Required executable not found." -Type "NotInstalled" -Info_msg @' -You must install NeoVim before installing this Nvim config. See: +You must install Neovim before installing this Nvim config. See: https://github.com/neovim/neovim/wiki/Installing-Neovim ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ [INFO] "nvim" is either not installed, missing from PATH, or not executable. @@ -361,8 +362,11 @@ You must install Git before installing this Nvim config. See: safe_execute -WithCmd { git clone --progress -b 0.8 "$env:CCLONE_ATTR" 'git@github.com:ayamir/nvimdots.git' "$env:CCDEST_DIR" } } else { warn -Msg "You have outdated Nvim installed (< $REQUIRED_NVIM_VERSION_LEGACY)." - info -Msg "Automatically redirecting you to the latest compatible version..." - safe_execute -WithCmd { git clone --progress -b 0.7 "$env:CCLONE_ATTR" 'git@github.com:ayamir/nvimdots.git' "$env:CCDEST_DIR" } + _abort -Msg "This Neovim distribution is no longer supported." -Type "NotImplemented" -Info_msg @" +You have a legacy Neovim distribution installed. +Please make sure you have nvim v$REQUIRED_NVIM_VERSION_LEGACY installed at the very least. + +"@ } } else { if ((check_nvim_version -RequiredVersionMin $REQUIRED_NVIM_VERSION)) { @@ -373,8 +377,11 @@ You must install Git before installing this Nvim config. See: safe_execute -WithCmd { git clone --progress -b 0.8 "$env:CCLONE_ATTR" 'https://github.com/ayamir/nvimdots.git' "$env:CCDEST_DIR" } } else { warn -Msg "You have outdated Nvim installed (< $REQUIRED_NVIM_VERSION_LEGACY)." - info -Msg "Automatically redirecting you to the latest compatible version..." - safe_execute -WithCmd { git clone --progress -b 0.7 "$env:CCLONE_ATTR" 'https://github.com/ayamir/nvimdots.git' "$env:CCDEST_DIR" } + _abort -Msg "This Neovim distribution is no longer supported." -Type "NotImplemented" -Info_msg @" +You have a legacy Neovim distribution installed. +Please make sure you have nvim v$REQUIRED_NVIM_VERSION_LEGACY installed at the very least. + +"@ } } @@ -389,7 +396,7 @@ You must install Git before installing this Nvim config. See: } } - info -Msg "Spawning neovim and fetching plugins... (You'll be redirected shortly)" + info -Msg "Spawning Neovim and fetching plugins... (You'll be redirected shortly)" info -Msg 'To make sqlite work with lua, manually grab the dlls from "https://www.sqlite.org/download.html" and' info_ext -Msg 'replace vim.g.sqlite_clib_path with your path at the bottom of `lua/core/options.lua`' info -Msg 'If lazy.nvim failed to fetch any plugin(s), maunally execute `:Lazy sync` until everything is up-to-date.' diff --git a/scripts/install.sh b/scripts/install.sh index e06fde2b4..0cedade42 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -204,7 +204,7 @@ fi if ! command -v nvim >/dev/null; then abort "$( cat < Date: Tue, 25 Apr 2023 20:52:48 +0800 Subject: [PATCH 17/18] feat(settings): allow customization of `transparent_background` (#687) --- lua/core/settings.lua | 4 ++++ lua/modules/configs/ui/catppuccin.lua | 4 +--- lua/modules/configs/ui/edge.lua | 2 +- lua/modules/configs/ui/nord.lua | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 88fa3392e..a1250fd0e 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -32,6 +32,10 @@ settings["palette_overwrite"] = {} ---@type string settings["colorscheme"] = "catppuccin" +-- Set it to true if your terminal has transparent background. +---@type boolean +settings["transparent_background"] = false + -- Set background color to use here. -- Useful if you would like to use a colorscheme that has a light and dark variant like `edge`. -- Valid values are: `dark`, `light`. diff --git a/lua/modules/configs/ui/catppuccin.lua b/lua/modules/configs/ui/catppuccin.lua index 3895ca023..6cb07aa21 100644 --- a/lua/modules/configs/ui/catppuccin.lua +++ b/lua/modules/configs/ui/catppuccin.lua @@ -1,6 +1,4 @@ return function() - local transparent_background = false -- Set background transparency here! - require("catppuccin").setup({ flavour = "mocha", -- Can be one of: latte, frappe, macchiato, mocha background = { light = "latte", dark = "mocha" }, @@ -11,7 +9,7 @@ return function() shade = "dark", percentage = 0.15, }, - transparent_background = transparent_background, + transparent_background = require("core.settings").transparent_background, show_end_of_buffer = false, -- show the '~' characters after the end of buffers term_colors = true, compile_path = vim.fn.stdpath("cache") .. "/catppuccin", diff --git a/lua/modules/configs/ui/edge.lua b/lua/modules/configs/ui/edge.lua index 216899a8e..6f63356be 100644 --- a/lua/modules/configs/ui/edge.lua +++ b/lua/modules/configs/ui/edge.lua @@ -4,5 +4,5 @@ return function() vim.g.edge_disable_italic_comment = 1 vim.g.edge_show_eob = 1 vim.g.edge_better_performance = 1 - vim.g.edge_transparent_background = 1 + vim.g.edge_transparent_background = require("core.settings").transparent_background and 2 or 0 end diff --git a/lua/modules/configs/ui/nord.lua b/lua/modules/configs/ui/nord.lua index 522d3f7c0..17f535539 100644 --- a/lua/modules/configs/ui/nord.lua +++ b/lua/modules/configs/ui/nord.lua @@ -2,7 +2,7 @@ return function() vim.g.nord_contrast = true vim.g.nord_borders = false vim.g.nord_cursorline_transparent = true - vim.g.nord_disable_background = false + vim.g.nord_disable_background = require("core.settings").transparent_background vim.g.nord_enable_sidebar_background = true vim.g.nord_italic = true end From 6d55f062ad72862588cbdd1aeb54657fd49d6ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=85=94=E9=96=91=E5=90=9F?= <50296129+Jint-lzxy@users.noreply.github.com> Date: Wed, 26 Apr 2023 11:28:21 +0800 Subject: [PATCH 18/18] fix(bufferline): use defaults for `get_element_icon` (#685) --- lua/modules/configs/ui/bufferline.lua | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lua/modules/configs/ui/bufferline.lua b/lua/modules/configs/ui/bufferline.lua index 96a7bfc83..e0dd7911c 100644 --- a/lua/modules/configs/ui/bufferline.lua +++ b/lua/modules/configs/ui/bufferline.lua @@ -20,13 +20,6 @@ return function() persist_buffer_sort = true, always_show_bufferline = true, separator_style = "thin", - get_element_icon = function(buf) - return require("nvim-web-devicons").get_icon( - buf.name, - vim.bo.filetype, - { default = true, strict = true } - ) - end, diagnostics = "nvim_lsp", diagnostics_indicator = function(count) return "(" .. count .. ")"