From 6f12a7db9985478b6fe0dd2d27699f96cff29cee Mon Sep 17 00:00:00 2001 From: mjkx <52132505+mjkx5@users.noreply.github.com> Date: Sat, 6 Apr 2024 20:29:18 +0800 Subject: [PATCH 01/35] feat(cmp): more completion candidates from opened buffers. (#1219) * buffer completion config * opts -> option --- lua/modules/configs/completion/cmp.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/modules/configs/completion/cmp.lua b/lua/modules/configs/completion/cmp.lua index c8e058ec3..19a8328a9 100644 --- a/lua/modules/configs/completion/cmp.lua +++ b/lua/modules/configs/completion/cmp.lua @@ -168,7 +168,14 @@ return function() { name = "spell" }, { name = "tmux" }, { name = "orgmode" }, - { name = "buffer" }, + { + name = "buffer", + option = { + get_bufnrs = function() + return vim.api.nvim_list_bufs() + end, + }, + }, { name = "latex_symbols" }, { name = "copilot" }, -- { name = "codeium" }, From a9c0292b867a7e9410014551aadf4172c5cdc39c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Apr 2024 01:48:59 +0000 Subject: [PATCH 02/35] chore(lockfile): auto update lazy-lock.json --- lazy-lock.json | 95 -------------------------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 lazy-lock.json diff --git a/lazy-lock.json b/lazy-lock.json deleted file mode 100644 index be3c8dfcd..000000000 --- a/lazy-lock.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "825a61bad1d60d917a7962d73cf3c683f4e0407e" }, - "aerial.nvim": { "branch": "master", "commit": "24ebacab5821107c50f628e8e7774f105c08fe9b" }, - "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, - "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, - "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, - "catppuccin": { "branch": "refactor/syntax-highlighting", "commit": "b6f54c74f8aea460b395c4b0ede9392dbab60424" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-spell": { "branch": "master", "commit": "32a0867efa59b43edbb2db67b0871cfad90c9b66" }, - "cmp-tmux": { "branch": "main", "commit": "95b1b921802e6f60627b3e76afb9380fddd87f9a" }, - "cmp-treesitter": { "branch": "master", "commit": "13e4ef8f4dd5639fca2eb9150e68f47639a9b37d" }, - "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, - "copilot.lua": { "branch": "master", "commit": "71382c2efec76647287d46a4fbe0ec8c9809e2ee" }, - "crates.nvim": { "branch": "main", "commit": "b4f4987ccdb1cc3899ee541ef4375c73c48c4570" }, - "csv.vim": { "branch": "master", "commit": "962f88787ec6873eba1c7dbbd81d2723f1ee3c4b" }, - "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, - "fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, - "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, - "fzf": { "branch": "master", "commit": "62963dcefd6d74510ae2692cd0955177bae57543" }, - "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, - "gitsigns.nvim": { "branch": "main", "commit": "fa052c20aa7cc62ce6a328c7f3bd556c93b5370e" }, - "glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" }, - "go.nvim": { "branch": "master", "commit": "a3ce5016f50b0b9e96713f3f859089983c57a0db" }, - "guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" }, - "hop.nvim": { "branch": "master", "commit": "6d853addd6e11df8338b26e869a29b36f2c3e893" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, - "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, - "local-highlight.nvim": { "branch": "master", "commit": "9003107e94291fc628318b34837c1ad3fe6461c7" }, - "lsp-format-modifications.nvim": { "branch": "main", "commit": "006d4cd88f4f09fdc4375fcb75dd5b7d981a723b" }, - "lsp_signature.nvim": { "branch": "master", "commit": "6b99faed0d3d77d75314672f58b09773fdfd8142" }, - "lspsaga.nvim": { "branch": "main", "commit": "a4d442896a9ff1f83ee3db965d81b659ebc977d5" }, - "lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, - "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, - "mason-null-ls.nvim": { "branch": "main", "commit": "e270134d83ba59425edc53356c6fd337b61bb8dd" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, - "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" }, - "neodim": { "branch": "master", "commit": "0543414f1205d8937d8e703a73ae1f9948940b14" }, - "neoconf.nvim": { "branch": "main", "commit": "1eb57c7c28499c88b9cbb3aee6f9a35d875708db" }, - "neoscroll.nvim": { "branch": "master", "commit": "21d52973bde32db998fc8b6590f87eb3c3c6d8e4" }, - "none-ls.nvim": { "branch": "main", "commit": "0d42ba8d506242b2252d2d2885a7f6f4f5b2bcb2" }, - "nvim-bqf": { "branch": "main", "commit": "52703d7adc3be3f7c09eea9a80c5b8caa615fb25" }, - "nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" }, - "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, - "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, - "nvim-lspconfig": { "branch": "master", "commit": "96e5711040df23583591391ce49e556b8cd248d8" }, - "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-scrollview": { "branch": "main", "commit": "5a7eb7e6c1b921761615b57a6140d73b1cc2b034" }, - "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, - "nvim-tree.lua": { "branch": "master", "commit": "d8d3a1590a05b2d8b5eb26e2ed1c6052b1b47a77" }, - "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "nvim-treesitter": { "branch": "master", "commit": "1b050206e490a4146cdf25c7b38969c1711b5620" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "f5183cea0fda26126e22e789382c208e7b1120f4" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, - "nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, - "paint.nvim": { "branch": "main", "commit": "6ce64212804f425073c61ab0d9c2b034f0435260" }, - "persisted.nvim": { "branch": "main", "commit": "ca9900c31ee6e254a0ba7011ba49f48ebf4c8db2" }, - "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, - "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "580bc045c7ab3ab3ebd267774038c0d8cc19c789" }, - "rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" }, - "smart-splits.nvim": { "branch": "master", "commit": "50f52146e4504a3fc0f0d5830c8560a16a95dd08" }, - "sniprun": { "branch": "master", "commit": "97daa506e2faa3939e0491642103635f9d22cd04" }, - "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, - "telescope-frecency.nvim": { "branch": "master", "commit": "2a22815b0928087a5989e2a8e836b13b46015505" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope-live-grep-args.nvim": { "branch": "master", "commit": "731a046da7dd3adff9de871a42f9b7fb85f60f47" }, - "telescope-undo.nvim": { "branch": "main", "commit": "d19e2edc8b18d03283bd91f67310ac300ad003ce" }, - "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, - "telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" }, - "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, - "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" }, - "vim-fugitive": { "branch": "master", "commit": "c0b03f1cac242d96837326d300f42a660306fc1a" }, - "vim-matchup": { "branch": "master", "commit": "2d660e4aa7c566014c667af2cda0458043527902" }, - "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, - "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } -} From 276e3d84745e8fd47cacab23de808b8c4c482250 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: Mon, 8 Apr 2024 22:27:03 +0800 Subject: [PATCH 03/35] chore(plugins): tidying up (#1221) This commit mainly tweaks the loading events of some plugins to align with upstream specifications. Additionally, there have been enhancements made to certain documentation. Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/keymap/editor.lua | 30 +++--- lua/modules/configs/completion/neoconf.lua | 29 +----- lua/modules/configs/editor/align.lua | 11 +++ .../configs/editor/local-highlight.lua | 7 +- lua/modules/configs/editor/mini-align.lua | 8 -- lua/modules/configs/editor/smart-splits.lua | 92 ------------------- lua/modules/configs/editor/splits.lua | 14 +++ lua/modules/configs/ui/catppuccin.lua | 2 +- lua/modules/configs/ui/lualine.lua | 2 +- lua/modules/configs/ui/todo.lua | 42 +++++++++ lua/modules/plugins/completion.lua | 2 +- lua/modules/plugins/editor.lua | 13 ++- lua/modules/plugins/ui.lua | 5 +- 13 files changed, 104 insertions(+), 153 deletions(-) create mode 100644 lua/modules/configs/editor/align.lua delete mode 100644 lua/modules/configs/editor/mini-align.lua delete mode 100644 lua/modules/configs/editor/smart-splits.lua create mode 100644 lua/modules/configs/editor/splits.lua create mode 100644 lua/modules/configs/ui/todo.lua diff --git a/lua/keymap/editor.lua b/lua/keymap/editor.lua index 76845a616..9b0271cee 100644 --- a/lua/keymap/editor.lua +++ b/lua/keymap/editor.lua @@ -68,28 +68,36 @@ local plug_map = { ["n|"] = map_cu("SmartCursorMoveDown"):with_silent():with_noremap():with_desc("window: Focus down"), ["n|"] = map_cu("SmartCursorMoveUp"):with_silent():with_noremap():with_desc("window: Focus up"), ["n|"] = map_cu("SmartCursorMoveRight"):with_silent():with_noremap():with_desc("window: Focus right"), - ["n|Wh"] = map_cu("SmartSwapLeft"):with_silent():with_noremap():with_desc("window: Move window to left"), - ["n|Wj"] = map_cu("SmartSwapDown"):with_silent():with_noremap():with_desc("window: Move window to down"), - ["n|Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window to up"), - ["n|Wl"] = map_cu("SmartSwapRight"):with_silent():with_noremap():with_desc("window: Move window to right"), + ["n|Wh"] = map_cu("SmartSwapLeft"):with_silent():with_noremap():with_desc("window: Move window leftward"), + ["n|Wj"] = map_cu("SmartSwapDown"):with_silent():with_noremap():with_desc("window: Move window downward"), + ["n|Wk"] = map_cu("SmartSwapUp"):with_silent():with_noremap():with_desc("window: Move window upward"), + ["n|Wl"] = map_cu("SmartSwapRight"):with_silent():with_noremap():with_desc("window: Move window rightward"), -- Plugin: nvim-spectre - ["n|Ss"] = map_cmd([[lua require("spectre").toggle()]]) + ["n|Ss"] = map_callback(function() + require("spectre").toggle() + end) :with_silent() :with_noremap() - :with_desc("editn: Toggle search&replace panel"), - ["n|Sp"] = map_cmd([[lua require("spectre").open_visual({select_word=true})]]) + :with_desc("editn: Toggle search & replace panel"), + ["n|Sp"] = map_callback(function() + require("spectre").open_visual({ select_word = true }) + end) :with_silent() :with_noremap() :with_desc("editn: search&replace current word (project)"), - ["v|Sp"] = map_cmd([[lua require("spectre").open_visual()]]) + ["v|Sp"] = map_callback(function() + require("spectre").open_visual() + end) :with_silent() :with_noremap() - :with_desc("edit: search&replace current word (project)"), - ["n|Sf"] = map_cmd([[lua require("spectre").open_file_search({select_word=true})]]) + :with_desc("edit: search & replace current word (project)"), + ["n|Sf"] = map_callback(function() + require("spectre").open_file_search({ select_word = true }) + end) :with_silent() :with_noremap() - :with_desc("editn: search&replace current word (file)"), + :with_desc("editn: search & replace current word (file)"), -- Plugin: nvim-treehopper ["o|m"] = map_cu("lua require('tsht').nodes()"):with_silent():with_desc("jump: Operate across syntax tree"), diff --git a/lua/modules/configs/completion/neoconf.lua b/lua/modules/configs/completion/neoconf.lua index 4deef7695..4db9cc75f 100644 --- a/lua/modules/configs/completion/neoconf.lua +++ b/lua/modules/configs/completion/neoconf.lua @@ -2,6 +2,8 @@ local M = {} M.setup = function() require("modules.utils").load_plugin("neoconf", { + -- send new configuration to lsp clients when changing json settings + live_reload = true, -- name of the local settings files local_settings = ".neoconf.json", -- name of the global settings file in your Neovim config directory @@ -12,33 +14,6 @@ M.setup = function() coc = true, -- global/local coc-settings.json nlsp = true, -- global/local nlsp-settings.nvim json settings }, - -- send new configuration to lsp clients when changing json settings - live_reload = true, - -- set the filetype to jsonc for settings files, so you can use comments - -- make sure you have the jsonc treesitter parser installed! - filetype_jsonc = true, - plugins = { - -- configures lsp clients with settings in the following order: - -- - lua settings passed in lspconfig setup - -- - global json settings - -- - local json settings - lspconfig = { - enabled = true, - }, - -- configures jsonls to get completion in .nvim.settings.json files - jsonls = { - enabled = true, - -- only show completion in json settings for configured lsp servers - configured_servers_only = true, - }, - -- configures lua_ls to get completion of lspconfig server settings - lua_ls = { - -- by default, lua_ls annotations are only enabled in your neovim config directory - enabled_for_neovim_config = true, - -- explicitely enable adding annotations. Mostly relevant to put in your local .nvim.settings.json file - enabled = false, - }, - }, }) end diff --git a/lua/modules/configs/editor/align.lua b/lua/modules/configs/editor/align.lua new file mode 100644 index 000000000..43c50d8dc --- /dev/null +++ b/lua/modules/configs/editor/align.lua @@ -0,0 +1,11 @@ +return function() + require("modules.utils").load_plugin("mini.align", { + -- Whether to disable showing non-error feedback + silent = false, + -- Module mappings. Use `''` (empty string) to disable one. + mappings = { + start = "gea", + start_with_preview = "geA", + }, + }) +end diff --git a/lua/modules/configs/editor/local-highlight.lua b/lua/modules/configs/editor/local-highlight.lua index 022440396..f8c001f3d 100644 --- a/lua/modules/configs/editor/local-highlight.lua +++ b/lua/modules/configs/editor/local-highlight.lua @@ -1,11 +1,6 @@ return function() require("modules.utils").load_plugin("local-highlight", { - file_types = nil, - hlgroup = "Search", - cw_hlgroup = nil, - -- Whether to display highlights in INSERT mode or not + hlgroup = "IlluminatedWordText", insert_mode = false, - min_match_len = 1, - max_match_len = math.huge, }) end diff --git a/lua/modules/configs/editor/mini-align.lua b/lua/modules/configs/editor/mini-align.lua deleted file mode 100644 index 4cbf7fed6..000000000 --- a/lua/modules/configs/editor/mini-align.lua +++ /dev/null @@ -1,8 +0,0 @@ -return function() - require("mini.align").setup({ - mappings = { - start = "gea", - start_with_preview = "geA", - }, - }) -end diff --git a/lua/modules/configs/editor/smart-splits.lua b/lua/modules/configs/editor/smart-splits.lua deleted file mode 100644 index 3ea0ceb44..000000000 --- a/lua/modules/configs/editor/smart-splits.lua +++ /dev/null @@ -1,92 +0,0 @@ -return function() - require("modules.utils").load_plugin("smart-splits", { - -- Ignored buffer types (only while resizing) - ignored_buftypes = { - "nofile", - "quickfix", - "prompt", - }, - -- Ignored filetypes (only while resizing) - ignored_filetypes = { "NvimTree" }, - -- the default number of lines/columns to resize by at a time - default_amount = 3, - -- Desired behavior when your cursor is at an edge and you - -- are moving towards that same edge: - -- 'wrap' => Wrap to opposite side - -- 'split' => Create a new split in the desired direction - -- 'stop' => Do nothing - -- function => You handle the behavior yourself - -- NOTE: If using a function, the function will be called with - -- a context object with the following fields: - -- { - -- mux = { - -- type:'tmux'|'wezterm'|'kitty' - -- current_pane_id():number, - -- is_in_session(): boolean - -- current_pane_is_zoomed():boolean, - -- -- following methods return a boolean to indicate success or failure - -- current_pane_at_edge(direction:'left'|'right'|'up'|'down'):boolean - -- next_pane(direction:'left'|'right'|'up'|'down'):boolean - -- resize_pane(direction:'left'|'right'|'up'|'down'):boolean - -- split_pane(direction:'left'|'right'|'up'|'down',size:number|nil):boolean - -- }, - -- direction = 'left'|'right'|'up'|'down', - -- split(), -- utility function to split current Neovim pane in the current direction - -- wrap(), -- utility function to wrap to opposite Neovim pane - -- } - -- NOTE: `at_edge = 'wrap'` is not supported on Kitty terminal - -- multiplexer, as there is no way to determine layout via the CLI - at_edge = "wrap", - -- when moving cursor between splits left or right, - -- place the cursor on the same row of the *screen* - -- regardless of line numbers. False by default. - -- Can be overridden via function parameter, see Usage. - move_cursor_same_row = false, - -- whether the cursor should follow the buffer when swapping - -- buffers by default; it can also be controlled by passing - -- `{ move_cursor = true }` or `{ move_cursor = false }` - -- when calling the Lua function. - cursor_follows_swapped_bufs = false, - -- resize mode options - resize_mode = { - -- key to exit persistent resize mode - quit_key = "", - -- keys to use for moving in resize mode - -- in order of left, down, up' right - resize_keys = { "h", "j", "k", "l" }, - -- set to true to silence the notifications - -- when entering/exiting persistent resize mode - silent = false, - -- must be functions, they will be executed when - -- entering or exiting the resize mode - hooks = { - on_enter = nil, - on_leave = nil, - }, - }, - -- ignore these autocmd events (via :h eventignore) while processing - -- smart-splits.nvim computations, which involve visiting different - -- buffers and windows. These events will be ignored during processing, - -- and un-ignored on completed. This only applies to resize events, - -- not cursor movement events. - ignored_events = { - "BufEnter", - "WinEnter", - }, - -- enable or disable a multiplexer integration; - -- automatically determined, unless explicitly disabled or set, - -- by checking the $TERM_PROGRAM environment variable, - -- and the $KITTY_LISTEN_ON environment variable for Kitty - multiplexer_integration = "tmux", - -- disable multiplexer navigation if current multiplexer pane is zoomed - -- this functionality is only supported on tmux and Wezterm due to kitty - -- not having a way to check if a pane is zoomed - disable_multiplexer_nav_when_zoomed = true, - -- Supply a Kitty remote control password if needed, - -- or you can also set vim.g.smart_splits_kitty_password - -- see https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.remote_control_password - kitty_password = nil, - -- default logging level, one of: 'trace'|'debug'|'info'|'warn'|'error'|'fatal' - log_level = "info", - }) -end diff --git a/lua/modules/configs/editor/splits.lua b/lua/modules/configs/editor/splits.lua new file mode 100644 index 000000000..891d01eaf --- /dev/null +++ b/lua/modules/configs/editor/splits.lua @@ -0,0 +1,14 @@ +return function() + require("modules.utils").load_plugin("smart-splits", { + -- Ignored buffer types (only while resizing) + ignored_buftypes = { + "nofile", + "quickfix", + "prompt", + }, + -- Ignored filetypes (only while resizing) + ignored_filetypes = { "NvimTree" }, + -- the default number of lines/columns to resize by at a time + default_amount = 3, + }) +end diff --git a/lua/modules/configs/ui/catppuccin.lua b/lua/modules/configs/ui/catppuccin.lua index 4eec738ed..9d1e8400e 100644 --- a/lua/modules/configs/ui/catppuccin.lua +++ b/lua/modules/configs/ui/catppuccin.lua @@ -64,7 +64,7 @@ return function() harpoon = false, headlines = false, hop = true, - illuminate = false, + illuminate = true, indent_blankline = { enabled = true, colored_indent_levels = false }, leap = false, lightspeed = false, diff --git a/lua/modules/configs/ui/lualine.lua b/lua/modules/configs/ui/lualine.lua index d5108ed8a..34d0d187c 100644 --- a/lua/modules/configs/ui/lualine.lua +++ b/lua/modules/configs/ui/lualine.lua @@ -218,7 +218,7 @@ return function() tabwidth = { function() - return icons.ui.Tab .. vim.api.nvim_get_option_value("shiftwidth", { scope = "local" }) + return icons.ui.Tab .. vim.api.nvim_get_option_value("tabstop", { scope = "local" }) end, padding = 1, }, diff --git a/lua/modules/configs/ui/todo.lua b/lua/modules/configs/ui/todo.lua new file mode 100644 index 000000000..1fbd248e2 --- /dev/null +++ b/lua/modules/configs/ui/todo.lua @@ -0,0 +1,42 @@ +return function() + local icons = { + diagnostics = require("modules.utils.icons").get("diagnostics"), + ui = require("modules.utils.icons").get("ui"), + } + + require("modules.utils").load_plugin("todo-comments", { + signs = false, -- show icons in the signs column + keywords = { + FIX = { + icon = icons.ui.Bug, + color = "error", + alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, + }, + TODO = { icon = icons.ui.Accepted, color = "info" }, + -- HACK = { icon = icons.ui.Fire, color = "warning" }, + WARN = { icon = icons.diagnostics.Warning, color = "warning", alt = { "WARNING", "XXX" } }, + PERF = { icon = icons.ui.Perf, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, + NOTE = { icon = icons.ui.Note, color = "hint", alt = { "INFO" } }, + }, + gui_style = { + fg = "NONE", + bg = "BOLD", + }, + merge_keywords = true, + highlight = { + multiline = false, + keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. + after = "", + comments_only = true, + max_line_len = 500, + exclude = { "big_file_disabled_ft" }, + }, + colors = { + error = { "DiagnosticError", "ErrorMsg", "#DC2626" }, + warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" }, + info = { "DiagnosticInfo", "#2563EB" }, + hint = { "DiagnosticHint", "#F5C2E7" }, + default = { "Conditional", "#7C3AED" }, + }, + }) +end diff --git a/lua/modules/plugins/completion.lua b/lua/modules/plugins/completion.lua index 7928615a8..d4b5d088d 100644 --- a/lua/modules/plugins/completion.lua +++ b/lua/modules/plugins/completion.lua @@ -63,7 +63,7 @@ completion["hrsh7th/nvim-cmp"] = { { "f3fora/cmp-spell" }, { "hrsh7th/cmp-buffer" }, { "kdheepak/cmp-latex-symbols" }, - { "ray-x/cmp-treesitter" }, + { "ray-x/cmp-treesitter", commit = "c8e3a74" }, -- { "tzachar/cmp-tabnine", build = "./install.sh", config = require("completion.tabnine") }, -- { -- "jcdickinson/codeium.nvim", diff --git a/lua/modules/plugins/editor.lua b/lua/modules/plugins/editor.lua index 3d0fdd93e..7a102e12a 100644 --- a/lua/modules/plugins/editor.lua +++ b/lua/modules/plugins/editor.lua @@ -51,8 +51,9 @@ editor["sindrets/diffview.nvim"] = { config = require("editor.diffview"), } editor["echasnovski/mini.align"] = { - version = false, - config = require("editor.mini-align"), + lazy = true, + event = { "CursorHold", "CursorHoldI" }, + config = require("editor.align"), } editor["smoka7/hop.nvim"] = { lazy = true, @@ -78,14 +79,18 @@ editor["tpope/vim-sleuth"] = { lazy = true, event = "BufReadPre", } +editor["tpope/vim-sleuth"] = { + lazy = true, + event = { "BufNewFile", "BufReadPost", "BufFilePost" }, +} editor["nvim-pack/nvim-spectre"] = { lazy = true, - cmd = { "Spectre" }, + cmd = "Spectre", } editor["mrjones2014/smart-splits.nvim"] = { lazy = true, event = { "CursorHoldI", "CursorHold" }, - config = require("editor.smart-splits"), + config = require("editor.splits"), } ---------------------------------------------------------------------- diff --git a/lua/modules/plugins/ui.lua b/lua/modules/plugins/ui.lua index 222cb3e70..1a5aab469 100644 --- a/lua/modules/plugins/ui.lua +++ b/lua/modules/plugins/ui.lua @@ -58,8 +58,9 @@ ui["folke/paint.nvim"] = { } ui["folke/todo-comments.nvim"] = { lazy = true, - event = { "BufReadPost" }, - opts = {}, + event = { "CursorHold", "CursorHoldI" }, + config = require("ui.todo"), + dependencies = { "nvim-lua/plenary.nvim" }, } ui["dstein64/nvim-scrollview"] = { lazy = true, From e5224c4d995d6edc23b02d220e393e94f95b59d5 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:50:21 +0800 Subject: [PATCH 04/35] fix(plugins): remove duplicate specifications Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- 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 7a102e12a..04019c3ad 100644 --- a/lua/modules/plugins/editor.lua +++ b/lua/modules/plugins/editor.lua @@ -75,10 +75,6 @@ editor["lambdalisue/suda.vim"] = { cmd = { "SudaRead", "SudaWrite" }, config = require("editor.suda"), } -editor["tpope/vim-sleuth"] = { - lazy = true, - event = "BufReadPre", -} editor["tpope/vim-sleuth"] = { lazy = true, event = { "BufNewFile", "BufReadPost", "BufFilePost" }, From 7e6ae275a683a8d3d333cf9929218060c73fa19c Mon Sep 17 00:00:00 2001 From: Mohu Date: Tue, 9 Apr 2024 17:30:37 +0800 Subject: [PATCH 05/35] fix: use `init` for vim plugins (#1222) Signed-off-by: ayamir --- lua/modules/plugins/editor.lua | 2 +- lua/modules/plugins/lang.lua | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lua/modules/plugins/editor.lua b/lua/modules/plugins/editor.lua index 04019c3ad..73b273351 100644 --- a/lua/modules/plugins/editor.lua +++ b/lua/modules/plugins/editor.lua @@ -73,7 +73,7 @@ editor["romainl/vim-cool"] = { editor["lambdalisue/suda.vim"] = { lazy = true, cmd = { "SudaRead", "SudaWrite" }, - config = require("editor.suda"), + init = require("editor.suda"), } editor["tpope/vim-sleuth"] = { lazy = true, diff --git a/lua/modules/plugins/lang.lua b/lua/modules/plugins/lang.lua index a9558c9f7..c948f8542 100644 --- a/lua/modules/plugins/lang.lua +++ b/lua/modules/plugins/lang.lua @@ -10,14 +10,10 @@ lang["kevinhwang91/nvim-bqf"] = { } lang["ray-x/go.nvim"] = { lazy = true, - dependencies = { -- optional packages - "ray-x/guihua.lua", - "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter", - }, - ft = { "go", "gomod" }, - build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries - config = require("lang.go-nvim"), + ft = { "go", "gomod", "gosum" }, + build = ":GoInstallBinaries", + config = require("lang.go"), + dependencies = { "ray-x/guihua.lua" }, } lang["mrcjkb/rustaceanvim"] = { lazy = true, From a168b1fdb393761151f75335a208ea11a7fb9ee5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Apr 2024 01:51:25 +0000 Subject: [PATCH 06/35] chore(lockfile): auto update lazy-lock.json --- lazy-lock.json | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 lazy-lock.json diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 000000000..ca4e35ad0 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,94 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, + "aerial.nvim": { "branch": "master", "commit": "24ebacab5821107c50f628e8e7774f105c08fe9b" }, + "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, + "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, + "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, + "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, + "catppuccin": { "branch": "refactor/syntax-highlighting", "commit": "b6f54c74f8aea460b395c4b0ede9392dbab60424" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-spell": { "branch": "master", "commit": "32a0867efa59b43edbb2db67b0871cfad90c9b66" }, + "cmp-tmux": { "branch": "main", "commit": "95b1b921802e6f60627b3e76afb9380fddd87f9a" }, + "cmp-treesitter": { "branch": "master", "commit": "c8e3a74b51597d69d240085a258636972ce98e15" }, + "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, + "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, + "crates.nvim": { "branch": "main", "commit": "e8fa8ec62ded43c3b06bca7ef36be26b924681bb" }, + "csv.vim": { "branch": "master", "commit": "962f88787ec6873eba1c7dbbd81d2723f1ee3c4b" }, + "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, + "fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, + "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, + "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, + "fzf": { "branch": "master", "commit": "17bb7ad2784afdfc99beeec9e0a58f8dae12748a" }, + "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, + "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, + "glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" }, + "hop.nvim": { "branch": "master", "commit": "6d853addd6e11df8338b26e869a29b36f2c3e893" }, + "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, + "local-highlight.nvim": { "branch": "master", "commit": "9003107e94291fc628318b34837c1ad3fe6461c7" }, + "lsp-format-modifications.nvim": { "branch": "main", "commit": "006d4cd88f4f09fdc4375fcb75dd5b7d981a723b" }, + "lsp_signature.nvim": { "branch": "master", "commit": "6b99faed0d3d77d75314672f58b09773fdfd8142" }, + "lspsaga.nvim": { "branch": "main", "commit": "a4d442896a9ff1f83ee3db965d81b659ebc977d5" }, + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, + "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, + "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" }, + "neoconf.nvim": { "branch": "main", "commit": "9d61ff423ae5f179ace1823300c4873f38a7c418" }, + "neodim": { "branch": "master", "commit": "9477da03b93f1984a81fee3b92e6ac7c6ada6aa4" }, + "neoscroll.nvim": { "branch": "master", "commit": "21d52973bde32db998fc8b6590f87eb3c3c6d8e4" }, + "none-ls.nvim": { "branch": "main", "commit": "dca7ddec321a102ec9e792b1b29193702aff5fbb" }, + "nvim-bqf": { "branch": "main", "commit": "52703d7adc3be3f7c09eea9a80c5b8caa615fb25" }, + "nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" }, + "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, + "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, + "nvim-lspconfig": { "branch": "master", "commit": "e25c4cdecd3d58c0deccce0f372426c8c480bcce" }, + "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-scrollview": { "branch": "main", "commit": "5a7eb7e6c1b921761615b57a6140d73b1cc2b034" }, + "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, + "nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" }, + "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, + "nvim-treesitter": { "branch": "master", "commit": "c16f66cca0c38b4e21371d8330b7f2ad6404f6dc" }, + "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "2aa454e4037424c678a8ff033951a5be39e54b9c" }, + "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, + "nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" }, + "paint.nvim": { "branch": "main", "commit": "6ce64212804f425073c61ab0d9c2b034f0435260" }, + "persisted.nvim": { "branch": "main", "commit": "ca9900c31ee6e254a0ba7011ba49f48ebf4c8db2" }, + "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, + "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "0563a31b1f46a911865cb85df3ddde2eff9fdada" }, + "rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" }, + "smart-splits.nvim": { "branch": "master", "commit": "50f52146e4504a3fc0f0d5830c8560a16a95dd08" }, + "sniprun": { "branch": "master", "commit": "97daa506e2faa3939e0491642103635f9d22cd04" }, + "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, + "telescope-frecency.nvim": { "branch": "master", "commit": "94a532cb9c4713db83acf5432f5aadfd096e2af9" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, + "telescope-live-grep-args.nvim": { "branch": "master", "commit": "731a046da7dd3adff9de871a42f9b7fb85f60f47" }, + "telescope-undo.nvim": { "branch": "main", "commit": "d19e2edc8b18d03283bd91f67310ac300ad003ce" }, + "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, + "telescope.nvim": { "branch": "master", "commit": "5a701e99906961218b55d7ad6c2a998f066c6fe0" }, + "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, + "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, + "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, + "vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" }, + "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, + "vim-go": { "branch": "master", "commit": "14eedf6135cf4253b0ed48a0b53d6834a40da1c4" }, + "vim-matchup": { "branch": "master", "commit": "2d660e4aa7c566014c667af2cda0458043527902" }, + "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, + "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } +} \ No newline at end of file From b56c207ea28670504caf0d3fb711a42ddd9ee83b Mon Sep 17 00:00:00 2001 From: Mohu Date: Wed, 10 Apr 2024 13:28:23 +0800 Subject: [PATCH 07/35] docs: mention the experimental nature of the 0.10 branch (#1215) * docs: add note for 0.10 nightly branch in readme. Signed-off-by: ayamir * chore(issue_template): add nightly warning Signed-off-by: Charles Chiu * chore(issue_tempate): linting Signed-off-by: Charles Chiu * docs: update readme for 0.10 branch. Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Signed-off-by: Mohu * chore(issue_template): add nightly warning Signed-off-by: Charles Chiu * chore(issue_template): add nightly warning Signed-off-by: Charles Chiu --------- Signed-off-by: ayamir Signed-off-by: Charles Chiu Signed-off-by: Mohu Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: Charles Chiu Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 3 +++ .github/ISSUE_TEMPLATE/custom_config.yml | 5 ++++- .github/ISSUE_TEMPLATE/lsp_issue_report.yml | 3 +++ README.md | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0be5fc518..785f63ea0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -6,6 +6,9 @@ body: attributes: 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. - type: checkboxes id: is-latest-commit attributes: diff --git a/.github/ISSUE_TEMPLATE/custom_config.yml b/.github/ISSUE_TEMPLATE/custom_config.yml index 04eb02719..3f1f2d51c 100644 --- a/.github/ISSUE_TEMPLATE/custom_config.yml +++ b/.github/ISSUE_TEMPLATE/custom_config.yml @@ -6,7 +6,10 @@ body: attributes: 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. + - 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 068800536..d320b0a83 100644 --- a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml +++ b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml @@ -6,6 +6,9 @@ body: attributes: 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. - type: checkboxes id: is-latest-commit attributes: diff --git a/README.md b/README.md index 894b7bfa0..a7dd0e9c5 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,9 @@ Branch info: | 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. + We currently manage plugins using [lazy.nvim](https://github.com/folke/lazy.nvim). From 0dc481e6dfbcff1b13bee6ea872e6ed000eb5498 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:30:58 +0800 Subject: [PATCH 08/35] fix(ISSUE_TEMPLATE): format code Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 3 +-- .github/ISSUE_TEMPLATE/custom_config.yml | 4 +--- .github/ISSUE_TEMPLATE/lsp_issue_report.yml | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 785f63ea0..5c0f3fff4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -7,8 +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.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. - type: checkboxes id: is-latest-commit attributes: diff --git a/.github/ISSUE_TEMPLATE/custom_config.yml b/.github/ISSUE_TEMPLATE/custom_config.yml index 3f1f2d51c..d3dc98dd2 100644 --- a/.github/ISSUE_TEMPLATE/custom_config.yml +++ b/.github/ISSUE_TEMPLATE/custom_config.yml @@ -7,9 +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.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. - 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 d320b0a83..519b0e6de 100644 --- a/.github/ISSUE_TEMPLATE/lsp_issue_report.yml +++ b/.github/ISSUE_TEMPLATE/lsp_issue_report.yml @@ -7,8 +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.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. - type: checkboxes id: is-latest-commit attributes: From 3bc540e11cf92dfdc1d204d9a68e7edd38d58d68 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:33:31 +0800 Subject: [PATCH 09/35] fix(README): misplaced content Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7dd0e9c5..05390439a 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ Branch info: | 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. - - We currently manage plugins using [lazy.nvim](https://github.com/folke/lazy.nvim). Chinese introduction is [here](https://zhuanlan.zhihu.com/p/382092667). From d8e126250bd99d7f632c2586ff115bdafbbfe5e2 Mon Sep 17 00:00:00 2001 From: Charles Chiu Date: Wed, 10 Apr 2024 13:44:19 +0800 Subject: [PATCH 10/35] fix(todo-comment): add missing keywords (#1225) Signed-off-by: Charles Chiu --- lua/modules/configs/ui/todo.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/modules/configs/ui/todo.lua b/lua/modules/configs/ui/todo.lua index 1fbd248e2..bbd8af4b8 100644 --- a/lua/modules/configs/ui/todo.lua +++ b/lua/modules/configs/ui/todo.lua @@ -17,6 +17,7 @@ return function() WARN = { icon = icons.diagnostics.Warning, color = "warning", alt = { "WARNING", "XXX" } }, PERF = { icon = icons.ui.Perf, alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, NOTE = { icon = icons.ui.Note, color = "hint", alt = { "INFO" } }, + TEST = { icon = icons.ui.Lock, color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, }, gui_style = { fg = "NONE", @@ -29,7 +30,7 @@ return function() after = "", comments_only = true, max_line_len = 500, - exclude = { "big_file_disabled_ft" }, + exclude = { "big_file_disabled_ft", "checkhealth" }, }, colors = { error = { "DiagnosticError", "ErrorMsg", "#DC2626" }, From 12ac43cd5f30fab1574547c728cfd17b168aa82f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 01:48:19 +0000 Subject: [PATCH 11/35] chore(lockfile): auto update lazy-lock.json --- lazy-lock.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index ca4e35ad0..0d75ca58b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,7 +6,7 @@ "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, "bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" }, - "catppuccin": { "branch": "refactor/syntax-highlighting", "commit": "b6f54c74f8aea460b395c4b0ede9392dbab60424" }, + "catppuccin": { "branch": "refactor/syntax-highlighting", "commit": "bc04d9a1d32a52d14328c6d53d531b6c67c0a970" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-latex-symbols": { "branch": "main", "commit": "165fb66afdbd016eaa1570e41672c4c557b57124" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, @@ -25,9 +25,9 @@ "fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, - "fzf": { "branch": "master", "commit": "17bb7ad2784afdfc99beeec9e0a58f8dae12748a" }, + "fzf": { "branch": "master", "commit": "a4745626dd5c5f697dbbc5e3aa1796d5016c1faf" }, "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, - "gitsigns.nvim": { "branch": "main", "commit": "1a50b94066def8591d5f65bd60a4233902e9def4" }, + "gitsigns.nvim": { "branch": "main", "commit": "c097cb255096f333e14d341082a84f572b394fa2" }, "glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" }, "hop.nvim": { "branch": "master", "commit": "6d853addd6e11df8338b26e869a29b36f2c3e893" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, @@ -60,9 +60,9 @@ "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, "nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" }, "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "nvim-treesitter": { "branch": "master", "commit": "c16f66cca0c38b4e21371d8330b7f2ad6404f6dc" }, + "nvim-treesitter": { "branch": "master", "commit": "2bad828b48aed74efe8f7e4ea15550e18c7b482d" }, "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "2aa454e4037424c678a8ff033951a5be39e54b9c" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "67ac27f859ee3f7584f3edef81d0942bb61d5344" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, "nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" }, From 62cbc02ac77680b1dddd52a99be5a4915520e545 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Thu, 11 Apr 2024 23:49:08 +0800 Subject: [PATCH 12/35] fix(options): remove options managed by `vim-sleuth` (#1229) Since all tab-related stuff is now managed by `vim-sleuth`, I think it is better to remove the relevant options to avoid confusion. Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/core/options.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/core/options.lua b/lua/core/options.lua index efbd90129..b3b3e0295 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -28,7 +28,6 @@ local function load_options() encoding = "utf-8", equalalways = false, errorbells = true, - expandtab = true, fileformats = "unix,mac,dos", foldenable = true, foldlevelstart = 99, @@ -71,7 +70,6 @@ local function load_options() signcolumn = "yes", smartcase = true, smarttab = true, - softtabstop = 4, splitbelow = true, splitkeep = "screen", splitright = true, From 68830894e7448fb066f23837d1a3ef4d3f976d90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Apr 2024 01:48:25 +0000 Subject: [PATCH 13/35] chore(lockfile): auto update lazy-lock.json --- lazy-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 0d75ca58b..89159ae63 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -53,14 +53,14 @@ "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, - "nvim-lspconfig": { "branch": "master", "commit": "e25c4cdecd3d58c0deccce0f372426c8c480bcce" }, + "nvim-lspconfig": { "branch": "master", "commit": "b3014f2209503944f2714cf27c95591433a0c7d8" }, "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-scrollview": { "branch": "main", "commit": "5a7eb7e6c1b921761615b57a6140d73b1cc2b034" }, "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, "nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" }, "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "nvim-treesitter": { "branch": "master", "commit": "2bad828b48aed74efe8f7e4ea15550e18c7b482d" }, + "nvim-treesitter": { "branch": "master", "commit": "b0ac1135fe304edd34e18204304906744db0fe63" }, "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "67ac27f859ee3f7584f3edef81d0942bb61d5344" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, @@ -72,7 +72,7 @@ "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "0563a31b1f46a911865cb85df3ddde2eff9fdada" }, "rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" }, - "smart-splits.nvim": { "branch": "master", "commit": "50f52146e4504a3fc0f0d5830c8560a16a95dd08" }, + "smart-splits.nvim": { "branch": "master", "commit": "113d79d2fe3182e4dc9ac69047f185348c917f6b" }, "sniprun": { "branch": "master", "commit": "97daa506e2faa3939e0491642103635f9d22cd04" }, "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, "telescope-frecency.nvim": { "branch": "master", "commit": "94a532cb9c4713db83acf5432f5aadfd096e2af9" }, From 54f0997a29b4759bd9755ceaea1f11a91615e664 Mon Sep 17 00:00:00 2001 From: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Date: Wed, 17 Apr 2024 11:50:49 +0800 Subject: [PATCH 14/35] fix(rustaceanvim): use `init` for its config (#1231) 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 c948f8542..9075ff8f9 100644 --- a/lua/modules/plugins/lang.lua +++ b/lua/modules/plugins/lang.lua @@ -19,7 +19,7 @@ lang["mrcjkb/rustaceanvim"] = { lazy = true, ft = "rust", version = "^3", - config = require("lang.rust"), + init = require("lang.rust"), dependencies = { "nvim-lua/plenary.nvim" }, } lang["Saecki/crates.nvim"] = { From c0a47f9263168198321eeeeb4be6d813904c6cad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 01:47:57 +0000 Subject: [PATCH 15/35] chore(lockfile): auto update lazy-lock.json --- lazy-lock.json | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 89159ae63..b261aee2c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,7 @@ { "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "be7be2ca7f55bb881a7ffc16b2efa5af034ab06b" }, - "aerial.nvim": { "branch": "master", "commit": "24ebacab5821107c50f628e8e7774f105c08fe9b" }, + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "aerial.nvim": { "branch": "master", "commit": "218eae4cb7099898b379aa0788c6e3b6a463a23d" }, "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "autoclose.nvim": { "branch": "main", "commit": "dc42806540dcf448ecb2bad6b67204410cfbe629" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, @@ -19,15 +19,15 @@ "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "copilot-cmp": { "branch": "master", "commit": "72fbaa03695779f8349be3ac54fa8bd77eed3ee3" }, "copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" }, - "crates.nvim": { "branch": "main", "commit": "e8fa8ec62ded43c3b06bca7ef36be26b924681bb" }, + "crates.nvim": { "branch": "main", "commit": "786d12a70c9b91fa2d0d102bb07df02be0db31a1" }, "csv.vim": { "branch": "master", "commit": "962f88787ec6873eba1c7dbbd81d2723f1ee3c4b" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "friendly-snippets": { "branch": "main", "commit": "ea068f1becd91bcd4591fceb6420d4335e2e14d3" }, - "fzf": { "branch": "master", "commit": "a4745626dd5c5f697dbbc5e3aa1796d5016c1faf" }, + "fzf": { "branch": "master", "commit": "d169c951f3abe95ac533864d3ce0515bcb89adce" }, "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, - "gitsigns.nvim": { "branch": "main", "commit": "c097cb255096f333e14d341082a84f572b394fa2" }, + "gitsigns.nvim": { "branch": "main", "commit": "52f8da33cc0cadbf1164c4a91c8bfd6895533d67" }, "glance.nvim": { "branch": "master", "commit": "51059bcf21016387b6233c89eed220cf47fca752" }, "hop.nvim": { "branch": "master", "commit": "6d853addd6e11df8338b26e869a29b36f2c3e893" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, @@ -43,50 +43,50 @@ "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" }, - "neoconf.nvim": { "branch": "main", "commit": "9d61ff423ae5f179ace1823300c4873f38a7c418" }, + "neoconf.nvim": { "branch": "main", "commit": "a7da418753379af428f5d26ac91aa6fc18baf86e" }, "neodim": { "branch": "master", "commit": "9477da03b93f1984a81fee3b92e6ac7c6ada6aa4" }, - "neoscroll.nvim": { "branch": "master", "commit": "21d52973bde32db998fc8b6590f87eb3c3c6d8e4" }, - "none-ls.nvim": { "branch": "main", "commit": "dca7ddec321a102ec9e792b1b29193702aff5fbb" }, + "neoscroll.nvim": { "branch": "master", "commit": "c48f15b11877df2cfc5c39666fb8a2524df13bec" }, + "none-ls.nvim": { "branch": "main", "commit": "09a7c58e9283dda582d9805f6b182b5b9f137ec7" }, "nvim-bqf": { "branch": "main", "commit": "52703d7adc3be3f7c09eea9a80c5b8caa615fb25" }, "nvim-bufdel": { "branch": "main", "commit": "523d58e94e7212fff3e05c247b962dc8f93bcfde" }, "nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, "nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, - "nvim-lspconfig": { "branch": "master", "commit": "b3014f2209503944f2714cf27c95591433a0c7d8" }, + "nvim-lspconfig": { "branch": "master", "commit": "9266dc26862d8f3556c2ca77602e811472b4c5b8" }, "nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-scrollview": { "branch": "main", "commit": "5a7eb7e6c1b921761615b57a6140d73b1cc2b034" }, - "nvim-spectre": { "branch": "master", "commit": "2b012554a2536465243c0dff3605b5927c49ed23" }, + "nvim-spectre": { "branch": "master", "commit": "9653847cf2f225648967f6e9363643e327387579" }, "nvim-tree.lua": { "branch": "master", "commit": "81eb8d519233c105f30dc0a278607e62b20502fd" }, "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "nvim-treesitter": { "branch": "master", "commit": "b0ac1135fe304edd34e18204304906744db0fe63" }, - "nvim-treesitter-context": { "branch": "master", "commit": "f19766163c18515fb4d3c12d572bf9cba6cdb990" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "67ac27f859ee3f7584f3edef81d0942bb61d5344" }, + "nvim-treesitter": { "branch": "master", "commit": "3e10cffbb2a022cd8e2aaea9f4fffb514065e77c" }, + "nvim-treesitter-context": { "branch": "master", "commit": "c24a7a6dc5fde325af844d165323aa6f7082866e" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" }, - "nvim-web-devicons": { "branch": "master", "commit": "6e355632387a085f15a66ad68cf681c1d7374a04" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, + "nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" }, "paint.nvim": { "branch": "main", "commit": "6ce64212804f425073c61ab0d9c2b034f0435260" }, "persisted.nvim": { "branch": "main", "commit": "ca9900c31ee6e254a0ba7011ba49f48ebf4c8db2" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "0563a31b1f46a911865cb85df3ddde2eff9fdada" }, "rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" }, - "smart-splits.nvim": { "branch": "master", "commit": "113d79d2fe3182e4dc9ac69047f185348c917f6b" }, + "smart-splits.nvim": { "branch": "master", "commit": "e11caebbe3ce8fb70aced281931f73519a060e0a" }, "sniprun": { "branch": "master", "commit": "97daa506e2faa3939e0491642103635f9d22cd04" }, - "suda.vim": { "branch": "master", "commit": "66727b416837836712975e748bc8a19fb6cf4ec3" }, + "suda.vim": { "branch": "master", "commit": "d0ccc1a5172f6a26182238767e60e08b931d11fa" }, "telescope-frecency.nvim": { "branch": "master", "commit": "94a532cb9c4713db83acf5432f5aadfd096e2af9" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-live-grep-args.nvim": { "branch": "master", "commit": "731a046da7dd3adff9de871a42f9b7fb85f60f47" }, "telescope-undo.nvim": { "branch": "main", "commit": "d19e2edc8b18d03283bd91f67310ac300ad003ce" }, "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, - "telescope.nvim": { "branch": "master", "commit": "5a701e99906961218b55d7ad6c2a998f066c6fe0" }, + "telescope.nvim": { "branch": "master", "commit": "d00d9df48c00d8682c14c2b5da78bda7ef06b939" }, "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, "vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" }, "vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" }, - "vim-go": { "branch": "master", "commit": "14eedf6135cf4253b0ed48a0b53d6834a40da1c4" }, + "vim-go": { "branch": "master", "commit": "feef9b31507f8e942bcd21f9e1f22d587c83c72d" }, "vim-matchup": { "branch": "master", "commit": "2d660e4aa7c566014c667af2cda0458043527902" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, From d49179ab46df12e9f1905c5cd1fe306f3b06bf87 Mon Sep 17 00:00:00 2001 From: Mohu Date: Fri, 19 Apr 2024 18:01:35 +0800 Subject: [PATCH 16/35] feat!: improve go development experience (#1226) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(go): replace vim-go with go.nvim. Signed-off-by: ayamir * fix: install gopls by mason by default. Signed-off-by: ayamir * feat(keymap): set `n|gi` to goto implementation. Signed-off-by: ayamir * chore(keymap): use `gm` to jump to lsp implementations Co-authored-by: 冷酔閑吟 <50296129+Jint-lzxy@users.noreply.github.com> Signed-off-by: Mohu * fixup: remove unused `map_cu`. * chore: use gopls instead of null-ls to format. Signed-off-by: ayamir * chore: add notes for config options. Signed-off-by: ayamir * fixup: tidy settings for go.nvim and gopls. * docs: update more notes for how to config go.nvim. * chore: cleanup Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fix: enable only the options that are truly necessary Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> * fixup! chore: cleanup * fix(gopls): invalid config entry Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --------- Signed-off-by: ayamir Signed-off-by: Mohu Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: 冷酔閑吟 <50296129+Jint-lzxy@users.noreply.github.com> Co-authored-by: neogtliu --- lua/core/settings.lua | 2 +- lua/keymap/completion.lua | 6 ++- .../configs/completion/mason-lspconfig.lua | 2 +- .../configs/completion/servers/gopls.lua | 48 ++++++++++++++++--- lua/modules/configs/lang/go.lua | 21 ++++++++ 5 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 lua/modules/configs/lang/go.lua diff --git a/lua/core/settings.lua b/lua/core/settings.lua index 54e9ef1fe..8bfce5c89 100644 --- a/lua/core/settings.lua +++ b/lua/core/settings.lua @@ -106,7 +106,7 @@ settings["lsp_deps"] = { "jsonls", "lua_ls", "pylsp", - -- "gopls", + "gopls", } -- Set the general-purpose servers that will be installed during bootstrap here. diff --git a/lua/keymap/completion.lua b/lua/keymap/completion.lua index 23e81b2bc..ae67e2aad 100644 --- a/lua/keymap/completion.lua +++ b/lua/keymap/completion.lua @@ -4,7 +4,7 @@ local map_cmd = bind.map_cmd local map_callback = bind.map_callback local plug_map = { - ["n|"] = map_cmd("FormatToggle"):with_noremap():with_desc("Formater: Toggle format on save"), + ["n|"] = map_cmd("FormatToggle"):with_noremap():with_desc("formatter: Toggle format on save"), } bind.nvim_load_mapping(plug_map) @@ -50,6 +50,10 @@ function mapping.lsp(buf) ["n|gd"] = map_cr("Glance definitions"):with_silent():with_buffer(buf):with_desc("lsp: Preview definition"), ["n|gD"] = map_cr("Lspsaga goto_definition"):with_silent():with_buffer(buf):with_desc("lsp: Goto definition"), ["n|gh"] = map_cr("Glance references"):with_silent():with_buffer(buf):with_desc("lsp: Show reference"), + ["n|gm"] = map_cr("Glance implementations") + :with_silent() + :with_buffer(buf) + :with_desc("lsp: Show implementation"), ["n|gci"] = map_cr("Lspsaga incoming_calls") :with_silent() :with_buffer(buf) diff --git a/lua/modules/configs/completion/mason-lspconfig.lua b/lua/modules/configs/completion/mason-lspconfig.lua index f0c60349d..8a9469d2b 100644 --- a/lua/modules/configs/completion/mason-lspconfig.lua +++ b/lua/modules/configs/completion/mason-lspconfig.lua @@ -27,7 +27,7 @@ M.setup = function() min = severity_map[diagnostics_level], }, } or false, - -- set update_in_insert to false bacause it was enabled by lspsaga + -- set update_in_insert to false because it was enabled by lspsaga update_in_insert = false, }) diff --git a/lua/modules/configs/completion/servers/gopls.lua b/lua/modules/configs/completion/servers/gopls.lua index 9f8e1f75f..c2993a7b7 100644 --- a/lua/modules/configs/completion/servers/gopls.lua +++ b/lua/modules/configs/completion/servers/gopls.lua @@ -1,15 +1,49 @@ -- https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/gopls.lua return { - flags = { debounce_text_changes = 500 }, - cmd = { "gopls", "-remote=auto" }, + cmd = { "gopls", "-remote.debug=:0", "-remote=auto" }, + filetypes = { "go", "gomod", "gosum", "gotmpl", "gohtmltmpl", "gotexttmpl" }, + flags = { allow_incremental_sync = true, debounce_text_changes = 500 }, + capabilities = { + textDocument = { + completion = { + contextSupport = true, + dynamicRegistration = true, + completionItem = { + commitCharactersSupport = true, + deprecatedSupport = true, + preselectSupport = true, + insertReplaceSupport = true, + labelDetailsSupport = true, + snippetSupport = true, + documentationFormat = { "markdown", "plaintext" }, + resolveSupport = { + properties = { + "documentation", + "details", + "additionalTextEdits", + }, + }, + }, + }, + }, + }, settings = { gopls = { + staticcheck = true, + semanticTokens = true, + noSemanticString = true, usePlaceholders = true, - analyses = { - nilness = true, - shadow = true, - unusedparams = true, - unusewrites = true, + completeUnimported = true, + symbolMatcher = "Fuzzy", + buildFlags = { "-tags", "integration" }, + codelenses = { + generate = true, + gc_details = true, + test = true, + tidy = true, + vendor = true, + regenerate_cgo = true, + upgrade_dependency = true, }, hints = { assignVariableTypes = true, diff --git a/lua/modules/configs/lang/go.lua b/lua/modules/configs/lang/go.lua new file mode 100644 index 000000000..8ca7b03de --- /dev/null +++ b/lua/modules/configs/lang/go.lua @@ -0,0 +1,21 @@ +return function() + require("modules.utils").load_plugin("go", { + -- By default, we've turned off these options to prevent clashes with our gopls config + icons = false, + diagnostic = false, + lsp_cfg = false, + lsp_gofumpt = false, + lsp_keymaps = false, + lsp_codelens = false, + lsp_document_formatting = false, + lsp_inlay_hints = { enable = false }, + -- DAP-related settings are also turned off here for the same reason + dap_debug = false, + dap_debug_keymap = false, + textobjects = false, + -- Miscellaneous options to seamlessly integrate with other plugins + trouble = true, + luasnip = false, + run_in_floaterm = false, + }) +end From fc0469928b62b8288e7a6a3cb9a23665bb4c7887 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Fri, 19 Apr 2024 18:48:31 +0800 Subject: [PATCH 17/35] feat!: add `advanced-git-search.nvim` --- lua/modules/configs/tool/telescope.lua | 35 ++++++++++++++++++++++++++ lua/modules/plugins/tool.lua | 13 ++++++++++ 2 files changed, 48 insertions(+) diff --git a/lua/modules/configs/tool/telescope.lua b/lua/modules/configs/tool/telescope.lua index d8fdddd44..aad1f1e84 100644 --- a/lua/modules/configs/tool/telescope.lua +++ b/lua/modules/configs/tool/telescope.lua @@ -86,6 +86,40 @@ return function() }, }, }, + advanced_git_search = { + -- Browse command to open commits in browser. Default fugitive GBrowse. + browse_command = "GBrowse", + -- fugitive or diffview + diff_plugin = "diffview", + -- customize git in previewer + -- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" } + git_flags = { "-c", "delta.side-by-side=true" }, + -- customize git diff in previewer + -- e.g. flags such as { "--raw" } + git_diff_flags = {}, + -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch + show_builtin_git_pickers = false, + entry_default_author_or_date = "author", -- one of "author" or "date" + keymaps = { + -- following keymaps can be overridden + toggle_date_author = "", + open_commit_in_browser = "", + copy_commit_hash = "", + show_entire_commit = "", + }, + + -- Telescope layout setup + telescope_theme = { + function_name_1 = { + -- Theme options + }, + function_name_2 = "dropdown", + -- e.g. realistic example + show_custom_functions = { + layout_config = { width = 0.4, height = 0.4 }, + }, + }, + }, }, }) @@ -98,4 +132,5 @@ return function() require("telescope").load_extension("zoxide") require("telescope").load_extension("persisted") require("telescope").load_extension("aerial") + require("telescope").load_extension("advanced_git_search") end diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua index 080ec93b8..381e90b47 100644 --- a/lua/modules/plugins/tool.lua +++ b/lua/modules/plugins/tool.lua @@ -85,6 +85,19 @@ tool["nvim-telescope/telescope.nvim"] = { { "nvim-telescope/telescope-frecency.nvim" }, { "nvim-telescope/telescope-live-grep-args.nvim" }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + { + "aaronhallaert/advanced-git-search.nvim", + cmd = { "AdvancedGitSearch" }, + dependencies = { + -- to show diff splits and open commits in browser + "tpope/vim-fugitive", + -- to open commits in browser with fugitive + "tpope/vim-rhubarb", + -- optional: to replace the diff from fugitive with diffview.nvim + -- (fugitive is still needed to open in browser) + "sindrets/diffview.nvim", + }, + }, }, } From 64a99ea2f78f8e665d05c1145ba9892087556fdd Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Fri, 19 Apr 2024 19:32:03 +0800 Subject: [PATCH 18/35] feat!: add `search.nvim` to enhance `telescope`. --- lua/modules/configs/tool/search.lua | 28 ++++++++++++++++++++++++++++ lua/modules/plugins/tool.lua | 4 ++++ 2 files changed, 32 insertions(+) create mode 100644 lua/modules/configs/tool/search.lua diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua new file mode 100644 index 000000000..c5f83b96a --- /dev/null +++ b/lua/modules/configs/tool/search.lua @@ -0,0 +1,28 @@ +return function() + local builtin = require("telescope.builtin") + require("search").setup({ + append_tabs = { -- append_tabs will add the provided tabs to the default ones + { + name = "Commits", + tele_func = builtin.git_commits, + available = function() + return vim.fn.isdirectory(".git") == 1 + end, + }, + }, + -- its also possible to overwrite the default tabs using the tabs key instead of append_tabs + -- tabs = { + -- { + -- "Files", + -- function(opts) + -- opts = opts or {} + -- if vim.fn.isdirectory(".git") == 1 then + -- builtin.git_files(opts) + -- else + -- builtin.find_files(opts) + -- end + -- end, + -- }, + -- }, + }) +end diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua index 381e90b47..3b7901aa5 100644 --- a/lua/modules/plugins/tool.lua +++ b/lua/modules/plugins/tool.lua @@ -98,6 +98,10 @@ tool["nvim-telescope/telescope.nvim"] = { "sindrets/diffview.nvim", }, }, + { + "FabianWirth/search.nvim", + config = require("tool.search"), + }, }, } From c7767fa6c0f3ef93e5c55bd920aae01addfda31b Mon Sep 17 00:00:00 2001 From: ayamir Date: Sat, 20 Apr 2024 14:19:52 +0800 Subject: [PATCH 19/35] feat: reorganize keymaps for telescope search collections. Signed-off-by: ayamir --- lua/keymap/tool.lua | 38 +++++----- lua/modules/configs/tool/search.lua | 103 ++++++++++++++++++++++------ 2 files changed, 99 insertions(+), 42 deletions(-) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index 9ec29a30d..5f4605f1c 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -1,3 +1,4 @@ +---@diagnostic disable: undefined-field local bind = require("keymap.bind") local map_cr = bind.map_cr local map_cu = bind.map_cu @@ -89,32 +90,24 @@ local plug_map = { :with_noremap() :with_silent() :with_desc("tool: Toggle command panel"), - ["n|u"] = map_callback(function() + ["n|fu"] = map_callback(function() require("telescope").extensions.undo.undo() end) :with_noremap() :with_silent() :with_desc("edit: Show undo history"), - ["n|fp"] = map_callback(function() - require("telescope").extensions.projects.projects({}) - end) - :with_noremap() - :with_silent() - :with_desc("find: Project"), - ["n|fr"] = map_callback(function() - require("telescope").extensions.frecency.frecency({}) - end) - :with_noremap() - :with_silent() - :with_desc("find: File by frecency"), ["n|fw"] = map_callback(function() require("telescope").extensions.live_grep_args.live_grep_args() end) :with_noremap() :with_silent() :with_desc("find: Word in project"), - ["n|fe"] = map_cu("Telescope oldfiles"):with_noremap():with_silent():with_desc("find: File by history"), - ["n|ff"] = map_cu("Telescope find_files"):with_noremap():with_silent():with_desc("find: File in project"), + ["n|ff"] = map_callback(function() + require("search").open({ collection = "file" }) + end) + :with_noremap() + :with_silent() + :with_desc("find: File in project"), ["n|fc"] = map_callback(function() require("telescope.builtin").colorscheme({ enable_preview = true }) end) @@ -122,14 +115,12 @@ local plug_map = { :with_silent() :with_desc("ui: Change colorscheme for current session"), ["n|bn"] = map_cu(":enew"):with_noremap():with_silent():with_desc("buffer: New"), - ["n|fg"] = map_cu("Telescope git_files") + ["n|fg"] = map_callback(function() + require("search").open({ collection = "git" }) + end) :with_noremap() :with_silent() :with_desc("find: file in git project"), - ["n|fz"] = map_cu("Telescope zoxide list") - :with_noremap() - :with_silent() - :with_desc("edit: Change current direrctory by zoxide"), ["n|fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"), ["n|fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"), ["v|fs"] = map_callback(function() @@ -138,7 +129,12 @@ local plug_map = { :with_noremap() :with_silent() :with_desc("find: Selection text"), - ["n|fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"), + ["n|fd"] = map_callback(function() + require("search").open({ collection = "workspace" }) + end) + :with_noremap() + :with_silent() + :with_desc("find: Session"), -- Plugin: dap ["n|"] = map_callback(function() diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua index c5f83b96a..135c573bf 100644 --- a/lua/modules/configs/tool/search.lua +++ b/lua/modules/configs/tool/search.lua @@ -1,28 +1,89 @@ +---@diagnostic disable: undefined-field return function() local builtin = require("telescope.builtin") + local extensions = require("telescope").extensions require("search").setup({ - append_tabs = { -- append_tabs will add the provided tabs to the default ones - { - name = "Commits", - tele_func = builtin.git_commits, - available = function() - return vim.fn.isdirectory(".git") == 1 - end, + collections = { + file = { + initial_tab = 1, + tabs = { + { + name = "Files", + tele_func = function(opts) + opts = opts or {} + if vim.fn.isdirectory(".git") == 1 then + builtin.git_files(opts) + else + builtin.find_files(opts) + end + end, + }, + { + name = "Frecency", + tele_func = function() + extensions.frecency.frecency() + end, + }, + { + name = "Oldfiles", + tele_func = function() + builtin.oldfiles() + end, + }, + }, + }, + git = { + initial_tab = 4, + tabs = { + { + name = "Commits", + tele_func = function() + builtin.git_commits() + end, + }, + { + name = "Commits on File", + tele_func = function() + extensions.advanced_git_search.diff_commit_file() + end, + }, + { + name = "Commit Content", + tele_func = function() + extensions.advanced_git_search.search_log_content() + end, + }, + { + name = "Branches", + tele_func = function() + builtin.git_branches() + end, + }, + }, + }, + workspace = { + initial_tab = 1, + tabs = { + { + name = "Sessions", + tele_func = function() + extensions.persisted.persisted() + end, + }, + { + name = "Projects", + tele_func = function() + extensions.projects.projects({}) + end, + }, + { + name = "Zoxide", + tele_func = function() + extensions.zoxide.list() + end, + }, + }, }, }, - -- its also possible to overwrite the default tabs using the tabs key instead of append_tabs - -- tabs = { - -- { - -- "Files", - -- function(opts) - -- opts = opts or {} - -- if vim.fn.isdirectory(".git") == 1 then - -- builtin.git_files(opts) - -- else - -- builtin.find_files(opts) - -- end - -- end, - -- }, - -- }, }) end From b8e798d97048148b0d8a0562dab81ecc073667bc Mon Sep 17 00:00:00 2001 From: ayamir Date: Sat, 20 Apr 2024 17:32:21 +0800 Subject: [PATCH 20/35] fixup: update descriptions for modified keymaps. --- lua/keymap/tool.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index 5f4605f1c..5f6ac0032 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -120,7 +120,7 @@ local plug_map = { end) :with_noremap() :with_silent() - :with_desc("find: file in git project"), + :with_desc("find: Git related search"), ["n|fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"), ["n|fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"), ["v|fs"] = map_callback(function() @@ -134,7 +134,7 @@ local plug_map = { end) :with_noremap() :with_silent() - :with_desc("find: Session"), + :with_desc("find: Session, Project and Directory"), -- Plugin: dap ["n|"] = map_callback(function() From 360787996ee7e55709c6e0dd8afc06b173a03b47 Mon Sep 17 00:00:00 2001 From: Mohu Date: Sat, 20 Apr 2024 18:48:40 +0800 Subject: [PATCH 21/35] chore: remove single diagnostic disable for undefined-field. Co-authored-by: jint_lzxy_ <50296129+Jint-lzxy@users.noreply.github.com> Signed-off-by: Mohu --- lua/keymap/tool.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index 5f6ac0032..995c28b13 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -1,4 +1,3 @@ ----@diagnostic disable: undefined-field local bind = require("keymap.bind") local map_cr = bind.map_cr local map_cu = bind.map_cu From cde6c9cd4d7abec0ddc3807a54741863da0481ff Mon Sep 17 00:00:00 2001 From: ayamir Date: Sat, 20 Apr 2024 18:51:45 +0800 Subject: [PATCH 22/35] chore: remove diagnostic disable for undefined-field. --- lua/modules/configs/lang/crates-keymap.lua | 1 - lua/modules/configs/tool/search.lua | 1 - 2 files changed, 2 deletions(-) diff --git a/lua/modules/configs/lang/crates-keymap.lua b/lua/modules/configs/lang/crates-keymap.lua index 685eff546..150f4da0b 100644 --- a/lua/modules/configs/lang/crates-keymap.lua +++ b/lua/modules/configs/lang/crates-keymap.lua @@ -1,4 +1,3 @@ ----@diagnostic disable: undefined-field local bind = require("keymap.bind") local map_callback = bind.map_callback diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua index 135c573bf..e2a621e4b 100644 --- a/lua/modules/configs/tool/search.lua +++ b/lua/modules/configs/tool/search.lua @@ -1,4 +1,3 @@ ----@diagnostic disable: undefined-field return function() local builtin = require("telescope.builtin") local extensions = require("telescope").extensions From 14aad3fb1eb7f6926330f9ad62acd986b2b99530 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Sun, 28 Apr 2024 20:32:29 +0800 Subject: [PATCH 23/35] feat!: replace `colorizer.lua` with `nvim-highlight-colors` --- lua/modules/configs/editor/colorizer.lua | 3 --- lua/modules/configs/editor/highlight-colors.lua | 16 ++++++++++++++++ lua/modules/plugins/editor.lua | 4 ++-- 3 files changed, 18 insertions(+), 5 deletions(-) delete mode 100644 lua/modules/configs/editor/colorizer.lua create mode 100644 lua/modules/configs/editor/highlight-colors.lua diff --git a/lua/modules/configs/editor/colorizer.lua b/lua/modules/configs/editor/colorizer.lua deleted file mode 100644 index efee45019..000000000 --- a/lua/modules/configs/editor/colorizer.lua +++ /dev/null @@ -1,3 +0,0 @@ -return function() - require("modules.utils").load_plugin("colorizer", {}) -end diff --git a/lua/modules/configs/editor/highlight-colors.lua b/lua/modules/configs/editor/highlight-colors.lua new file mode 100644 index 000000000..d0a272861 --- /dev/null +++ b/lua/modules/configs/editor/highlight-colors.lua @@ -0,0 +1,16 @@ +return function() + require("nvim-highlight-colors").setup({ + ---Render style + ---@usage 'background'|'foreground'|'virtual' + render = "background", + + ---Set virtual symbol (requires render to be set to 'virtual') + -- virtual_symbol = "■", + + ---Highlight named colors, e.g. 'green' + enable_named_colors = false, + + ---Highlight tailwind colors, e.g. 'bg-blue-500' + enable_tailwind = true, + }) +end diff --git a/lua/modules/plugins/editor.lua b/lua/modules/plugins/editor.lua index 73b273351..211f2db82 100644 --- a/lua/modules/plugins/editor.lua +++ b/lua/modules/plugins/editor.lua @@ -110,8 +110,8 @@ editor["nvim-treesitter/nvim-treesitter"] = { config = require("editor.autotag"), }, { - "NvChad/nvim-colorizer.lua", - config = require("editor.colorizer"), + "brenoprata10/nvim-highlight-colors", + config = require("editor.highlight-colors"), }, { "hiphish/rainbow-delimiters.nvim", From 8024cc73cc4bda57fea39326adfc452774b4567e Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:27:17 +0800 Subject: [PATCH 24/35] fix: invoke `utils.load_plugin` Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- .../configs/editor/highlight-colors.lua | 37 +++++++++++++------ lua/modules/plugins/editor.lua | 11 +++--- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/lua/modules/configs/editor/highlight-colors.lua b/lua/modules/configs/editor/highlight-colors.lua index d0a272861..06a0f6acd 100644 --- a/lua/modules/configs/editor/highlight-colors.lua +++ b/lua/modules/configs/editor/highlight-colors.lua @@ -1,16 +1,31 @@ return function() - require("nvim-highlight-colors").setup({ - ---Render style - ---@usage 'background'|'foreground'|'virtual' + require("modules.utils").load_plugin("nvim-highlight-colors", { render = "background", - - ---Set virtual symbol (requires render to be set to 'virtual') - -- virtual_symbol = "■", - - ---Highlight named colors, e.g. 'green' + enable_hex = true, + enable_short_hex = true, + enable_rgb = true, + enable_hsl = true, + enable_var_usage = true, enable_named_colors = false, - - ---Highlight tailwind colors, e.g. 'bg-blue-500' - enable_tailwind = true, + enable_tailwind = false, + -- Exclude filetypes or buftypes from highlighting + exclude_filetypes = { + "alpha", + "bigfile", + "dap-repl", + "fugitive", + "git", + "notify", + "NvimTree", + "Outline", + "TelescopePrompt", + "toggleterm", + "undotree", + }, + exclude_buftypes = { + "nofile", + "prompt", + "terminal", + }, }) end diff --git a/lua/modules/plugins/editor.lua b/lua/modules/plugins/editor.lua index 211f2db82..b25003e12 100644 --- a/lua/modules/plugins/editor.lua +++ b/lua/modules/plugins/editor.lua @@ -63,9 +63,14 @@ editor["smoka7/hop.nvim"] = { } editor["tzachar/local-highlight.nvim"] = { lazy = true, - event = { "CursorHold", "CursorHoldI" }, + event = { "BufReadPost", "BufAdd", "BufNewFile" }, config = require("editor.local-highlight"), } +editor["brenoprata10/nvim-highlight-colors"] = { + lazy = true, + event = { "CursorHold", "CursorHoldI" }, + config = require("editor.highlight-colors"), +} editor["romainl/vim-cool"] = { lazy = true, event = { "CursorMoved", "InsertEnter" }, @@ -109,10 +114,6 @@ editor["nvim-treesitter/nvim-treesitter"] = { "windwp/nvim-ts-autotag", config = require("editor.autotag"), }, - { - "brenoprata10/nvim-highlight-colors", - config = require("editor.highlight-colors"), - }, { "hiphish/rainbow-delimiters.nvim", config = require("editor.rainbow_delims"), From e62e504f70fd2a59d0252a0f4a8739e174d6550a Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 11 Jun 2024 15:48:04 +0800 Subject: [PATCH 25/35] chore(advanced-git-search): remove unused options Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/modules/configs/tool/telescope.lua | 36 +------------------------- lua/modules/plugins/tool.lua | 24 +++++++---------- 2 files changed, 11 insertions(+), 49 deletions(-) diff --git a/lua/modules/configs/tool/telescope.lua b/lua/modules/configs/tool/telescope.lua index aad1f1e84..71884d085 100644 --- a/lua/modules/configs/tool/telescope.lua +++ b/lua/modules/configs/tool/telescope.lua @@ -64,7 +64,6 @@ return function() }, live_grep_args = { auto_quoting = true, -- enable/disable auto-quoting - -- define mappings, e.g. mappings = { -- extend mappings i = { [""] = lga_actions.quote_prompt(), @@ -74,12 +73,8 @@ return function() }, undo = { side_by_side = true, - mappings = { -- this whole table is the default + mappings = { i = { - -- IMPORTANT: Note that telescope-undo must be available when telescope is configured if - -- you want to use the following actions. This means installing as a dependency of - -- telescope in it's `requirements` and loading this extension from there instead of - -- having the separate plugin definition as outlined above. See issue #6. [""] = require("telescope-undo.actions").yank_additions, [""] = require("telescope-undo.actions").yank_deletions, [""] = require("telescope-undo.actions").restore, @@ -87,38 +82,9 @@ return function() }, }, advanced_git_search = { - -- Browse command to open commits in browser. Default fugitive GBrowse. - browse_command = "GBrowse", - -- fugitive or diffview diff_plugin = "diffview", - -- customize git in previewer - -- e.g. flags such as { "--no-pager" }, or { "-c", "delta.side-by-side=false" } git_flags = { "-c", "delta.side-by-side=true" }, - -- customize git diff in previewer - -- e.g. flags such as { "--raw" } - git_diff_flags = {}, - -- Show builtin git pickers when executing "show_custom_functions" or :AdvancedGitSearch - show_builtin_git_pickers = false, entry_default_author_or_date = "author", -- one of "author" or "date" - keymaps = { - -- following keymaps can be overridden - toggle_date_author = "", - open_commit_in_browser = "", - copy_commit_hash = "", - show_entire_commit = "", - }, - - -- Telescope layout setup - telescope_theme = { - function_name_1 = { - -- Theme options - }, - function_name_2 = "dropdown", - -- e.g. realistic example - show_custom_functions = { - layout_config = { width = 0.4, height = 0.4 }, - }, - }, }, }, }) diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua index b757c412d..3dc940e9d 100644 --- a/lua/modules/plugins/tool.lua +++ b/lua/modules/plugins/tool.lua @@ -78,35 +78,31 @@ tool["nvim-telescope/telescope.nvim"] = { cmd = "Telescope", config = require("tool.telescope"), dependencies = { - { "nvim-tree/nvim-web-devicons" }, { "nvim-lua/plenary.nvim" }, + { "nvim-tree/nvim-web-devicons" }, + { "jvgrootveld/telescope-zoxide" }, { "debugloop/telescope-undo.nvim" }, + { "nvim-telescope/telescope-frecency.nvim" }, + { "nvim-telescope/telescope-live-grep-args.nvim" }, + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, { "ahmedkhalf/project.nvim", event = { "CursorHold", "CursorHoldI" }, config = require("tool.project"), }, - { "jvgrootveld/telescope-zoxide" }, - { "nvim-telescope/telescope-frecency.nvim" }, - { "nvim-telescope/telescope-live-grep-args.nvim" }, - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + { + "FabianWirth/search.nvim", + config = require("tool.search"), + }, { "aaronhallaert/advanced-git-search.nvim", cmd = { "AdvancedGitSearch" }, dependencies = { - -- to show diff splits and open commits in browser - "tpope/vim-fugitive", - -- to open commits in browser with fugitive "tpope/vim-rhubarb", - -- optional: to replace the diff from fugitive with diffview.nvim - -- (fugitive is still needed to open in browser) + "tpope/vim-fugitive", "sindrets/diffview.nvim", }, }, - { - "FabianWirth/search.nvim", - config = require("tool.search"), - }, }, } From 400e77d977c0a5d5da04194a2aa82d09d536cd0e Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Thu, 13 Jun 2024 19:01:48 +0800 Subject: [PATCH 26/35] feat(telescope): add collection panel for `search.nvim` --- lua/keymap/helpers.lua | 27 +++++++++++++++++++ lua/keymap/tool.lua | 6 +++++ lua/modules/configs/tool/search.lua | 41 +++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) diff --git a/lua/keymap/helpers.lua b/lua/keymap/helpers.lua index b411bcd79..2b606b462 100644 --- a/lua/keymap/helpers.lua +++ b/lua/keymap/helpers.lua @@ -11,6 +11,33 @@ _G._command_panel = function() }) end +_G._telescope_collections = function(opts) + local pickers = require("telescope.pickers") + local finder = require("telescope.finders") + local conf = require("telescope.config").values + local actions = require("telescope.actions") + local action_state = require("telescope.actions.state") + opts = opts or {} + + local picker_name = { "file", "live_grep", "git", "workspace", "misc" } + pickers + .new(opts, { + prompt_title = "Telesscope Collections", + finder = finder.new_table({ results = picker_name }), + sorter = conf.generic_sorter(opts), + attach_mappings = function(bufnr) + actions.select_default:replace(function() + actions.close(bufnr) + local selection = action_state.get_selected_entry() + require("search").open({ collection = selection[1] }) + end) + + return true + end, + }) + :find() +end + _G._flash_esc_or_noh = function() local flash_active, state = pcall(function() return require("flash.plugins.char").state diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index 480e1144e..748223e15 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -89,6 +89,12 @@ local plug_map = { :with_noremap() :with_silent() :with_desc("tool: Toggle command panel"), + ["n|f"] = map_callback(function() + _telescope_collections(require("telescope.themes").get_dropdown({})) + end) + :with_noremap() + :with_silent() + :with_desc("tool: Show Telescope collections"), ["n|fu"] = map_callback(function() require("telescope").extensions.undo.undo() end) diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua index e2a621e4b..fab9c5aeb 100644 --- a/lua/modules/configs/tool/search.lua +++ b/lua/modules/configs/tool/search.lua @@ -31,6 +31,24 @@ return function() }, }, }, + live_grep = { + initial_tab = 1, + tabs = { + { + name = "Word in project", + tele_func = function() + extensions.live_grep_args.live_grep_args() + end, + }, + { + name = "Current Word", + tele_func = function(opts) + opts = opts or {} + builtin.grep_string(opts) + end, + }, + }, + }, git = { initial_tab = 4, tabs = { @@ -63,6 +81,12 @@ return function() workspace = { initial_tab = 1, tabs = { + { + name = "Buffers", + tele_func = function() + builtin.buffers() + end, + }, { name = "Sessions", tele_func = function() @@ -83,6 +107,23 @@ return function() }, }, }, + misc = { + initial_tab = 1, + tabs = { + { + name = "Colorschemes", + tele_func = function() + builtin.colorscheme({ enable_preview = true }) + end, + }, + { + name = "Undo History", + tele_func = function() + extensions.undo.undo() + end, + }, + }, + }, }, }) end From 821da34fd23132b8b5a86e4c4d9172d13fe56276 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Mon, 17 Jun 2024 11:39:04 +0800 Subject: [PATCH 27/35] chore: typo --- lua/keymap/helpers.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/keymap/helpers.lua b/lua/keymap/helpers.lua index 2b606b462..3659ddb2b 100644 --- a/lua/keymap/helpers.lua +++ b/lua/keymap/helpers.lua @@ -22,7 +22,7 @@ _G._telescope_collections = function(opts) local picker_name = { "file", "live_grep", "git", "workspace", "misc" } pickers .new(opts, { - prompt_title = "Telesscope Collections", + prompt_title = "Telescope Collections", finder = finder.new_table({ results = picker_name }), sorter = conf.generic_sorter(opts), attach_mappings = function(bufnr) From f70e6850490e004dd2d5ed74076dab7362fd9c79 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Mon, 17 Jun 2024 17:11:48 +0800 Subject: [PATCH 28/35] feat: more documentation Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/keymap/tool.lua | 15 +++++++++------ lua/modules/configs/tool/search.lua | 18 +++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index 748223e15..e8e4d1f16 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -118,21 +118,24 @@ local plug_map = { end) :with_noremap() :with_silent() - :with_desc("ui: Change colorscheme for current session"), - ["n|bn"] = map_cu(":enew"):with_noremap():with_silent():with_desc("buffer: New"), + :with_desc("ui: Change colorscheme for the current session"), ["n|fg"] = map_callback(function() require("search").open({ collection = "git" }) end) :with_noremap() :with_silent() - :with_desc("find: file in git project"), + :with_desc("find: Git objects"), ["n|fz"] = map_cu("Telescope zoxide list") :with_noremap() :with_silent() - :with_desc("edit: Change current directory by zoxide"), - ["n|fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Buffer opened"), - ["nv|fs"] = map_cu("Telescope grep_string"):with_noremap():with_silent():with_desc("find: Current word"), + :with_desc("edit: Change current directory using zoxide"), + ["nv|fs"] = map_cu("Telescope grep_string") + :with_noremap() + :with_silent() + :with_desc("find: Word under cursor"), + ["n|fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Open buffer(s)"), ["n|fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"), + ["n|bn"] = map_cu("enew"):with_noremap():with_silent():with_desc("buffer: New"), -- Plugin: dap ["n|"] = map_callback(function() diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua index fab9c5aeb..b2a86e033 100644 --- a/lua/modules/configs/tool/search.lua +++ b/lua/modules/configs/tool/search.lua @@ -41,7 +41,7 @@ return function() end, }, { - name = "Current Word", + name = "Word under cursor", tele_func = function(opts) opts = opts or {} builtin.grep_string(opts) @@ -50,30 +50,30 @@ return function() }, }, git = { - initial_tab = 4, + initial_tab = 1, tabs = { { - name = "Commits", + name = "Branches", tele_func = function() - builtin.git_commits() + builtin.git_branches() end, }, { - name = "Commits on File", + name = "Commits", tele_func = function() - extensions.advanced_git_search.diff_commit_file() + builtin.git_commits() end, }, { - name = "Commit Content", + name = "Commit content", tele_func = function() extensions.advanced_git_search.search_log_content() end, }, { - name = "Branches", + name = "Diff current file with commit", tele_func = function() - builtin.git_branches() + extensions.advanced_git_search.diff_commit_file() end, }, }, From 8957c58fb3b7da9ad6ebe59013af390f1af3960e Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Mon, 17 Jun 2024 18:06:49 +0800 Subject: [PATCH 29/35] chore: clean up --- lua/core/mapping.lua | 1 + lua/keymap/tool.lua | 41 ----------------------------------------- 2 files changed, 1 insertion(+), 41 deletions(-) diff --git a/lua/core/mapping.lua b/lua/core/mapping.lua index cb0c061de..280ca1ba1 100644 --- a/lua/core/mapping.lua +++ b/lua/core/mapping.lua @@ -38,6 +38,7 @@ local core_map = { ["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"), + ["n|bn"] = map_cu(":enew"):with_noremap():with_silent():with_desc("buffer: New"), -- 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"), diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index e8e4d1f16..7aaf6d42f 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -95,47 +95,6 @@ local plug_map = { :with_noremap() :with_silent() :with_desc("tool: Show Telescope collections"), - ["n|fu"] = map_callback(function() - require("telescope").extensions.undo.undo() - end) - :with_noremap() - :with_silent() - :with_desc("edit: Show undo history"), - ["n|fw"] = map_callback(function() - require("telescope").extensions.live_grep_args.live_grep_args() - end) - :with_noremap() - :with_silent() - :with_desc("find: Word in project"), - ["n|ff"] = map_callback(function() - require("search").open({ collection = "file" }) - end) - :with_noremap() - :with_silent() - :with_desc("find: File in project"), - ["n|fc"] = map_callback(function() - require("telescope.builtin").colorscheme({ enable_preview = true }) - end) - :with_noremap() - :with_silent() - :with_desc("ui: Change colorscheme for the current session"), - ["n|fg"] = map_callback(function() - require("search").open({ collection = "git" }) - end) - :with_noremap() - :with_silent() - :with_desc("find: Git objects"), - ["n|fz"] = map_cu("Telescope zoxide list") - :with_noremap() - :with_silent() - :with_desc("edit: Change current directory using zoxide"), - ["nv|fs"] = map_cu("Telescope grep_string") - :with_noremap() - :with_silent() - :with_desc("find: Word under cursor"), - ["n|fb"] = map_cu("Telescope buffers"):with_noremap():with_silent():with_desc("find: Open buffer(s)"), - ["n|fd"] = map_cu("Telescope persisted"):with_noremap():with_silent():with_desc("find: Session"), - ["n|bn"] = map_cu("enew"):with_noremap():with_silent():with_desc("buffer: New"), -- Plugin: dap ["n|"] = map_callback(function() From 3d77f4abcf81f788bccdb322218b137fb855b9f5 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Mon, 17 Jun 2024 18:07:56 +0800 Subject: [PATCH 30/35] feat: don't hard-code collection names --- lua/keymap/helpers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/keymap/helpers.lua b/lua/keymap/helpers.lua index 3659ddb2b..3e9b4e51f 100644 --- a/lua/keymap/helpers.lua +++ b/lua/keymap/helpers.lua @@ -19,11 +19,11 @@ _G._telescope_collections = function(opts) local action_state = require("telescope.actions.state") opts = opts or {} - local picker_name = { "file", "live_grep", "git", "workspace", "misc" } + local collections = vim.tbl_keys(require("search.tabs").collections) pickers .new(opts, { prompt_title = "Telescope Collections", - finder = finder.new_table({ results = picker_name }), + finder = finder.new_table({ results = collections }), sorter = conf.generic_sorter(opts), attach_mappings = function(bufnr) actions.select_default:replace(function() From 6ea599bf56c19ecead02a5225e4bf4132d2229f9 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Tue, 18 Jun 2024 11:54:21 +0800 Subject: [PATCH 31/35] chore: use custom loader --- lua/modules/configs/tool/search.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua index b2a86e033..97d5d1d5b 100644 --- a/lua/modules/configs/tool/search.lua +++ b/lua/modules/configs/tool/search.lua @@ -1,7 +1,7 @@ return function() local builtin = require("telescope.builtin") local extensions = require("telescope").extensions - require("search").setup({ + require("modules.utils").load_plugin("search", { collections = { file = { initial_tab = 1, From cfa9b9433c2612e10b1f18435fb5642394d00ad3 Mon Sep 17 00:00:00 2001 From: CharlesChiuGit Date: Tue, 18 Jun 2024 12:14:38 +0800 Subject: [PATCH 32/35] fix: disable warning --- lua/keymap/tool.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index 7aaf6d42f..d73e42791 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -90,6 +90,7 @@ local plug_map = { :with_silent() :with_desc("tool: Toggle command panel"), ["n|f"] = map_callback(function() + -- luacheck: globals _telescope_collections _telescope_collections(require("telescope.themes").get_dropdown({})) end) :with_noremap() From 2e80eb8d44165a8b4680db08c5afc8fb1f2c8eb5 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:36:21 +0800 Subject: [PATCH 33/35] fix: CI & cleanup Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- .github/workflows/lint_code.yml | 2 +- lua/core/mapping.lua | 2 +- lua/keymap/helpers.lua | 14 +++++++------- lua/keymap/tool.lua | 5 ++--- lua/modules/configs/tool/search.lua | 1 + lua/modules/plugins/tool.lua | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/lint_code.yml b/.github/workflows/lint_code.yml index 9e88fa59e..71d11c5e2 100644 --- a/.github/workflows/lint_code.yml +++ b/.github/workflows/lint_code.yml @@ -8,4 +8,4 @@ jobs: - uses: actions/checkout@v4 - uses: lunarmodules/luacheck@v1 with: - args: . --std luajit --globals vim _toggle_lazygit _buf_vtext _command_panel _flash_esc_or_noh _debugging --max-line-length 150 --no-config + args: . --std luajit --globals vim _debugging _command_panel _flash_esc_or_noh _telescope_collections _toggle_lazygit --max-line-length 150 --no-config diff --git a/lua/core/mapping.lua b/lua/core/mapping.lua index 280ca1ba1..351216925 100644 --- a/lua/core/mapping.lua +++ b/lua/core/mapping.lua @@ -34,11 +34,11 @@ local core_map = { ["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|bn"] = map_cu("enew"):with_noremap():with_silent():with_desc("buffer: New"), ["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"), - ["n|bn"] = map_cu(":enew"):with_noremap():with_silent():with_desc("buffer: New"), -- 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"), diff --git a/lua/keymap/helpers.lua b/lua/keymap/helpers.lua index 3e9b4e51f..5f8c1fb9c 100644 --- a/lua/keymap/helpers.lua +++ b/lua/keymap/helpers.lua @@ -11,20 +11,20 @@ _G._command_panel = function() }) end -_G._telescope_collections = function(opts) - local pickers = require("telescope.pickers") - local finder = require("telescope.finders") - local conf = require("telescope.config").values +_G._telescope_collections = function(type) local actions = require("telescope.actions") local action_state = require("telescope.actions.state") - opts = opts or {} + local conf = require("telescope.config").values + local finder = require("telescope.finders") + local pickers = require("telescope.pickers") + type = type or {} local collections = vim.tbl_keys(require("search.tabs").collections) pickers - .new(opts, { + .new(type, { prompt_title = "Telescope Collections", finder = finder.new_table({ results = collections }), - sorter = conf.generic_sorter(opts), + sorter = conf.generic_sorter(type), attach_mappings = function(bufnr) actions.select_default:replace(function() actions.close(bufnr) diff --git a/lua/keymap/tool.lua b/lua/keymap/tool.lua index d73e42791..2efa33eb8 100644 --- a/lua/keymap/tool.lua +++ b/lua/keymap/tool.lua @@ -90,12 +90,11 @@ local plug_map = { :with_silent() :with_desc("tool: Toggle command panel"), ["n|f"] = map_callback(function() - -- luacheck: globals _telescope_collections - _telescope_collections(require("telescope.themes").get_dropdown({})) + _telescope_collections(require("telescope.themes").get_dropdown()) end) :with_noremap() :with_silent() - :with_desc("tool: Show Telescope collections"), + :with_desc("tool: Open Telescope"), -- Plugin: dap ["n|"] = map_callback(function() diff --git a/lua/modules/configs/tool/search.lua b/lua/modules/configs/tool/search.lua index 97d5d1d5b..e01f50437 100644 --- a/lua/modules/configs/tool/search.lua +++ b/lua/modules/configs/tool/search.lua @@ -1,6 +1,7 @@ return function() local builtin = require("telescope.builtin") local extensions = require("telescope").extensions + require("modules.utils").load_plugin("search", { collections = { file = { diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua index 3dc940e9d..75d5b5112 100644 --- a/lua/modules/plugins/tool.lua +++ b/lua/modules/plugins/tool.lua @@ -85,15 +85,15 @@ tool["nvim-telescope/telescope.nvim"] = { { "nvim-telescope/telescope-frecency.nvim" }, { "nvim-telescope/telescope-live-grep-args.nvim" }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + { + "FabianWirth/search.nvim", + config = require("tool.search"), + }, { "ahmedkhalf/project.nvim", event = { "CursorHold", "CursorHoldI" }, config = require("tool.project"), }, - { - "FabianWirth/search.nvim", - config = require("tool.search"), - }, { "aaronhallaert/advanced-git-search.nvim", cmd = { "AdvancedGitSearch" }, From c659de94bade9d60fc68cc246165b1294542454d Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:39:22 +0800 Subject: [PATCH 34/35] Revert `lazy-lock.json` Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lazy-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lazy-lock.json b/lazy-lock.json index a29c7b0b3..b04a3cd6f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -93,4 +93,4 @@ "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }, "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } -} \ No newline at end of file +} From d5d6d44158921f92919c891c32ca6d42c5119db7 Mon Sep 17 00:00:00 2001 From: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:40:32 +0800 Subject: [PATCH 35/35] fix: make luaJIT happy Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/keymap/helpers.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/keymap/helpers.lua b/lua/keymap/helpers.lua index 5f8c1fb9c..60d99e46f 100644 --- a/lua/keymap/helpers.lua +++ b/lua/keymap/helpers.lua @@ -11,20 +11,20 @@ _G._command_panel = function() }) end -_G._telescope_collections = function(type) +_G._telescope_collections = function(picker_type) local actions = require("telescope.actions") local action_state = require("telescope.actions.state") local conf = require("telescope.config").values local finder = require("telescope.finders") local pickers = require("telescope.pickers") - type = type or {} + picker_type = picker_type or {} local collections = vim.tbl_keys(require("search.tabs").collections) pickers - .new(type, { + .new(picker_type, { prompt_title = "Telescope Collections", finder = finder.new_table({ results = collections }), - sorter = conf.generic_sorter(type), + sorter = conf.generic_sorter(picker_type), attach_mappings = function(bufnr) actions.select_default:replace(function() actions.close(bufnr)