diff --git a/lazy-lock.json b/lazy-lock.json index e2bdb8d17..0a1c4b4d9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -27,7 +27,7 @@ "edge": { "branch": "master", "commit": "358cb6688ac577470a4eafcb53bdd63899dfc937" }, "fidget.nvim": { "branch": "legacy", "commit": "90c22e47be057562ee9566bad313ad42d622c1d3" }, "focus.nvim": { "branch": "master", "commit": "31f41d91b6b331faa07f0a513adcbc37087d028d" }, - "friendly-snippets": { "branch": "main", "commit": "8f5db6c5b691a6bbaa5dabd9afeb164ef8a06d04" }, + "friendly-snippets": { "branch": "main", "commit": "ea84a710262cb2c286d439070bad37d36fd3db25" }, "fzy-lua-native": { "branch": "master", "commit": "820f745b7c442176bcc243e8f38ef4b985febfaf" }, "gitsigns.nvim": { "branch": "main", "commit": "1e01b2958aebb79f1c33e7427a1bac131a678e0d" }, "hop.nvim": { "branch": "master", "commit": "31e0e42e629bf16affea747132d9c54f55fb17c8" }, @@ -49,14 +49,14 @@ "nvim-bufdel": { "branch": "main", "commit": "96c4f7ab053ddab0025bebe5f7c71e4795430e47" }, "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, "nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" }, - "nvim-dap": { "branch": "master", "commit": "3bde6f786057fa29d8356559b2ae3a52d9317fba" }, + "nvim-dap": { "branch": "master", "commit": "d17d1bba23ec72a157bd183c57840c39e323f515" }, "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, "nvim-lspconfig": { "branch": "master", "commit": "ba3ec2527aa7aae9b989d69966174a22b7d1b1dd" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, - "nvim-scrollview": { "branch": "main", "commit": "ac669ff6d98f79d4904ee6d716e51461f41c8e0e" }, + "nvim-scrollview": { "branch": "main", "commit": "9217dba703b43deb0751c08b8e2eeb6dbf2685fd" }, "nvim-tree.lua": { "branch": "master", "commit": "3b62c6bf2c3f2973036aed609d02fd0ca9c3af35" }, "nvim-treehopper": { "branch": "master", "commit": "5a28bff46c05d28bdb4bcaef67e046eb915a9390" }, - "nvim-treesitter": { "branch": "master", "commit": "f6c52eb8392e47aaf4878e5799ba54e7b30fa4f8" }, + "nvim-treesitter": { "branch": "master", "commit": "44211e7f6e669b8a07e86abc533b292a30c32d62" }, "nvim-treesitter-context": { "branch": "master", "commit": "6f8f788738b968f24a108ee599c5be0031f94f06" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "52f1f3280d9092bfaee5c45be5962fabee3d9654" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, @@ -67,7 +67,7 @@ "persisted.nvim": { "branch": "main", "commit": "b03c863731eafacd973912383297ea5d8fdb006a" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, - "rainbow-delimiters.nvim": { "branch": "master", "commit": "a9f2bb9777a4b2a5178df09fcb7c30e5664949bc" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "c6c2bda90f9f2d9eb047400f9153893d425bfa3c" }, "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, "smartyank.nvim": { "branch": "master", "commit": "7e3905578f646503525b2f7018b8afd17861018c" }, "sniprun": { "branch": "master", "commit": "28d55eeb6786a7037fd3564ced8296a71f1cece7" }, @@ -80,12 +80,12 @@ "telescope-live-grep-args.nvim": { "branch": "master", "commit": "0f75ea809c46af8997c64f49c52e3c641d887885" }, "telescope-undo.nvim": { "branch": "main", "commit": "3dec002ea3e7952071d26fbb5d01e2038a58a554" }, "telescope-zoxide": { "branch": "main", "commit": "68966349aa1b8e9ade403e18479ecf79447389a7" }, - "telescope.nvim": { "branch": "master", "commit": "2ea8dcd17b4f9b7714354965a28ae4fef4139c71" }, - "toggleterm.nvim": { "branch": "main", "commit": "1f5b551a0bd165d0c90cc35fef08b07b9dfb06e1" }, + "telescope.nvim": { "branch": "master", "commit": "47c755d737702df7a39b640c8d9c473a728be1df" }, + "toggleterm.nvim": { "branch": "main", "commit": "00c13dccc78c09fa5da4c5edda990a363e75035e" }, "trouble.nvim": { "branch": "main", "commit": "20d1b30d6925213abece21d35858a16e11d1e9fc" }, "vim-cool": { "branch": "master", "commit": "04bb7f5dade175a81b47abf4e87aeb30b05b33d8" }, "vim-easy-align": { "branch": "master", "commit": "12dd6316974f71ce333e360c0260b4e1f81169c3" }, - "vim-fugitive": { "branch": "master", "commit": "43f18ab9155c853a84ded560c6104e6300ad41da" }, + "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, "vim-go": { "branch": "master", "commit": "12de6c0bc0efce3cedc5e28d4fe0ecc3a4aaeb77" }, "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, "vim-matchup": { "branch": "master", "commit": "17cc05867cb3314761e4baa20115a27120f8e82c" }, diff --git a/lua/modules/configs/completion/lsp.lua b/lua/modules/configs/completion/lsp.lua index 2bb53acd2..6bd0436c2 100644 --- a/lua/modules/configs/completion/lsp.lua +++ b/lua/modules/configs/completion/lsp.lua @@ -146,4 +146,6 @@ return function() local final_opts = vim.tbl_deep_extend("keep", _opts, opts) nvim_lsp.dartls.setup(final_opts) end + + vim.api.nvim_command([[LspStart]]) -- Start LSPs end diff --git a/lua/modules/configs/completion/lspsaga.lua b/lua/modules/configs/completion/lspsaga.lua index 92ddaae0c..47e2fb9ca 100644 --- a/lua/modules/configs/completion/lspsaga.lua +++ b/lua/modules/configs/completion/lspsaga.lua @@ -94,7 +94,7 @@ return function() in_select = false, auto_save = false, keys = { - quit = "", + quit = "", select = "x", exec = "", }, diff --git a/lua/modules/configs/editor/rainbow_delims.lua b/lua/modules/configs/editor/rainbow_delims.lua index 820c80f98..037a81397 100644 --- a/lua/modules/configs/editor/rainbow_delims.lua +++ b/lua/modules/configs/editor/rainbow_delims.lua @@ -1,7 +1,25 @@ return function() + local function init_strategy(check_lines) + return function() + local errors = 200 + vim.treesitter.get_parser():for_each_tree(function(lt) + if lt:root():has_error() and errors >= 0 then + errors = errors - 1 + end + end) + if errors < 0 then + return nil + end + return (check_lines and vim.fn.line("$") > 450) and require("rainbow-delimiters").strategy["global"] + or require("rainbow-delimiters").strategy["local"] + end + end + vim.g.rainbow_delimiters = { strategy = { - [""] = require("rainbow-delimiters").strategy["local"], + [""] = init_strategy(false), + c = init_strategy(true), + cpp = init_strategy(true), }, query = { [""] = "rainbow-delimiters", diff --git a/lua/modules/plugins/completion.lua b/lua/modules/plugins/completion.lua index 1a4d06632..759137bca 100644 --- a/lua/modules/plugins/completion.lua +++ b/lua/modules/plugins/completion.lua @@ -2,7 +2,7 @@ local completion = {} completion["neovim/nvim-lspconfig"] = { lazy = true, - event = { "BufReadPost", "BufAdd", "BufNewFile" }, + event = { "CursorHold", "CursorHoldI" }, config = require("completion.lsp"), dependencies = { { "williamboman/mason.nvim" }, diff --git a/lua/modules/plugins/editor.lua b/lua/modules/plugins/editor.lua index 794c982a2..a0fce2c0c 100644 --- a/lua/modules/plugins/editor.lua +++ b/lua/modules/plugins/editor.lua @@ -36,11 +36,11 @@ editor["LunarVim/bigfile.nvim"] = { } editor["ojroques/nvim-bufdel"] = { lazy = true, - event = "BufReadPost", + event = "BufReadPre", } editor["rhysd/clever-f.vim"] = { lazy = true, - event = { "BufReadPost", "BufAdd", "BufNewFile" }, + event = { "CursorHold", "CursorHoldI" }, config = require("editor.cleverf"), } editor["numToStr/Comment.nvim"] = { @@ -87,7 +87,7 @@ editor["nvim-treesitter/nvim-treesitter"] = { vim.api.nvim_command("TSUpdate") end end, - event = "BufReadPre", + event = "BufReadPost", config = require("editor.treesitter"), dependencies = { { "nvim-treesitter/nvim-treesitter-textobjects" }, diff --git a/lua/modules/plugins/tool.lua b/lua/modules/plugins/tool.lua index 84fbc35d5..3b5dd88b1 100644 --- a/lua/modules/plugins/tool.lua +++ b/lua/modules/plugins/tool.lua @@ -32,7 +32,7 @@ tool["michaelb/sniprun"] = { -- You need to cd to `~/.local/share/nvim/site/lazy/sniprun/` and execute `bash ./install.sh`, -- if you encountered error about no executable sniprun found. build = "bash ./install.sh", - cmd = { "SnipRun" }, + cmd = "SnipRun", config = require("tool.sniprun"), } tool["akinsho/toggleterm.nvim"] = { @@ -89,7 +89,7 @@ tool["nvim-telescope/telescope.nvim"] = { { "debugloop/telescope-undo.nvim" }, { "ahmedkhalf/project.nvim", - event = "BufReadPost", + event = { "CursorHold", "CursorHoldI" }, config = require("tool.project"), }, { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, diff --git a/lua/modules/plugins/ui.lua b/lua/modules/plugins/ui.lua index 5d35dfb28..6f3933ff9 100644 --- a/lua/modules/plugins/ui.lua +++ b/lua/modules/plugins/ui.lua @@ -48,7 +48,7 @@ ui["zbirenbaum/neodim"] = { } ui["karb94/neoscroll.nvim"] = { lazy = true, - event = "BufReadPost", + event = { "CursorHold", "CursorHoldI" }, config = require("ui.neoscroll"), } ui["shaunsingh/nord.nvim"] = { @@ -67,7 +67,7 @@ ui["folke/paint.nvim"] = { } ui["dstein64/nvim-scrollview"] = { lazy = true, - event = "BufReadPost", + event = { "BufReadPost", "BufAdd", "BufNewFile" }, config = require("ui.scrollview"), } ui["edluffy/specs.nvim"] = {