From b5cf9fde0e64d963a776c80f87609a3425771e04 Mon Sep 17 00:00:00 2001 From: Shubham K <53286173+sk02241994@users.noreply.github.com> Date: Fri, 7 Apr 2023 22:59:13 +0530 Subject: [PATCH 01/13] Added current buffer fuzzy find key mapping (#1903) * Added current buffer fuzzy find key mapping * change telescope fuzzy mapping to fz Co-authored-by: Sidhanth Rathod --- lua/core/mappings.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 36f18a5..8fbbf22 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -265,6 +265,7 @@ M.telescope = { ["fb"] = { " Telescope buffers ", "find buffers" }, ["fh"] = { " Telescope help_tags ", "help page" }, ["fo"] = { " Telescope oldfiles ", "find oldfiles" }, + ["fz"] = { " Telescope current_buffer_fuzzy_find ", "find in current buffer" }, -- git ["cm"] = { " Telescope git_commits ", "git commits" }, From f873d3cc50fbd3fd8619b85883d8b7cd8cae0fd9 Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 10 Apr 2023 06:04:37 +0530 Subject: [PATCH 02/13] add an option for lsp_semantic_tokens hl groups | fix (#1907) also tiden up some stuff --- lua/core/bootstrap.lua | 2 ++ lua/core/default_config.lua | 1 + lua/core/utils.lua | 46 +++++++++++++++++++------------------ 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua index 2f435d9..865f3b4 100644 --- a/lua/core/bootstrap.lua +++ b/lua/core/bootstrap.lua @@ -50,11 +50,13 @@ M.gen_chadrc_template = function() local path = vim.fn.stdpath "config" .. "/lua/custom/" local input = vim.fn.input "Do you want to install example custom config? (y/N) : " + -- clone example_config repo if input == "y" then M.echo "cloning example custom config repo ..." vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path } vim.fn.delete(path .. ".git", "rf") else + -- use very minimal chadrc vim.fn.mkdir(path, "p") local file = io.open(path .. "chadrc.lua", "w") diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index f09fad0..0f5ce56 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -18,6 +18,7 @@ M.ui = { theme_toggle = { "onedark", "one_light" }, theme = "onedark", -- default theme transparency = false, + lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens -- cmp themeing cmp = { diff --git a/lua/core/utils.lua b/lua/core/utils.lua index e95078c..4c44dc6 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -52,37 +52,39 @@ M.remove_disabled_keys = function(chadrc_mappings, default_mappings) end M.load_mappings = function(section, mapping_opt) - local function set_section_map(section_values) - if section_values.plugin then - return - end + vim.schedule(function() + local function set_section_map(section_values) + if section_values.plugin then + return + end - section_values.plugin = nil + section_values.plugin = nil - for mode, mode_values in pairs(section_values) do - local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {}) - for keybind, mapping_info in pairs(mode_values) do - -- merge default + user opts - local opts = merge_tb("force", default_opts, mapping_info.opts or {}) + for mode, mode_values in pairs(section_values) do + local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {}) + for keybind, mapping_info in pairs(mode_values) do + -- merge default + user opts + local opts = merge_tb("force", default_opts, mapping_info.opts or {}) - mapping_info.opts, opts.mode = nil, nil - opts.desc = mapping_info[2] + mapping_info.opts, opts.mode = nil, nil + opts.desc = mapping_info[2] - vim.keymap.set(mode, keybind, mapping_info[1], opts) + vim.keymap.set(mode, keybind, mapping_info[1], opts) + end end end - end - local mappings = require("core.utils").load_config().mappings + local mappings = require("core.utils").load_config().mappings - if type(section) == "string" then - mappings[section]["plugin"] = nil - mappings = { mappings[section] } - end + if type(section) == "string" then + mappings[section]["plugin"] = nil + mappings = { mappings[section] } + end - for _, sect in pairs(mappings) do - set_section_map(sect) - end + for _, sect in pairs(mappings) do + set_section_map(sect) + end + end) end M.lazy_load = function(plugin) From af123eee4d4f4ecd8ff935ad465e589673b81619 Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 10 Apr 2023 07:21:07 +0530 Subject: [PATCH 03/13] handle semantic_tokens on lsp_attach based on chadrc option (#1907) --- lua/plugins/configs/lspconfig.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index 24083ae..fbce3a8 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -15,6 +15,10 @@ M.on_attach = function(client, bufnr) if client.server_capabilities.signatureHelpProvider then require("nvchad_ui.signature").setup(client) end + + if not utils.load_config().ui.lsp_semantic_tokens then + client.server_capabilities.semanticTokensProvider = nil + end end M.capabilities = vim.lsp.protocol.make_client_capabilities() From 34bdca17d298c5762219649b238e8f1ca0689352 Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 10 Apr 2023 10:05:05 +0530 Subject: [PATCH 04/13] clean up --- lua/core/bootstrap.lua | 21 +++------------------ lua/core/default_config.lua | 18 ++++-------------- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua index 865f3b4..b00fc09 100644 --- a/lua/core/bootstrap.lua +++ b/lua/core/bootstrap.lua @@ -25,24 +25,9 @@ M.lazy = function(install_path) -- install plugins require "plugins" - vim.api.nvim_buf_delete(0, { force = true }) -- close lazy window - ---------- mason packages ------------- - vim.schedule(function() - vim.cmd "MasonInstallAll" - local packages = table.concat(vim.g.mason_binaries_list, " ") - - require("mason-registry"):on("package:install:success", function(pkg) - packages = string.gsub(packages, pkg.name:gsub("%-", "%%-"), "") -- rm package name - - if packages:match "%S" == nil then - vim.schedule(function() - vim.api.nvim_buf_delete(0, { force = true }) - M.echo "Now please read the docs at nvchad.com!! 󰕹 󰱬" - end) - end - end) - end) + -- mason packages & show post_boostrap screen + require "nvchad.post_bootstrap"() end M.gen_chadrc_template = function() @@ -60,7 +45,7 @@ M.gen_chadrc_template = function() vim.fn.mkdir(path, "p") local file = io.open(path .. "chadrc.lua", "w") - file:write "local M = {}\n M.ui = {theme = 'onedark'}\n return M" + file:write "---@type ChadrcConfig \n local M = {}\n M.ui = {theme = 'onedark'}\n return M" file:close() end end diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 0f5ce56..61fa715 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -1,12 +1,7 @@ --- Chadrc overrides this file - local M = {} M.options = { - nvChad = { - update_url = "https://github.com/NvChad/NvChad", - update_branch = "v2.0", - }, + nvchad_branch = "v2.0", } M.ui = { @@ -29,9 +24,7 @@ M.ui = { selected_item_bg = "colored", -- colored / simple }, - telescope = { - style = "borderless", -- borderless / bordered - }, + telescope = { style = "borderless" }, -- borderless / bordered ------------------------------- nvchad_ui modules ----------------------------- statusline = { @@ -76,9 +69,7 @@ M.ui = { }, }, - cheatsheet = { - theme = "grid", -- simple/grid - }, + cheatsheet = { theme = "grid" }, -- simple/grid lsp = { -- show function signatures i.e args as you type @@ -89,11 +80,10 @@ M.ui = { }, } -M.plugins = "" -- path i.e "custom.plugins" -> custom/plugins.lua only and not custom/plugins/init.lua!!!! +M.plugins = "" -- path i.e "custom.plugins", so make custom/plugins.lua file M.lazy_nvim = require "plugins.configs.lazy_nvim" -- config for lazy.nvim startup options --- these are default mappings, check core.mappings for table structure M.mappings = {} return M From 12f26e91efadd0e9f6140af5f4e0d27f9e10506f Mon Sep 17 00:00:00 2001 From: siduck Date: Wed, 12 Apr 2023 14:12:32 +0530 Subject: [PATCH 05/13] rm depcreated option from nvimtree config --- lua/plugins/configs/nvimtree.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua index 875fa5b..ff9aad3 100644 --- a/lua/plugins/configs/nvimtree.lua +++ b/lua/plugins/configs/nvimtree.lua @@ -16,7 +16,6 @@ local options = { adaptive_size = false, side = "left", width = 30, - hide_root_folder = true, preserve_window_proportions = true, }, git = { @@ -32,6 +31,7 @@ local options = { }, }, renderer = { + root_folder_label = false, highlight_git = false, highlight_opened_files = "none", From 7914da7cd34a23a7e23642162aca2ca3b4440da9 Mon Sep 17 00:00:00 2001 From: siduck Date: Wed, 12 Apr 2023 18:03:18 +0530 Subject: [PATCH 06/13] include c , v keys in whichkey lazyloading --- lua/plugins/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 19e212e..cc196a1 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -253,7 +253,7 @@ local default_plugins = { -- Only load whichkey after all the gui { "folke/which-key.nvim", - keys = { "", '"', "'", "`" }, + keys = { "", '"', "'", "`", "c", "v" }, init = function() require("core.utils").load_mappings "whichkey" end, From fdb3ddb806c59527de35d9249e37023d119cc896 Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 23 Apr 2023 08:06:02 +0530 Subject: [PATCH 07/13] rm un-needed code --- lua/plugins/configs/lspconfig.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/lua/plugins/configs/lspconfig.lua b/lua/plugins/configs/lspconfig.lua index fbce3a8..441d5ae 100644 --- a/lua/plugins/configs/lspconfig.lua +++ b/lua/plugins/configs/lspconfig.lua @@ -7,9 +7,6 @@ local utils = require "core.utils" -- export on_attach & capabilities for custom lspconfigs M.on_attach = function(client, bufnr) - client.server_capabilities.documentFormattingProvider = false - client.server_capabilities.documentRangeFormattingProvider = false - utils.load_mappings("lspconfig", { buffer = bufnr }) if client.server_capabilities.signatureHelpProvider then From cff182ce4baf57e8c37fd064da5e1a71f36e1f57 Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 23 Apr 2023 17:11:59 +0530 Subject: [PATCH 08/13] remove outdated plugin info in readme --- .github/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/README.md b/.github/README.md index d5e4946..dad0c3a 100644 --- a/.github/README.md +++ b/.github/README.md @@ -89,9 +89,8 @@ A fuzzy file finder, picker, sorter, previewer and much more: - Many beautiful themes, theme toggler by our [base46 plugin](https://github.com/NvChad/base46) - Inbuilt terminal toggling & management with [Nvterm](https://github.com/NvChad/nvterm) - NvChad updater, hide & unhide terminal buffers with [NvChad extensions](https://github.com/NvChad/extensions) -- Lightweight & performant ui plugin with [NvChad UI](https://github.com/NvChad/ui) +- Lightweight & performant ui plugin with [NvChad UI](https://github.com/NvChad/ui) It provides statusline modules, tabufline ( tabs + buffer manager) , beautiful cheatsheets and much more! - File navigation with [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) -- Managing tabs, buffers with [bufferline.nvim](https://github.com/akinsho/bufferline.nvim) - Beautiful and configurable icons with [nvim-web-devicons](https://github.com/kyazdani42/nvim-web-devicons) - Git diffs and more with [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) - NeoVim Lsp configuration with [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) and [mason.nvim](https://github.com/williamboman/mason.nvim) From 56e6234363b065e72548b1a2877c71e32e84c08f Mon Sep 17 00:00:00 2001 From: siduck Date: Tue, 25 Apr 2023 10:22:57 +0530 Subject: [PATCH 09/13] add option for using extended base46 integrations --- lua/core/default_config.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 61fa715..ab71bfd 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -15,6 +15,9 @@ M.ui = { transparency = false, lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens + -- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations + extended_integrations = {}, -- these aren't compiled by default, ex: "alpha", "notify" + -- cmp themeing cmp = { icons = true, From 907684efa019c7d5c189e29358b466852965fd76 Mon Sep 17 00:00:00 2001 From: siduck Date: Sun, 30 Apr 2023 06:13:24 +0530 Subject: [PATCH 10/13] include lazyloading of comment.nvim with gcc/gbc keys (#1972) --- lua/plugins/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index cc196a1..0c44931 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -201,7 +201,7 @@ local default_plugins = { { "numToStr/Comment.nvim", - -- keys = { "gc", "gb" }, + keys = { "gcc", "gbc" }, init = function() require("core.utils").load_mappings "comment" end, From b51065b1a8218ebc988d3d773e4b552841c09476 Mon Sep 17 00:00:00 2001 From: Mateus Abelli Date: Sun, 30 Apr 2023 01:44:21 -0300 Subject: [PATCH 11/13] fix: readme links (#1974) --- .github/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/README.md b/.github/README.md index dad0c3a..48100ce 100644 --- a/.github/README.md +++ b/.github/README.md @@ -3,13 +3,13 @@ From 03f93e5d7540920582e9fb03e091821e6f6cf1b9 Mon Sep 17 00:00:00 2001 From: siduck Date: Wed, 3 May 2023 13:49:50 +0530 Subject: [PATCH 12/13] update icons to nerdfont icons 3.0x --- lua/plugins/configs/lazy_nvim.lua | 2 +- lua/plugins/configs/mason.lua | 4 ++-- lua/plugins/configs/others.lua | 2 +- lua/plugins/configs/whichkey.lua | 31 ------------------------------- lua/plugins/init.lua | 8 +------- 5 files changed, 5 insertions(+), 42 deletions(-) delete mode 100644 lua/plugins/configs/whichkey.lua diff --git a/lua/plugins/configs/lazy_nvim.lua b/lua/plugins/configs/lazy_nvim.lua index dbb3abc..cd170bd 100644 --- a/lua/plugins/configs/lazy_nvim.lua +++ b/lua/plugins/configs/lazy_nvim.lua @@ -5,7 +5,7 @@ return { ui = { icons = { ft = "", - lazy = "鈴 ", + lazy = "󰂠 ", loaded = "", not_loaded = "", }, diff --git a/lua/plugins/configs/mason.lua b/lua/plugins/configs/mason.lua index 8ccc313..3692a15 100644 --- a/lua/plugins/configs/mason.lua +++ b/lua/plugins/configs/mason.lua @@ -6,8 +6,8 @@ local options = { ui = { icons = { package_pending = " ", - package_installed = " ", - package_uninstalled = " ﮊ", + package_installed = "󰄳 ", + package_uninstalled = " 󰚌", }, keymaps = { diff --git a/lua/plugins/configs/others.lua b/lua/plugins/configs/others.lua index 874a0b6..8775517 100644 --- a/lua/plugins/configs/others.lua +++ b/lua/plugins/configs/others.lua @@ -53,7 +53,7 @@ M.gitsigns = { signs = { add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" }, change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" }, - delete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" }, + delete = { hl = "DiffDelete", text = "󰍵", numhl = "GitSignsDeleteNr" }, topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" }, changedelete = { hl = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" }, untracked = { hl = "GitSignsAdd", text = "│", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, diff --git a/lua/plugins/configs/whichkey.lua b/lua/plugins/configs/whichkey.lua deleted file mode 100644 index cfdf4c0..0000000 --- a/lua/plugins/configs/whichkey.lua +++ /dev/null @@ -1,31 +0,0 @@ -local options = { - - icons = { - breadcrumb = "»", -- symbol used in the command line area that shows your active key combo - separator = "  ", -- symbol used between a key and it's label - group = "+", -- symbol prepended to a group - }, - - popup_mappings = { - scroll_down = "", -- binding to scroll down inside the popup - scroll_up = "", -- binding to scroll up inside the popup - }, - - window = { - border = "none", -- none/single/double/shadow - }, - - layout = { - spacing = 6, -- spacing between columns - }, - - hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, - - triggers_blacklist = { - -- list of mode / prefixes that should never be hooked by WhichKey - i = { "j", "k" }, - v = { "j", "k" }, - }, -} - -return options diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 0c44931..2f711af 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -95,7 +95,7 @@ local default_plugins = { -- git stuff { "lewis6991/gitsigns.nvim", - ft = "gitcommit", + ft = { "gitcommit", "diff" }, init = function() -- load gitsigns only when a git file is opened vim.api.nvim_create_autocmd({ "BufRead" }, { @@ -190,7 +190,6 @@ local default_plugins = { "hrsh7th/cmp-path", }, }, - opts = function() return require "plugins.configs.cmp" end, @@ -233,11 +232,9 @@ local default_plugins = { init = function() require("core.utils").load_mappings "telescope" end, - opts = function() return require "plugins.configs.telescope" end, - config = function(_, opts) dofile(vim.g.base46_cache .. "telescope") local telescope = require "telescope" @@ -257,9 +254,6 @@ local default_plugins = { init = function() require("core.utils").load_mappings "whichkey" end, - opts = function() - return require "plugins.configs.whichkey" - end, config = function(_, opts) dofile(vim.g.base46_cache .. "whichkey") require("which-key").setup(opts) From 3dd0fa6c5b0933d9a395e2492de69c151831c66e Mon Sep 17 00:00:00 2001 From: siduck Date: Thu, 4 May 2023 07:34:27 +0530 Subject: [PATCH 13/13] temporarily change folder icon old folder icon was removed from octicons and nerdfonts uses latest octicons --- lua/plugins/configs/nvimtree.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/configs/nvimtree.lua b/lua/plugins/configs/nvimtree.lua index ff9aad3..25c5d68 100644 --- a/lua/plugins/configs/nvimtree.lua +++ b/lua/plugins/configs/nvimtree.lua @@ -48,10 +48,10 @@ local options = { }, glyphs = { - default = "", + default = "󰈚", symlink = "", folder = { - default = "", + default = "󰉋", empty = "", empty_open = "", open = "",