Skip to content

Commit

Permalink
perf!: consolidated updates to address performance issues
Browse files Browse the repository at this point in the history
This fixes #866 and closes #867.

---------

Signed-off-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com>
Co-authored-by: Layton <caolei6767@google.com>
  • Loading branch information
Jint-lzxy and Layton committed Jul 16, 2023
1 parent e69937d commit 42f7089
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
2 changes: 2 additions & 0 deletions lua/modules/configs/completion/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 14 additions & 1 deletion lua/modules/configs/editor/rainbow_delims.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
return function()
local function init_strategy()
local errors = 100
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 require("rainbow-delimiters").strategy["global"]
end

vim.g.rainbow_delimiters = {
strategy = {
[""] = require("rainbow-delimiters").strategy["local"],
[""] = init_strategy,
},
query = {
[""] = "rainbow-delimiters",
Expand Down
2 changes: 1 addition & 1 deletion lua/modules/plugins/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
6 changes: 3 additions & 3 deletions lua/modules/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ editor["LunarVim/bigfile.nvim"] = {
}
editor["ojroques/nvim-bufdel"] = {
lazy = true,
event = "BufReadPost",
cmd = { "BufDel", "BufDelAll", "BufDelOthers" },
}
editor["rhysd/clever-f.vim"] = {
lazy = true,
event = { "BufReadPost", "BufAdd", "BufNewFile" },
event = { "CursorHold", "CursorHoldI" },
config = require("editor.cleverf"),
}
editor["numToStr/Comment.nvim"] = {
Expand Down Expand Up @@ -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" },
Expand Down
4 changes: 2 additions & 2 deletions lua/modules/plugins/tool.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = {
Expand Down Expand Up @@ -77,7 +77,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" },
Expand Down
4 changes: 2 additions & 2 deletions lua/modules/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = {
Expand All @@ -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"] = {
Expand Down

0 comments on commit 42f7089

Please sign in to comment.