Skip to content

Commit

Permalink
lazy load notify and dressing
Browse files Browse the repository at this point in the history
  • Loading branch information
mosheavni committed May 12, 2024
1 parent 49aaba1 commit 7595831
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"lspsaga.nvim": { "branch": "main", "commit": "052234296f13e2705d5d290c7bd5a36d3dd81fde" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "05744f0f1967b5757bd05c08df4271ab8ec990aa" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "c3168b2a6a09722d4567ef4a37364b9b30bf7f20" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
Expand Down Expand Up @@ -69,7 +69,7 @@
"nvim-pqf": { "branch": "main", "commit": "ba0e291cb5c0249838132e197dac082777bdc7d6" },
"nvim-surround": { "branch": "main", "commit": "6d0dc3dbb557bcc6a024969da461df4ba803fc48" },
"nvim-tree.lua": { "branch": "master", "commit": "64f61e4c913047a045ff90bd188dd3b54ee443cf" },
"nvim-treesitter": { "branch": "master", "commit": "d6dcfe888724d271dcbaa6f2c80f9f706b39cd2a" },
"nvim-treesitter": { "branch": "master", "commit": "fa1515b015ab9894aa9866410b1c23e03d2be4af" },
"nvim-treesitter-context": { "branch": "master", "commit": "7f116ce80083457b69a8c1551a7d7a198d9ebd16" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
"nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" },
Expand Down
35 changes: 24 additions & 11 deletions .config/nvim/lua/plugins/dressing.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
local M = {
'stevearc/dressing.nvim',
config = function()
require('dressing').setup {
input = {
enabled = true,
relative = 'editor',
trim_prompt = false,
insert_only = true,
start_in_insert = true,
},
}
lazy = true,
opts = {
input = {
enabled = true,
relative = 'editor',
trim_prompt = false,
insert_only = true,
start_in_insert = true,
},
},
config = function(_, opts)
require('dressing').setup(opts)
vim.cmd [[hi link FloatTitle Normal]]
end,
event = 'VeryLazy',
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
require('lazy').load { plugins = { 'dressing.nvim' } }
return vim.ui.select(...)
end
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.input = function(...)
require('lazy').load { plugins = { 'dressing.nvim' } }
return vim.ui.input(...)
end
end,
}
return M
23 changes: 14 additions & 9 deletions .config/nvim/lua/plugins/look-and-feel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,29 @@ local M = {
},
{
'rcarriga/nvim-notify',
event = 'VeryLazy',
keys = {
{
'<Leader>x',
function()
require('notify').dismiss { pending = true, silent = true }
end,
desc = 'Dismiss all notifications',
},
},
config = function()
local notify = require 'notify'
notify.setup {
render = 'compact',
stages = 'static',
timeout = 3000,
}
vim.notify = notify
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.notify = function(...)
if not require('lazy.core.config').plugins['nvim-notify']._.loaded then
require('lazy').load { plugins = { 'nvim-notify' } }
end
require 'notify'(...)
end
end,
opts = {
render = 'compact',
stages = 'static',
timeout = 3000,
},
},
{
'echasnovski/mini.indentscope',
Expand Down

0 comments on commit 7595831

Please sign in to comment.